+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 25
*nix Thread, apt-get proxy in Technical; Hi there Trying to do 'apt-get update', and ive added the http proxy line into apt.conf, but i get the ...
  1. #1
    Samson's Avatar
    Join Date
    Mar 2007
    Location
    Wales
    Posts
    201
    Thank Post
    7
    Thanked 1 Time in 1 Post
    Rep Power
    17

    apt-get proxy

    Hi there

    Trying to do 'apt-get update', and ive added the http proxy line into apt.conf, but i get the following error:

    Code:
    Cannot initiate the connection to 131.142.172.46:80 (131.142.172.46). - connect (101 Network is unreachable)
    The proxy is EXACTLY the same proxy i'd use for internet explorer or firefox on a windows machine, so I cannot for the life of my figure out whats up.

    For Information
    Route Table:

    Code:
    root@dhmail:~# route
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    172.21.56.0     *               255.255.254.0   U     0      0        0 eth0
    IPTables -L

    Code:
    root@dhmail:~# iptables -L
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination
    
    Chain FORWARD (policy ACCEPT)
    target     prot opt source               destination
    
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination
    Resolv.conf
    Code:
    root@dhmail:~# more /etc/resolv.conf
    nameserver 172.21.56.10
    When I try to ping the proxy:
    Code:
    root@dhmail:~# ping 131.142.172.46
    connect: Network is unreachable

  2. #2

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: apt-get proxy

    You have no default gateway set. Is this machine using DHCP or is it setup statically?

  3. #3

    Join Date
    Mar 2007
    Location
    St. Albans, Hertfordshire
    Posts
    22
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: apt-get proxy

    I am having the same problem.
    My IP is static with the correct gateway set. The proxy works fine in firefox, but not for APT-GET. I have even assigned the proxy to the bash shell instead of just APT-GET and it still fails

  4. #4

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: apt-get proxy

    You can set the proxy specifically for Apt-Get. Did you try that?

  5. #5
    linuxgirlie's Avatar
    Join Date
    Jul 2005
    Location
    Kent
    Posts
    340
    Thank Post
    106
    Thanked 33 Times in 18 Posts
    Rep Power
    31

    Re: apt-get proxy

    Has anyone actually got this to work? I tried at work and could never get it to use a proxy via the command line or synaptic(on pclinuxos 0.93).

    So we set up our own repository on one of the servers which checks weekly for updates and package changes.

    Jo

  6. #6

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,592
    Thank Post
    109
    Thanked 769 Times in 598 Posts
    Rep Power
    181

    Re: apt-get proxy

    I usually just export the http_proxy and ftp_proxy variables and it works fine.

  7. #7

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: apt-get proxy

    Well, there's three places I set the proxy on a new Linux install.

    1) in /etc/profile:

    Code:
    export http_proxy="http://user:pass@xxx.xxx.xxx.xxx:port/"
    export ftp_proxy="http://user:pass@xxx.xxx.xxx.xxx:port/"
    2) in /etc/apt/apt.conf

    Code:
    Acquire::http::Proxy "http://user:pass@xxx.xxx.xxx.xxx:port/";
    Acquire::ftp::Proxy "http://user:pass@xxx.xxx.xxx.xxx:port/";
    3) in /etc/wgetrc


  8. Thanks to Geoff from:

    CHR1S (12th May 2010)

  9. #8

    Join Date
    Mar 2007
    Location
    St. Albans, Hertfordshire
    Posts
    22
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: apt-get proxy

    I had been using it in just apt-get... and for a while it worked fine. However, in the last 3 weeks through the Grid Proxy it just simply hasnt worked.

  10. #9

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: apt-get proxy

    Well then your proxy is probably broken in some subtle way.

  11. #10
    t20racerman's Avatar
    Join Date
    Feb 2008
    Posts
    18
    Thank Post
    1
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by Ric_ View Post
    I usually just export the http_proxy and ftp_proxy variables and it works fine.
    Hi there
    I've tried everything to get synaptic to update through our proxy and nothing works. Can't get it to work with apt-get either

    Could you be more specific what you mean in the above quote please...

    I've been running a thread about this process on the PCLinuxOS forum (my distro)
    http://www.pclinuxos.com/index.php?o...&topic=41285.0 without any success yet and was advised to ask for help here...



    Anyone!

  12. #11

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224
    Does your proxy also filter?

  13. #12

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,592
    Thank Post
    109
    Thanked 769 Times in 598 Posts
    Rep Power
    181
    Quote Originally Posted by t20racerman View Post
    Could you be more specific what you mean in the above quote please...
    As Geoff said previously, in a terminal, type
    Code:
    export http_proxy=http://MyProxyServer:8080
    This assumes that DNS is set up correctly, your proxy is called MyProxyServer and the proxy port is 8080. This also assumes you are using a HTTP source for apt (otherwise replace http_proxy with ftp_proxy).

    Remove the proxy line in apt.conf and then type
    Code:
    aptitude update
    This will update the apt cache. Following this you should by able to install whatever you want.

    To make the settings stick, edit the files as Geoff suggests above.

  14. #13
    wesleyw's Avatar
    Join Date
    Dec 2005
    Location
    Kingswinford
    Posts
    2,208
    Thank Post
    225
    Thanked 50 Times in 44 Posts
    Blog Entries
    1
    Rep Power
    30
    export http_proxy=http://MyProxyServer:8080 doesn't always work I've had the same trouble with our proxy in the past try this at the command line:

    env http_proxy="http://<your proxy>:<proxy port>" apt-get install <your package>

    Let me know if this solves the problem?


    Wes

  15. #14
    t20racerman's Avatar
    Join Date
    Feb 2008
    Posts
    18
    Thank Post
    1
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by wesleyw View Post
    export http_proxy=http://MyProxyServer:8080 doesn't always work I've had the same trouble with our proxy in the past try this at the command line:

    env http_proxy="http://<your proxy>:<proxy port>" apt-get install <your package>

    Let me know if this solves the problem?

    Wes
    Ok here goes:

    [root@mylaptop pclinux]# env http_proxy="http://192.168.0.252:8080" apt-get update
    0% [Working]terminate called after throwing an instance of 'std::out_of_range'
    what(): basic_string::substr
    E: Method http has died unexpectedly!
    W: Release files for some repositories could not be retrieved or authenticated. Such repositories are being ignored.
    E: Tried to dequeue a fetching object
    E: Tried to dequeue a fetching object
    E: Tried to dequeue a fetching object
    E: Tried to dequeue a fetching object
    E: Tried to dequeue a fetching object
    E: Tried to dequeue a fetching object
    E: Tried to dequeue a fetching object
    E: Tried to dequeue a fetching object
    E: Tried to dequeue a fetching object
    That didn't work, so i tried it with user name and password added:
    [root@mylaptop pclinux]# env http_proxy="http://user:password@192.168.0.252:8080" apt-get update
    Ign http://mirrors.lastdot.org pclinuxos/2007 release
    Err http://mirrors.lastdot.org pclinuxos/2007/main pkglist
    502 Proxy Error ( The ISA Server denies the specified Uniform Resource Locator (URL). )
    Ign http://mirrors.lastdot.org pclinuxos/2007/main release
    Err http://mirrors.lastdot.org pclinuxos/2007/extra pkglist
    Error reading from server - read (104 Connection reset by peer)
    Ign http://mirrors.lastdot.org pclinuxos/2007/extra release
    Err http://mirrors.lastdot.org pclinuxos/2007/nonfree pkglist
    Error reading from server - read (104 Connection reset by peer)
    Ign http://mirrors.lastdot.org pclinuxos/2007/nonfree release
    Err http://mirrors.lastdot.org pclinuxos/2007/kde pkglist
    502 Proxy Error ( The ISA Server denies the specified Uniform Resource Locator (URL). )
    Ign http://mirrors.lastdot.org pclinuxos/2007/kde release
    Failed to fetch http://mirrors.lastdot.org:1280/pclo...e/pkglist.main 502 Proxy Error ( The ISA Server denies the specified Uniform Resource Locator (URL). )
    Failed to fetch http://mirrors.lastdot.org:1280/pclo.../pkglist.extra Error reading from server - read (104 Connection reset by peer)
    Failed to fetch http://mirrors.lastdot.org:1280/pclo...kglist.nonfree Error reading from server - read (104 Connection reset by peer)
    Failed to fetch http://mirrors.lastdot.org:1280/pclo...se/pkglist.kde 502 Proxy Error ( The ISA Server denies the specified Uniform Resource Locator (URL). )
    Reading Package Lists... Done
    Building Dependency Tree... Done
    E: Some index files failed to download, they have been ignored, or old ones used instead.
    [root@mylaptop pclinux]#
    As you can see - no luck!
    Last edited by t20racerman; 26th February 2008 at 02:29 PM.

  16. #15
    t20racerman's Avatar
    Join Date
    Feb 2008
    Posts
    18
    Thank Post
    1
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by Ric_ View Post
    Remove the proxy line in apt.conf and then type
    Code:
    aptitude update

    err... I don't have a Proxy line in apt.conf It just has:
    APT::Get::Show-Upgraded "true";
    APT::Get::Reinstall "true";
    Also, where are you saying to type aptitude update - in a terminal I presume?

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. how to set proxy for explorer.exe
    By randomconept in forum General Chat
    Replies: 8
    Last Post: 22nd October 2007, 11:23 AM
  2. Proxy switch "proxy on" & " proxy off" software
    By GavRob in forum Network and Classroom Management
    Replies: 20
    Last Post: 30th July 2007, 10:05 PM
  3. FTP proxy
    By NetworkGeezer in forum Wireless Networks
    Replies: 1
    Last Post: 2nd February 2007, 08:59 PM
  4. proxy nightmare
    By alonebfg in forum Wireless Networks
    Replies: 15
    Last Post: 20th November 2006, 05:48 PM
  5. Proxy
    By Norphy in forum How do you do....it?
    Replies: 22
    Last Post: 18th September 2006, 10:56 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •