6

I know creating a .bashrc and adding

PATH=$PATH:/home/asco/adt-bundle-linux-x86_64/sdk/tools
PATH=$PATH:/home/asco/adt-bundle-linux-x86_64/sdk/platform-tools

will add those directories to my path. How do I do the same so the programs in those directories will be available with sudo? I tried the same as su in /root, but that didn't work.

1 Answer 1

4

IMO easiest way is to add those lines to /root/.bashrc

Alternately, you can add /home/asco/adt-bundle-linux-x86_64/sdk/tools and /home/asco/adt-bundle-linux-x86_64/sdk/platform-tools to /etc/environment

Last, you could, as root, move the sdk directory to a central location on root's path, such as /usr/local/lib.

1
  • as of latest Ubuntu LTS, adding things to PATH in /etc/environment doesn't do it for commands ran under sudo. Oct 23, 2020 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.