Google Plus

Configure apt-get to work behind a proxy in Ubuntu 10.04 Lucid Lynx

Written by Mel Kham on . Posted in Linux tutorials

How to apply apt-get  update or install in Ubuntu 10.04 Lucid Lynx ? I was behind a proxy server and after installing Ubuntu 10.04 Lucid lynx i coulden`t update or install anything using the apt-get command. After searching i found that The  apt  package has been changed, now there is no more   apt.conf on  /etc/apt  directory.

 




What i did to resolve this issue is the follow :

Open terminal and the file  /etc/bash.bashrsc

sudo gedit /etc/bash.bashrc

 

 

 

and  add  at the  bottom of  the  file these 2 lines :

 

#proxy 
export http_proxy=http://user:password@host:port/
export ftp_proxy=http://user:pass@host:port/


Now save  and  exit


Now you will be able to  update, upgrade or install packages in Ubuntu 10.04 Lucid Lynx

{loadposition user9}

Related Article By Tags:

{loadposition user1}

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.
  • anon

    this is the way it worked for me:

    add to /etc/apt/apt.conf (create new if not existing)

    Acquire::http::Proxy “http://proxy.example.com:8080/”;

  • udippel

    The idea is okay, but on any ‘strict’ authentication (NT instead of LM), this method “http://user:pass…” will not work.

  • Craig

    This did not work for me. Nor did creating an apt.conf file.

    Any help?

    • udippel

      Alas, the *nix got kind of stuck at the basic NTLM out of the box. It is high time in the area of Microsoft Forefront and other, ‘advanced’ filters, that *buntu gets a default authentication mechanism for NTLMv2 and sorts.
      [/Rant]

      What helped here, was a longer, two-pronged trip:
      1. cntlm for authentication (it is in the repository)
      2. using aptitude, since apt-get is also very basic, and limited to more or less direct Internet connections.
      Like:
      sudo aptitude -o Acquire::http::Proxy=http://127.0.0.1:3128 update|safe-upgrade
      Eventually, you need extra options, like
      -o Acquire::http::No-Cache=True -o Acquire::BrokenProxy=True

      But first, make sure that you have a properly working cntlm!

      Uwe

      • Ananya

        [quote]Alas, the *nix got kind of stuck at the basic NTLM out of the box. It is high time in the area of Microsoft Forefront and other, ‘advanced’ filters, that *buntu gets a default authentication mechanism for NTLMv2 and sorts.
        [/Rant]

        What helped here, was a longer, two-pronged trip:
        1. cntlm for authentication (it is in the repository)
        2. using aptitude, since apt-get is also very basic, and limited to more or less direct Internet connections.
        Like:
        sudo aptitude -o Acquire::http::Proxy=http://127.0.0.1:3128 update|safe-upgrade
        Eventually, you need extra options, like
        -o Acquire::http::No-Cache=True -o Acquire::BrokenProxy=True

        But first, make sure that you have a properly working cntlm!

        Uwe[/quote]

        Thnxx dude uddpl i was eager to get it working since 4 dayzz it worked finally "sudo aptitude -o Acquire::http::Proxy=http://127.0.0.1:3128 update|safe-upgrade"

        :evil:

        i m amazed y adding the line Export http_proxy="http://yourproxy.com:port" in d file /etc/bash.bashrc didn’t work :cry: :!: :!:

  • udippel

    Since I had to dig deeper through the whole matter to get it working (again) here, after changes of the proxy, and tight passwords, here is a summary on what is actually going on:

    All those username:password@ authentication only do basic (LM) authentication; not NTLMv2. Plus, more and more users have to add ‘special characters’ into their passwords, and then, those special characters are somehow wrongly ‘mapped’ to simple characters (I can’t find the proper reference just now; Dr. Google can help). And, no, escapes don’t help; due to the mapping.

    I myself found it quite irritating that my problems here were almost always countered to 99% by those ‘off-the-shelf’ solutions; offered in good faith by the people with weak authentication mechanisms in their organisations. There is no difference between Gnome and KDE, by the way. neither does strong NTLM authentication with their proxy settings. On top of that, KDE (4.4.2) simply disregards its own settings for system-wide proxies. (This is ‘Linux on the desktop’ for you. :( )

  • http://www.auvix.com.br gilberto dos santos alves

    i install my ubuntu server 10.4 in virtual machine created by qemu in a debian lenny. after install apt-get does not work using classic parameters like acquire proxy … I found first post creating export http_proxy … and ftp_proxy in /etc/bash.bashrsc was worked. but i believe that ubuntu ‘s people make some assumptions that apt-get acquire does not exists? hummmm. anyway this site unixmen was very usefull for solutions. thank you!!!

  • Janko Hrasko

    double +1
    :D

  • tiffa

    i have done all what above and i still have the same problem

    root@iraq:~# sudo apt-get update
    Ign http://archive.ubuntu.com maverick Release.gpg
    Ign http://archive.ubuntu.com/ubuntu/ maverick/main Translation-en
    Ign http://archive.ubuntu.com/ubuntu/ maverick/main Translation-en_US
    Ign http://archive.ubuntu.com/ubuntu/ maverick/multiverse Translation-en
    Ign http://archive.ubuntu.com/ubuntu/ maverick/multiverse Translation-en_US
    Ign http://archive.ubuntu.com/ubuntu/ maverick/restricted Translation-en
    Ign http://archive.ubuntu.com/ubuntu/ maverick/restricted Translation-en_US
    Ign http://archive.ubuntu.com/ubuntu/ maverick/universe Translation-en
    Ign http://archive.ubuntu.com/ubuntu/ maverick/universe Translation-en_US
    Ign http://archive.ubuntu.com maverick Release
    Ign http://archive.ubuntu.com maverick/restricted Sources
    Ign http://archive.ubuntu.com maverick/multiverse Sources
    Ign http://archive.ubuntu.com maverick/multiverse i386 Packages
    Ign http://archive.ubuntu.com maverick/restricted i386 Packages
    Ign http://archive.ubuntu.com maverick/universe i386 Packages
    Ign http://archive.ubuntu.com maverick/main i386 Packages
    Ign http://archive.ubuntu.com maverick/restricted Sources
    Ign http://archive.ubuntu.com maverick/multiverse Sources
    Ign http://archive.ubuntu.com maverick/multiverse i386 Packages
    Ign http://archive.ubuntu.com maverick/restricted i386 Packages
    Ign http://archive.ubuntu.com maverick/universe i386 Packages
    Ign http://archive.ubuntu.com maverick/main i386 Packages
    Err http://archive.ubuntu.com maverick/restricted Sources
    407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )
    Err http://archive.ubuntu.com maverick/multiverse Sources
    407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )
    Err http://archive.ubuntu.com maverick/multiverse i386 Packages
    407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )
    Err http://archive.ubuntu.com maverick/restricted i386 Packages
    407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )
    Err http://archive.ubuntu.com maverick/universe i386 Packages
    407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )
    Err http://archive.ubuntu.com maverick/main i386 Packages
    407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/maverick/restricted/source/Sources.gz 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )

    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/maverick/multiverse/source/Sources.gz 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )

    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/maverick/multiverse/binary-i386/Packages.gz 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )

    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/maverick/restricted/binary-i386/Packages.gz 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )

    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/maverick/universe/binary-i386/Packages.gz 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )

    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/maverick/main/binary-i386/Packages.gz 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )

    E: Some index files failed to download, they have been ignored, or old ones used instead.

  • tiffa

    plzz help me.. :cry:

  • pirat9

    if doesnt work for you , try to add proxy via GUI . go
    System>administration>Synaptic package manager>Settings> preference>network
    and add the proxy manually.

    and add proxy to
    System>preferences? network proxy

    enjoy

    • ad

      to add proxy via GUI worked for me.

      THANk YOU

  • bassiks

    I had the same problem and found out, that the way with the apt.conf file in /etc/apt/ works. BUT you have to be careful:

    Acquire::http::Proxy "http://proxy.domain/:8080";

    The key is the / behind the proxy addr. So if your proxy has the addr "myproxy.mydomain.lan" then it has to look like:

    Acquire::http::Proxy "http://myproxy.mydomain.lan/:8080";

    Hope that works for you too,
    bassiks

    • Green

      Great bassiks your advice solved my issue…

      Thanks everyone…

  • test

    :P

  • http://tejapratapiitb.blogspot.com/2010/10/proxy-in-aptconf.html stp

    i think ur password contains @ .Replace it with %40 (0×40 = 64 ,the ascii code for ‘@’)

    I hope this solves ur problem

  • Tomjosif

    #proxy export http_proxy=http://user:password@host:port/export ftp_proxy=http://user:pass@host:disqus :port/
    Are you in your right sense ?
    There are unix experts everywhere, now days.
    Why # ? at the first place ?
    And why ftp_proxy is needed ?
    Go sleep well before you post.

    • http://www.etricks.net NoD

      #proxy
      export http_proxy=http://user:password@host:port/
      export ftp_proxy=http://user:password@host:port/

      I think that is what he wanted to write.In my opinion, it’s better to write HTTP_PROXY and FTP_PROXY with caps

    • MMS

      I mean seriously, i hate posts that derail and deride. if there are so many unix experts then there would never be any posts about any configuration. furthermore it is obvious the break in the line is represented by a switch, where your argument looks inconcise and n00bish.
      for a unix expert you may need some brushing up, and as for the original post/author – thank you

Like us on Facebook

This week Top Posts

Write for us

Recent Comments

HailsandNails

|

Actually, what I see too much of, and what Microsoft actually (sorta) did with Windows 8 is think forward. And let’s be brutally honest. Windows 8 is actually NOT as bad as people is making it out, they’re just freakishly afraid of change (which Linux users are as well, it seems)

SK

|

Yes i will. Keep visiting. Subscribe us to get daily updates. Thanks for the comment

Rakesh Vijayan

|

Hi SK

I am Rakesh vijayan thanks for your great work ,by your work I start to learn what is ldap , my request is will you make tutorial for ldap and samba pdc for us on ubuntu 12.04

Guest

|

It was a typo. Now its corrected. Thanks for pointing out.

Michael T

|

You shouldn’t be so stupid, in the first time.

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