Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 "http://192.168.1.6:3128/"; 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
share|improve this question
    
    
Could you add the out put of the following two commands: sudo head -n 3 /etc/apt/apt.conf.d/proxy and sudo head -n 2 /etc/apt/apt.conf? Thanks. –  qbi Sep 15 '11 at 12:31
    
Note that /etc/apt/apt.conf.d should be a directory, not a file. –  Piskvor Sep 15 '11 at 13:04
add comment

marked as duplicate by jrg, Jacob Johan Edwards, 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.

2 Answers

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.

share|improve this answer
add comment

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.

Source.

share|improve this answer
add comment

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