Inizio  >  Docs  >  Linux  >  Trucchi veloci  >  add a new ppa reposity through a Proxy  
add a new ppa reposity through a Proxyadd a new ppa reposity through a Proxy

Index

add a new ppa reposity through a Proxy

If you try to add a repository with this cmd:

sudo add-apt-repository ppa:otto-kesselgulasch/gimp 

and you are beyond a proxy, you'll get this error message:

 
 
Traceback (most recent call last):   File "/usr/bin/add-apt-repository", line 125, in <module>     ppa_info = get_ppa_info_from_lp(user, ppa_name)   File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 80, in get_ppa_info_from_lp     curl.perform() pycurl.error: (6, "Couldn't resolve host 'launchpad.net'") 

it's because the sudo Bash env variables are resetted (for more info check this)

All you have to do is to configure the Bash env vars HTTP_PROXY and HTTPS_PROXY for the sudo env.Add this file:

/etc/sudoers.d/proxy 

with this content:

Defaults   env_reset
Defaults   env_keep += "HTTP_PROXY"
Defaults   env_keep += "HTTPS_PROXY"


P.S. if gpg return errors during the GPGkey import try adding this options:

http-proxy=http://192.168.2.3:8080

(change the proxy IP!!!!)

gpg --ignore-time-conflict --no-options --keyserver-options  http-proxy=http://192.168.2.3:8080 --no-default-keyring --secret-keyring /tmp/tmp.IQAcEGn8ie --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://keyserver.ubuntu.com:80/ --recv FB97E9C3A97F85C095AEA7903BDAAC08614C4B38