Possible Duplicate:
apt-get does not work with proxy

I am a newbie to Ubuntu/Linux. I am using Ubuntu in office campus and we have a proxy server. I want to update or install new software like flash ,media player, networking tools etc., but I am unable to install from the Synaptic Package Manager.

I have created an apt.conf file which contains Acquire::http::Proxy ""; I also have an apt.conf.d file but its empty and I don't know what to do with this file.

This is the error I encounter when I try to update:

E: Syntax error /etc/apt/apt.conf.d/proxy:3: Extra junk at end of file
E: Syntax error /etc/apt/apt.conf:2: Extra junk at end of file

marked as duplicate by jrg, Jjed, jokerdino, Jorge Castro, fossfreedom Jan 31 '12 at 19:10

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


I've created a new file in /etc/apt/apt.conf.d/, named 01proxy:

Acquire::http { Proxy "http://apt-proxy:3142"; };

where apt-proxy is the hostname of the proxy server. Been using this since 9.04, and It Works without any issues.


First, I would try using the Network Proxy configuration GUI.

If that fails, add the following to /etc/bash.bashrc:

export http_proxy=http://username:password@proxyserver.net:port/
export ftp_proxy=http://username:password@proxyserver.net:port/

You can omit the username:password, if your proxy server has no password.


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