Google Plus

How to update and add repository in Ubuntu 11.04 Natty and 11.10 oneiric ocelot behind a proxy | FAQs

Written by Mel Kham on . Posted in Frequently Asked Questions

 Question: How to install , update packages and add PPA repository  behind a proxy Server in Ubuntu 10.10, 11.04 Natty and 11.10 oneiric ocelot?

Answer:

Open terminal and add the following lines to /etc/apt/apt.conf.

gedit /etc/apt/apt.conf

And add these 2 line :

Acquire::http::Proxy "http://user:pass@proxy-host:port/";
Acquire::ftp::Proxy "http://user:pass@proxy-host:port/";

save  and exit. Now  apt-get update and  should  work behind a proxy, but you will notice that still something is not working, is the add-apt-repositoy command.

To be able to add repository behind a proxy, type the following commands:

# export https_proxy="http://192.168.1.5:8080"
# sed -i 's/"keyserver.ubuntu.com"/"hkp://keyserver.ubuntu.com:80"/' /usr/share/pyshared/softwareproperties/ppa.py

Now you can add  repositories in Lucid and Natty using LANG=C add-apt-repository

Example:

root@ubuntu:~# LANG=C add-apt-repository ppa:motumedia/mplayer-daily

This  method  was  tested  under  Ubuntu 11.04 and 10.10  and is working  fine:)

Please  feel free to ask any question by posting in the Forum.

For questions please refer to our Q/A forum at : http://ask.unixmen.com

Mel Kham

Founder of Unixmen, Living in Amsterdam. Am working in my free time to help people to understand the Opensource and to explain them in easy way how to make the fist steps to the the light. Working day and night with my Co-founder Zinovsky to keep this website live even with less resources.
  • NeWiTa

    It works fine with Ubuntu 10.10 behind University of the South Pacific proxy.

    thanks

  • tired

    Not working there is no such directory in apt even

  • pirat9

    enter your message here…[quote=tired]Not working there is no such directory in apt even[/quote]
    i know . just make the directory and make the file
    mkdir /etc/apt/
    vi apt.conf

    save and exit

  • Sumit Gupta

    hello,
    i actually first used proxy for update manager but now i need to download without proxy ..so what changes do i need to make to update…
    please help

  • Jalal

    I used the first part only and it worked :)
    I’ve been looking for a solution for more than 4 hours. Thanks

  • Danie Bosman

    Thanx a million for this !!!
    I’ve tried several solutions posted on this topic, but to no avail, until I set your solution in place!!

    Now I’m happily updating from behind a company proxy.

    I’m still confused why there are so many differing solutions that are applied out there, but grateful for now that I am able to update.

    Cheers!

    Danie Bosman

Like us on Facebook

This week Top Posts

Write for us

Recent Comments

Nova

|

I wonder if there is a way to create your own themes.

Red Adaya

|

Thank you! This worked for me!!!

SK

|

Andrew look into your httpd.conf file at line no 350. There might be a syntax error.

andrew

|

hello I have this error

[root@cloud html]# /etc/init.d/httpd restart

then this appears

Starting httpd: httpd: Syntax error on line 350 of /etc/httpd/conf/httpd.conf: without matching section.

plz tell how to fix this.

 
IDG Tech Network
Copyright © 2008-2013 Unixmen.com .
Maintained by Anblik .