apt-get fails -- connect (111: Connection refused)

Asked by Shashank VRSN Sabniveesu

All the output --

(Fresh installation -- no modifications to the default 'sources.list'.
apt-get was working till the morning when I installed some application)

Err http://security.ubuntu.com raring-security Release.gpg
  Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)
Err http://extras.ubuntu.com raring Release.gpg
  Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)
Err http://in.archive.ubuntu.com raring Release.gpg
  Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)
Err http://in.archive.ubuntu.com raring-updates Release.gpg
  Unable to connect to 172.16.8.1:8080:
Err http://in.archive.ubuntu.com raring-backports Release.gpg
  Unable to connect to 172.16.8.1:8080:
Reading package lists... Done
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/raring/Release.gpg Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/raring-updates/Release.gpg Unable to connect to 172.16.8.1:8080:

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/raring-backports/Release.gpg Unable to connect to 172.16.8.1:8080:

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/Release.gpg Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/raring/Release.gpg Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

W: Some index files failed to download. They have been ignored, or old ones used instead.
shashank@shashank-Lenovo-G560:~$ sudo apt-get update
Err http://in.archive.ubuntu.com raring Release.gpg
  Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)
Err http://security.ubuntu.com raring-security Release.gpg
  Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)
Err http://in.archive.ubuntu.com raring-updates Release.gpg
  Unable to connect to 172.16.8.1:8080:
Err http://in.archive.ubuntu.com raring-backports Release.gpg
  Unable to connect to 172.16.8.1:8080:
Err http://extras.ubuntu.com raring Release.gpg
  Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)
Reading package lists... Done
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/raring/Release.gpg Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/raring-updates/Release.gpg Unable to connect to 172.16.8.1:8080:

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/raring-backports/Release.gpg Unable to connect to 172.16.8.1:8080:

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/Release.gpg Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/raring/Release.gpg Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

W: Some index files failed to download. They have been ignored, or old ones used instead.
shashank@shashank-Lenovo-G560:~$ sudo apt-get update
Err http://in.archive.ubuntu.com raring Release.gpg
  Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)
Err http://extras.ubuntu.com raring Release.gpg
  Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)
Err http://in.archive.ubuntu.com raring-updates Release.gpg
  Unable to connect to 172.16.8.1:8080:
Err http://in.archive.ubuntu.com raring-backports Release.gpg
  Unable to connect to 172.16.8.1:8080:
Err http://security.ubuntu.com raring-security Release.gpg
  Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)
Reading package lists... Done
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/raring/Release.gpg Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/raring-updates/Release.gpg Unable to connect to 172.16.8.1:8080:

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/raring-backports/Release.gpg Unable to connect to 172.16.8.1:8080:

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/Release.gpg Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/raring/Release.gpg Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

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

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Hamish McIntyre-Bhatty (hamishmb) said :
#1

Okay, what is the output of :

lsb_release -a

Can you remember what package you installed?

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#2

Please send us the full Terminal output from step 5 from this procedure:

https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#3

Please post the full Terminal output here:

https://answers.launchpad.net/ubuntu/+question/227835

Revision history for this message
Shashank VRSN Sabniveesu (fossterer) said :
#4

$lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 13.04
Release: 13.04
Codename: raring

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#5

Please send us the output from post #2.

Revision history for this message
Shashank VRSN Sabniveesu (fossterer) said :
#6

Full output :: (As 'typescript' file)

