Results 1 to 9 of 9

Thread: [SOLVED] "Failed to fetch" in update and synaptic

  1. #1
    Join Date
    Feb 2007
    Location
    Colorado
    Beans
    372
    Distro
    Ubuntu 12.04 Precise Pangolin

    [SOLVED] "Failed to fetch" in update and synaptic

    When trying to update or install via synaptic, it fails to fetch and
    the reason is:

    Could not connect to localhost:4001 (127.0.0.1). - connect (111 Connection refused)


    What's my problem?

    Solution:
    Code:
    sudo grep -r 4001 /etc
    This showed that anon-proxy was using port 4001. So
    remove anon-proxy

    Code:
    sudo apt-get --purge remove anon-proxy
    The mystery for me is how anon-proxy got installed. I never
    heard of it and did not intentionally install it. Was it
    part of an automatic upgrade? Part of a Firefox add-on?
    I don';t know, But removing anon-proxy did the trick.
    Last edited by Michl; September 11th, 2008 at 05:31 PM.

  2. #2
    Join Date
    Mar 2006
    Location
    United Kingdom
    Beans
    1,183
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: "Failed to fetch" in update and synaptic

    127.0.0.1 is the loopback device. Looks like you do not have a network connection.
    Bob
    _____________________________________________
    I used to be very indecisive, but now I am not so sure.

  3. #3
    Join Date
    May 2007
    Location
    The New Forest
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: "Failed to fetch" in update and synaptic

    Quick question have you installed anonproxy?

  4. #4
    Join Date
    Dec 2004
    Location
    Atlanta, GA USA
    Beans
    7,257
    Distro
    Ubuntu Development Release

    Re: "Failed to fetch" in update and synaptic

    i would just reset (unplug) your modem/router, and reboot the computer. these things happen once in a while.

  5. #5
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: "Failed to fetch" in update and synaptic

    Do you know if you use a proxy?

    If you dont' know what I'm talking about, just run this command:
    Code:
    echo $http_proxy
    If you get output, run this:
    Code:
    unset http_proxy
    or if you prefer, check System, Preferences, Network Proxy, Proxy Configuration and try Direct Internet Connection .
    Back to Xorg...

    Retired.

  6. #6
    Join Date
    Apr 2007
    Beans
    284
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: "Failed to fetch" in update and synaptic

    I haven't updated in 70 days. Third party apps update fine. I am told to check my network. I have a lan cable running from the wireless router.

    Edit: I didn't see you post drs305. Mine is already set to Direct internet connection.
    Last edited by tadcan; September 9th, 2008 at 09:39 PM. Reason: update
    MS skill level -- I press buttons and stuff happens
    Linux skill level -- I copy and paste into the terminal and stuff happens!
    Mac skill level -- Wear a black turtleneck and stuff happens

  7. #7
    Join Date
    Feb 2007
    Location
    Colorado
    Beans
    372
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: "Failed to fetch" in update and synaptic

    This is at work and I do have a network connection.
    I am connected right now. But I still get this
    strange note that it cannot connect to the local
    host.


    Also, I am set to direct internet connection.

    Just wondering if this is related. I am connected
    to the wired network here at work, but I am not
    logged on to a protected wired network. Could that
    be the issue?
    Last edited by Michl; September 9th, 2008 at 09:50 PM.

  8. #8
    Join Date
    Feb 2007
    Location
    Colorado
    Beans
    372
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: "Failed to fetch" in update and synaptic

    I need help ... I cannot update ubuntu. I do not use a
    proxy, I am connected to the internet, etc, but fail to
    fetch files. As before the message is:

    W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/...080805_all.deb
    Could not connect to localhost:4001 (127.0.0.1). - connect (111 Connection refused)


    HELP!

  9. #9
    Join Date
    Apr 2006
    Beans
    Hidden!

    Re: [SOLVED] "Failed to fetch" in update and synaptic

    Hello,

    I had a similar problem, after removing anon-proxy. The same error message. anon-proxy is the cause.
    Fix:
    Comment out the [appropriate] two lines in /etc/environment
    (By inserting a # at the beginning of each line.)

    You can do so using

    sudo gedit /etc/environment

    Original (after anon-proxy):
    [...]
    # +ANON_MARK+ Don't change this while anon-proxy manages this variable.
    # +ANON_MARK+ To take back control of it run dpkg-reconfigure and tell
    # +ANON_MARK+ debconf not to set this variable for you.
    HTTP_PROXY=http://localhost:4001 # +ANON_MARK+
    http_proxy=http://localhost:4001 # +ANON_MARK+

    Fixed:
    [...]
    # +ANON_MARK+ Don't change this while anon-proxy manages this variable.
    # +ANON_MARK+ To take back control of it run dpkg-reconfigure and tell
    # +ANON_MARK+ debconf not to set this variable for you.
    #HTTP_PROXY=http://localhost:4001 # +ANON_MARK+
    #http_proxy=http://localhost:4001 # +ANON_MARK+


    Then log out, and in again.


    The problem is that anon-proxy assumes it will always be running. There is no problem when it is running, or running in no-proxy mode, it simply passes synaptic/apt-get's traffic from port 4001 to the internet.
    However when anon-proxy isn't running, apt-get still connects on port 4001, where anon-proxy should be listening. So apt fails to reach the internet. A cleaner removal would prevent this residual configuration.

    Good luck

Bookmarks

Posting Permissions

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