Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

PATH environment variable in sudo

📅 2015-Jul-31 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ environment variables, sudo ⬩ 📚 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:

Reference:

Tried with: Ubuntu 14.04


© 2023 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 @codeyarns@hachyderm.io📧