Script started on Tuesday 30 April 2013 01:57:15 PM IST
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ sudo grep -R proxy /etc/apt/*
[sudo] password for shashank:
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ grep proxy /etc/environment
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ echo $http_proxy

]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ echo $ftp_proxy

]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ grep proxy /etc/bash.bashrc
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ cat /etc/apt/apt.conf
Acquire::http::Proxy "http://172.16.8.1:8080/";
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ sudo fuser -vvv /var/lib/dpkg/lock
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.04
DISTRIB_CODENAME=raring
DISTRIB_DESCRIPTION="Ubuntu 13.04"
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ uname -a
Linux shashank-Lenovo-G560 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:19:42 UTC 2013 i686 i686 i686 GNU/Linux
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ sudo rm /var/lib/apt/lists/lock
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ sudo rm /var/lib/dpkg/lock
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ sudo cp -arf /var/lib/dpkg /var/lib/dpk
g.backup
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ sudo mv /var/lib/dpkg/status /var/lib/d
pkg/status-bad
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ sudo cp /var/lib/dpkg/status-old /var/l
ib/dpkg/status || sudo cp /var/backups/apt.extended_states.0 /var/lib/
dpkg/status
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ sudo mv /var/lib/dpkg/available /var/li
b/dpkg/available-bad
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ sudo cp /var/lib/dpkg/available-old /va
r/lib/dpkg/available
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ sudo rm -rf /var/lib/dpkg/updates/*
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ sudo rm -rf /var/lib/apt/lists
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ sudo rm /var/cache/apt/*.bin
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ sudo mkdir /var/lib/apt/lists
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ sudo mkdir /var/lib/apt/lists/partial
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ LANG=C;sudo apt-get clean
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ LANG=C;sudo apt-get autoclean

Reading package lists... 0%

Reading package lists... 0%

Reading package lists... 6%

Reading package lists... Done

Building dependency tree... 0%

Building dependency tree... 0%

Building dependency tree... 50%

Building dependency tree... 50%

Building dependency tree

Reading state information... 0%

Reading state information... 4%

Reading state information... Done

]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ LANG=C;sudo apt-get --purge autoremove

Reading package lists... 0%

Reading package lists... 100%

Reading package lists... Done

Building dependency tree... 0%

Building dependency tree... 0%

Building dependency tree... 50%

Building dependency tree... 50%

Building dependency tree

Reading state information... 0%

Reading state information... 4%

Reading state information... Done

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ LANG=C;sudo apt-get --fix-missing updat
e -o APT::Cache-Limit=100000000

0% [Working]

Err http://in.archive.ubuntu.com raring Release.gpg
  Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

0% [Connecting to 172.16.8.1 (172.16.8.1)] [Connecting to 172.16.8.1 (1

Err http://in.archive.ubuntu.com raring-updates Release.gpg
  Unable to connect to 172.16.8.1:8080:

Err http://in.archive.ubuntu.com raring-backports Release.gpg
  Unable to connect to 172.16.8.1:8080:

Err http://security.ubuntu.com raring-security Release.gpg
  Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

Err http://extras.ubuntu.com raring Release.gpg
  Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

0% [Working]

Reading package lists... 0%

Reading package lists... 0%

Reading package lists... 6%

Reading package lists... Done

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/raring/Release.gpg Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/raring-updates/Release.gpg Unable to connect to 172.16.8.1:8080:

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/raring-backports/Release.gpg Unable to connect to 172.16.8.1:8080:

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/Release.gpg Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/raring/Release.gpg Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

W: Some index files failed to download. They have been ignored, or old ones used instead.
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ sudo dpkg --configure -a
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ sudo dpkg --clear-avail
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ LANG=C;sudo apt-get -f install

Reading package lists... 0%

Reading package lists... 0%

Reading package lists... 6%

Reading package lists... Done

Building dependency tree... 0%

Building dependency tree... 0%

Building dependency tree... 50%

Building dependency tree... 50%

Building dependency tree

Reading state information... 0%

Reading state information... 4%

Reading state information... Done

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ LANG=C;sudo apt-get --fix-missing insta
ll

Reading package lists... 0%

Reading package lists... 100%

Reading package lists... Done

Building dependency tree... 0%

Building dependency tree... 0%

Building dependency tree... 50%

Building dependency tree... 50%

Building dependency tree

Reading state information... 0%

Reading state information... 4%

Reading state information... Done

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ LANG=C;sudo apt-get update -o APT::Cach
e-Limit=100000000 && sudo apt-get dist-upgrade

0% [Working]

Err http://security.ubuntu.com raring-security Release.gpg
  Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

0% [Connecting to 172.16.8.1 (172.16.8.1)] [Connecting to 172.16.8.1 (1

Err http://in.archive.ubuntu.com raring Release.gpg
  Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

Err http://extras.ubuntu.com raring Release.gpg
  Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

0% [Working]

Err http://in.archive.ubuntu.com raring-updates Release.gpg
  Unable to connect to 172.16.8.1:8080:

Err http://in.archive.ubuntu.com raring-backports Release.gpg
  Unable to connect to 172.16.8.1:8080:

0% [Working]

Reading package lists... 0%

Reading package lists... 0%

Reading package lists... 6%

Reading package lists... Done

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/raring/Release.gpg Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/raring-updates/Release.gpg Unable to connect to 172.16.8.1:8080:

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/raring-backports/Release.gpg Unable to connect to 172.16.8.1:8080:

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/Release.gpg Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/raring/Release.gpg Could not connect to 172.16.8.1:8080 (172.16.8.1). - connect (111: Connection refused)

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

Reading package lists... 0%

Reading package lists... 100%

Reading package lists... Done

Building dependency tree... 0%

Building dependency tree... 0%

Building dependency tree... 50%

Building dependency tree... 50%

Building dependency tree

Reading state information... 0%

Reading state information... 4%

Reading state information... Done

Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ find /etc/apt -name '*.list' -exec bash
 -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;

/etc/apt/sources.list

     1 #deb cdrom:[Ubuntu 13.04 _Raring Ringtail_ - Release i386 (20130424)]/ raring main restricted
     2
     3 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
     4 # newer versions of the distribution.
     5 deb http://in.archive.ubuntu.com/ubuntu/ raring main restricted
     6 deb-src http://in.archive.ubuntu.com/ubuntu/ raring main restricted
     7
     8 ## Major bug fix updates produced after the final release of the
     9 ## distribution.
    10 deb http://in.archive.ubuntu.com/ubuntu/ raring-updates main restricted
    11 deb-src http://in.archive.ubuntu.com/ubuntu/ raring-updates main restricted
    12
    13 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    14 ## team. Also, please note that software in universe WILL NOT receive any
    15 ## review or updates from the Ubuntu security team.
    16 deb http://in.archive.ubuntu.com/ubuntu/ raring universe
    17 deb-src http://in.archive.ubuntu.com/ubuntu/ raring universe
    18 deb http://in.archive.ubuntu.com/ubuntu/ raring-updates universe
    19 deb-src http://in.archive.ubuntu.com/ubuntu/ raring-updates universe
    20
    21 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    22 ## team, and may not be under a free licence. Please satisfy yourself as to
    23 ## your rights to use the software. Also, please note that software in
    24 ## multiverse WILL NOT receive any review or updates from the Ubuntu
    25 ## security team.
    26 deb http://in.archive.ubuntu.com/ubuntu/ raring multiverse
    27 deb-src http://in.archive.ubuntu.com/ubuntu/ raring multiverse
    28 deb http://in.archive.ubuntu.com/ubuntu/ raring-updates multiverse
    29 deb-src http://in.archive.ubuntu.com/ubuntu/ raring-updates multiverse
    30
    31 ## N.B. software from this repository may not have been tested as
    32 ## extensively as that contained in the main release, although it includes
    33 ## newer versions of some applications which may provide useful features.
    34 ## Also, please note that software in backports WILL NOT receive any review
    35 ## or updates from the Ubuntu security team.
    36 deb http://in.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse
    37 deb-src http://in.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse
    38
    39 deb http://security.ubuntu.com/ubuntu raring-security main restricted
    40 deb-src http://security.ubuntu.com/ubuntu raring-security main restricted
    41 deb http://security.ubuntu.com/ubuntu raring-security universe
    42 deb-src http://security.ubuntu.com/ubuntu raring-security universe
    43 deb http://security.ubuntu.com/ubuntu raring-security multiverse
    44 deb-src http://security.ubuntu.com/ubuntu raring-security multiverse
    45
    46 ## Uncomment the following two lines to add software from Canonical's
    47 ## 'partner' repository.
    48 ## This software is not part of Ubuntu, but is offered by Canonical and the
    49 ## respective vendors as a service to Ubuntu users.
    50 # deb http://archive.canonical.com/ubuntu raring partner
    51 # deb-src http://archive.canonical.com/ubuntu raring partner
    52
    53 ## This software is not part of Ubuntu, but is offered by third-party
    54 ## developers who want to ship their latest software.
    55 deb http://extras.ubuntu.com/ubuntu raring main
    56 deb-src http://extras.ubuntu.com/ubuntu raring main
]0;shashank@shashank-Lenovo-G560: ~shashank@shashank-Lenovo-G560:~$ exit
exit

Script done on Tuesday 30 April 2013 02:03:53 PM IST

Revision history for this message
Manfred Hampl (m-hampl) said :
#7

Do you need a proxy definition to access the internet?
Your configuration shows:

cat /etc/apt/apt.conf
Acquire::http::Proxy "http://172.16.8.1:8080/";

If you check the network configuration in your web browser - do you have the same proxy entry there?
One potential problem is that in case you need username and password for usign the proxy, you have to put these values into he configuration files (there is no option for asking these values form the therminal in the moment when needed).

Revision history for this message
Shashank VRSN Sabniveesu (fossterer) said :
#8

I don't remember placing any such "Proxy Definition' explicitly !

Do I need to remove it?

Firefox Configuration says 'Use System Proxy Settings'

Yes, ISP requires me to provide username and password when I open browser for the first time, but this apt-get problem never appeared earlier (for the last 6 months)

Revision history for this message
Manfred Hampl (m-hampl) said :
#9

You could try without the proxy definition in apt.conf

open a terminal and issue these commands:

sudo mv /etc/apt/apt.conf /etc/apt/apt.conf.bck
sudo apt-get update

copy/paste all output into theis question document as done before.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#10

WHat is the output of:

egrep -i 'http|ftp' ~/.bashrc
egrep -i 'http|ftp' /etc/environment
cat /etc/apt/apt.conf

Thanks

Revision history for this message
Launchpad Janitor (janitor) said :
#11

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.

Revision history for this message
Shashank VRSN Sabniveesu (fossterer) said :
#12

I'm sorry !

I solved the problem with the hint from Comment #7.

I apologize for my delayed response.