1
vote
1answer
368 views

setting PATH to /etc/profile or /etc/environment does not work with sudo

I want to launch Intellij IDEA IDE via sudo idea.sh. sudo because IDE needs to manupulate files from /etc/share. idea.sh is placed at /home/<username>/<path>/bin/idea.sh. I tried to add ...
2
votes
1answer
2k views

apt-get not using http_proxy in ubuntu 13.10

I just updated from Ubuntu 12.04 to 13.10 In 12.04, I used to set up my http_proxy variable in .bashrc and then use apt-get as follows sudo -E apt-get update The -E option in sudo used to make the ...
1
vote
2answers
1k views

How to set default environment variables for other users?

I installed postgres under Lubuntu 13.04. When I try to run it: sudo -u postgres psql it gives me this error: psql: could not connect to server: No such file or directory Is the server running ...
0
votes
1answer
498 views

sudo environment

Is there a way to use config files for use with sudo? For example a .bashrc, .gitconfig, or an emacs init.el Specifically I wanted to get LSCOLORS in sudo commands. I know that I can put these ...
2
votes
1answer
967 views

Add directory to path for sudo

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. ...
0
votes
1answer
264 views

Difference between /etc/security/pam_env.conf and /etc/environment + making sudo read pam_env.conf

I struggle to see the difference between pam_env.conf and /etc/environment. To me they both do the same thing, with a difference syntax. The manpages were no help. So what is the difference? ...
14
votes
3answers
38k views

How to configure ADB access for Android devices?

I'm using Ubuntu 12.10 and I have installed Android SDK, set it's path in my user .bashrc and it works. The problem is that my phone requires adb to be ran by root for permissions, but running adb ...
9
votes
2answers
20k views

Setting the PATH so it applies to all users, including root/sudo

The instructions in How do I set PATH variables for all users on a server? work to set the PATH for all 'normal' users. However, if I do sudo -s and then printenv PATH the updated path is not shown. ...
2
votes
1answer
734 views

Is there a difference between using setuid()/setgid() within a program and invoking it with sudo -u xxx -g xxx?

Consider this python script, which invokes HandBrakeCLI, a program that attempts to read from the dvd drive: invoke.py #!/usr/bin/python import sys import os import subprocess as subp import ...
11
votes
4answers
6k views

Setting TeX Live path for root

I have installed TeX Live 2011 vanilla and I have trouble setting the TeX Live path for root (in Ubuntu 11.10). The problem is that when I run sudo tlmgr I get: sudo: tlmgr: command not found To ...
4
votes
1answer
4k views

/etc/environment and /etc/profile.d/* ignored for the root user [duplicate]

How do I set global environment variables in Ubuntu, in such a way, that they would apply also to root user? Setting PATH or JAVA_HOME in /etc/environment or in /etc/profile.d/my_settings.sh both ...
11
votes
2answers
16k views

Environment variables when run with 'sudo'

As example to my question, my ~/.bashrc file contains this lines: > export LD_LIBRARY_PATH=/opt/intel/mkl/lib/ia32:$LD_LIBRARY_PATH > export LD_PRELOAD=/opt/intel/mkl/lib/ia32/libmkl_core.so ...
2
votes
1answer
4k views

How can I make sure an environment variable is set when I sudo?

How can I make sure an environment variable (GRAILS_HOME for example) is set when I sudo? I put a script in my /etc/profile.d with this value and made it ugo+x. What do I need to do to make this ...