Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

PATH environment variable in sudo

📅 2015-Jul-31 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ environment variable, path, sudo, sudoers ⬩ 📚 Archive

Using sudo is a common, safe and recommended method to execute commands that require superuser privileges. However, this command resets the PATH environment variable. So, some badly written installation scripts that require a particular PATH will fail in strange ways when run as sudo.

Here is some useful information about sudo and the PATH environment variable:

Tried with: Ubuntu 14.04