unable to connect error using apt-get

Asked by IlPrincipe on 2017-02-08

entschuldigung@ilprincipe-X125:~$ ubuntu-support-status
Support status summary of 'ilprincipe-X125':

You have 1943 packages (53.0%) supported until November 2017 (9m)

You have 74 packages (2.0%) that can not/no longer be downloaded
You have 1650 packages (45.0%) that are unsupported

Run with --show-unsupported, --show-supported or --show-all to see more details
entschuldigung@ilprincipe-X125:~$ cat /etc/dpkg/dpkg.cfg.d/multiarch
cat: /etc/dpkg/dpkg.cfg.d/multiarch: No such file or directory
entschuldigung@ilprincipe-X125:~$ dpkg --print-foreign-architectures
entschuldigung@ilprincipe-X125:~$ sudo grep -R proxy /etc/apt/*
entschuldigung@ilprincipe-X125:~$ grep proxy /etc/environment
entschuldigung@ilprincipe-X125:~$ echo $http_proxy

entschuldigung@ilprincipe-X125:~$ echo $ftp_proxy

entschuldigung@ilprincipe-X125:~$ grep proxy /etc/bash.bashrc
entschuldigung@ilprincipe-X125:~$
entschuldigung@ilprincipe-X125:~$ grep proxy ~/.bashrc
entschuldigung@ilprincipe-X125:~$ cat /etc/apt/apt.conf
cat: /etc/apt/apt.conf: No such file or directory
entschuldigung@ilprincipe-X125:~$ sudo fuser -vvv /var/lib/dpkg/lock
entschuldigung@ilprincipe-X125:~$ sudo fuser -vvv /var/cache/apt/archives/lock
entschuldigung@ilprincipe-X125:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=17.04
DISTRIB_CODENAME=zesty
DISTRIB_DESCRIPTION="Ubuntu Zesty Zapus (development branch)"
entschuldigung@ilprincipe-X125:~$ uname -a
Linux ilprincipe-X125 4.9.0-15-lowlatency #16-Ubuntu SMP PREEMPT Mon Jan 23 14:09:41 UTC 2017 i686 athlon i686 GNU/Linux
entschuldigung@ilprincipe-X125:~$ sudo rm /var/lib/apt/lists/lock
entschuldigung@ilprincipe-X125:~$ sudo rm /var/cache/apt/archives/loc
rm: cannot remove '/var/cache/apt/archives/loc': No such file or directory
entschuldigung@ilprincipe-X125:~$ sudo rm /var/cache/apt/archives/lock
entschuldigung@ilprincipe-X125:~$ sudo rm /var/lib/dpkg/lock
entschuldigung@ilprincipe-X125:~$ sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
entschuldigung@ilprincipe-X125:~$ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
entschuldigung@ilprincipe-X125:~$ sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status || sudo cp /var/backups/apt.extended_states.0 /var/lib/dpkg/status
entschuldigung@ilprincipe-X125:~$ sudo mv /var/lib/dpkg/available /var/lib/dpkg/available-bad
entschuldigung@ilprincipe-X125:~$ sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
cp: cannot stat '/var/lib/dpkg/available-old': No such file or directory
entschuldigung@ilprincipe-X125:~$ sudo rm -rf /var/lib/dpkg/updates/*
entschuldigung@ilprincipe-X125:~$ sudo rm -rf /var/lib/apt/lists
entschuldigung@ilprincipe-X125:~$ sudo rm /var/cache/apt/*.bin
entschuldigung@ilprincipe-X125:~$ sudo mkdir /var/lib/apt/lists
entschuldigung@ilprincipe-X125:~$ sudo mkdir /var/lib/apt/lists/partial
entschuldigung@ilprincipe-X125:~$ LANG=C;sudo apt-get clean
entschuldigung@ilprincipe-X125:~$
entschuldigung@ilprincipe-X125:~$ LANG=C;sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
entschuldigung@ilprincipe-X125:~$ sudo dpkg --configure -a
entschuldigung@ilprincipe-X125:~$ sudo dpkg --clear-avail
entschuldigung@ilprincipe-X125:~$
entschuldigung@ilprincipe-X125:~$ LANG=C;sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
entschuldigung@ilprincipe-X125:~$ LANG=C;sudo apt-get --fix-missing install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
entschuldigung@ilprincipe-X125:~$ LANG=C;sudo apt-get --purge autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
entschuldigung@ilprincipe-X125:~$ LANG=C;sudo apt-get --fix-missing update -o APT::Cache-Limit=100000000
Err:1 http://archive.ubuntu.com/ubuntu zesty InRelease
  Could not connect to 127.0.0.1:3142 (127.0.0.1). - connect (111: Connection refused)
Err:2 http://archive.ubuntu.com/ubuntu zesty-updates InRelease
  Unable to connect to 127.0.0.1:3142:
Err:3 http://archive.ubuntu.com/ubuntu zesty-backports InRelease
  Unable to connect to 127.0.0.1:3142:
Err:4 http://security.ubuntu.com/ubuntu zesty-security InRelease
  Could not connect to 127.0.0.1:3142 (127.0.0.1). - connect (111: Connection refused)
Err:5 http://ppa.launchpad.net/libreoffice/ppa/ubuntu zesty InRelease
  Could not connect to 127.0.0.1:3142 (127.0.0.1). - connect (111: Connection refused)
Err:6 http://ppa.launchpad.net/nathan-renniewaldock/flux/ubuntu zesty InRelease
  Unable to connect to 127.0.0.1:3142:
Err:7 http://ppa.launchpad.net/openshot.developers/ppa/ubuntu zesty InRelease
  Unable to connect to 127.0.0.1:3142:
Err:8 http://ppa.launchpad.net/otto-kesselgulasch/gimp-edge/ubuntu zesty InRelease
  Unable to connect to 127.0.0.1:3142:
Err:9 http://ppa.launchpad.net/webupd8team/java/ubuntu zesty InRelease
  Unable to connect to 127.0.0.1:3142:
Err:10 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu zesty InRelease
  Unable to connect to 127.0.0.1:3142:
Err:11 http://archive.canonical.com/ubuntu zesty InRelease
  Could not connect to 127.0.0.1:3142 (127.0.0.1). - connect (111: Connection refused)
Reading package lists... Done
W: Failed to fetch http://archive.canonical.com/ubuntu/dists/zesty/InRelease Could not connect to 127.0.0.1:3142 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/zesty/InRelease Could not connect to 127.0.0.1:3142 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/zesty-security/InRelease Could not connect to 127.0.0.1:3142 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/zesty-updates/InRelease Unable to connect to 127.0.0.1:3142:
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/zesty-backports/InRelease Unable to connect to 127.0.0.1:3142:
W: Failed to fetch http://ppa.launchpad.net/libreoffice/ppa/ubuntu/dists/zesty/InRelease Could not connect to 127.0.0.1:3142 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http://ppa.launchpad.net/nathan-renniewaldock/flux/ubuntu/dists/zesty/InRelease Unable to connect to 127.0.0.1:3142:
W: Failed to fetch http://ppa.launchpad.net/openshot.developers/ppa/ubuntu/dists/zesty/InRelease Unable to connect to 127.0.0.1:3142:
W: Failed to fetch http://ppa.launchpad.net/otto-kesselgulasch/gimp-edge/ubuntu/dists/zesty/InRelease Unable to connect to 127.0.0.1:3142:
W: Failed to fetch http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/zesty/InRelease Unable to connect to 127.0.0.1:3142:
W: Failed to fetch http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu/dists/zesty/InRelease Unable to connect to 127.0.0.1:3142:
W: Some index files failed to download. They have been ignored, or old ones used instead.
entschuldigung@ilprincipe-X125:~$ LANG=C;sudo apt-get update -o APT::Cache-Limit=100000000 && sudo apt-get dist-upgrade
Err:1 http://archive.ubuntu.com/ubuntu zesty InRelease
  Could not connect to 127.0.0.1:3142 (127.0.0.1). - connect (111: Connection refused)
Err:2 http://archive.ubuntu.com/ubuntu zesty-updates InRelease
  Unable to connect to 127.0.0.1:3142:
Err:3 http://archive.ubuntu.com/ubuntu zesty-backports InRelease
  Unable to connect to 127.0.0.1:3142:
Err:4 http://security.ubuntu.com/ubuntu zesty-security InRelease
  Could not connect to 127.0.0.1:3142 (127.0.0.1). - connect (111: Connection refused)
Err:5 http://ppa.launchpad.net/libreoffice/ppa/ubuntu zesty InRelease
  Could not connect to 127.0.0.1:3142 (127.0.0.1). - connect (111: Connection refused)
Err:6 http://ppa.launchpad.net/nathan-renniewaldock/flux/ubuntu zesty InRelease
  Unable to connect to 127.0.0.1:3142:
Err:7 http://ppa.launchpad.net/openshot.developers/ppa/ubuntu zesty InRelease
  Unable to connect to 127.0.0.1:3142:
Err:8 http://ppa.launchpad.net/otto-kesselgulasch/gimp-edge/ubuntu zesty InRelease
  Unable to connect to 127.0.0.1:3142:
Err:9 http://ppa.launchpad.net/webupd8team/java/ubuntu zesty InRelease
  Unable to connect to 127.0.0.1:3142:
Err:10 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu zesty InRelease
  Unable to connect to 127.0.0.1:3142:
Err:11 http://archive.canonical.com/ubuntu zesty InRelease
  Could not connect to 127.0.0.1:3142 (127.0.0.1). - connect (111: Connection refused)
Reading package lists... Done
W: Failed to fetch http://archive.canonical.com/ubuntu/dists/zesty/InRelease Could not connect to 127.0.0.1:3142 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/zesty/InRelease Could not connect to 127.0.0.1:3142 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/zesty-security/InRelease Could not connect to 127.0.0.1:3142 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/zesty-updates/InRelease Unable to connect to 127.0.0.1:3142:
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/zesty-backports/InRelease Unable to connect to 127.0.0.1:3142:
W: Failed to fetch http://ppa.launchpad.net/libreoffice/ppa/ubuntu/dists/zesty/InRelease Could not connect to 127.0.0.1:3142 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http://ppa.launchpad.net/nathan-renniewaldock/flux/ubuntu/dists/zesty/InRelease Unable to connect to 127.0.0.1:3142:
W: Failed to fetch http://ppa.launchpad.net/openshot.developers/ppa/ubuntu/dists/zesty/InRelease Unable to connect to 127.0.0.1:3142:
W: Failed to fetch http://ppa.launchpad.net/otto-kesselgulasch/gimp-edge/ubuntu/dists/zesty/InRelease Unable to connect to 127.0.0.1:3142:
W: Failed to fetch http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/zesty/InRelease Unable to connect to 127.0.0.1:3142:
W: Failed to fetch http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu/dists/zesty/InRelease Unable to connect to 127.0.0.1:3142:
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
entschuldigung@ilprincipe-X125:~$ find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;

/etc/apt/sources.list.d/n-muench-ubuntu-burg-zesty.list

/etc/apt/sources.list.d/disper-dev-ubuntu-ppa-zesty.list

/etc/apt/sources.list.d/yannubuntu-ubuntu-boot-repair-zesty.list

     1 deb http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu zesty main
     2 # deb-src http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu zesty main

/etc/apt/sources.list.d/nathan-renniewaldock-ubuntu-flux-zesty.list

     1 deb http://ppa.launchpad.net/nathan-renniewaldock/flux/ubuntu zesty main
     2 # deb-src http://ppa.launchpad.net/nathan-renniewaldock/flux/ubuntu zesty main

/etc/apt/sources.list.d/libreoffice-ubuntu-ppa-zesty.list

     1 deb http://ppa.launchpad.net/libreoffice/ppa/ubuntu zesty main
     2 # deb-src http://ppa.launchpad.net/libreoffice/ppa/ubuntu zesty main

/etc/apt/sources.list.d/doctormo-ubuntu-wacom-plus-zesty.list

/etc/apt/sources.list.d/rvm-ubuntu-smplayer-zesty.list

/etc/apt/sources.list.d/openshot_developers-ubuntu-ppa-zesty.list

     1 deb http://ppa.launchpad.net/openshot.developers/ppa/ubuntu zesty main
     2 # deb-src http://ppa.launchpad.net/openshot.developers/ppa/ubuntu zesty main

/etc/apt/sources.list.d/otto-kesselgulasch-ubuntu-gimp-edge-zesty.list

     1 deb http://ppa.launchpad.net/otto-kesselgulasch/gimp-edge/ubuntu zesty main
     2 # deb-src http://ppa.launchpad.net/otto-kesselgulasch/gimp-edge/ubuntu zesty main

/etc/apt/sources.list.d/virtualbox.list

/etc/apt/sources.list.d/skunk-ubuntu-pepper-flash-zesty.list

/etc/apt/sources.list.d/webupd8team-ubuntu-java-zesty.list

     1 deb http://ppa.launchpad.net/webupd8team/java/ubuntu zesty main
     2 # deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu zesty main

/etc/apt/sources.list.d/noobslab-ubuntu-themes-zesty.list

/etc/apt/sources.list.d/ubuntu-audio-dev-ubuntu-alsa-daily-zesty.list

/etc/apt/sources.list.d/arc-theme.list

/etc/apt/sources.list.d/kxstudio-debian-ubuntu-kxstudio-zesty.list

/etc/apt/sources.list.d/haecker-felix-ubuntu-gradio-daily-zesty.list

/etc/apt/sources.list.d/webupd8team-ubuntu-y-ppa-manager-zesty.list

/etc/apt/sources.list

     1 # deb cdrom:[Ubuntu-Studio 17.04 _Zesty Zapus_ - Alpha i386 (20161216)]/ zesty main multiverse restricted universe
     2
     3 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
     4 # newer versions of the distribution.
     5
     6 ## Major bug fix updates produced after the final release of the
     7 ## distribution.
     8
     9 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    10 ## team. Also, please note that software in universe WILL NOT receive any
    11 ## review or updates from the Ubuntu security team.
    12
    13 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    14 ## team, and may not be under a free licence. Please satisfy yourself as to
    15 ## your rights to use the software. Also, please note that software in
    16 ## multiverse WILL NOT receive any review or updates from the Ubuntu
    17 ## security team.
    18
    19 ## N.B. software from this repository may not have been tested as
    20 ## extensively as that contained in the main release, although it includes
    21 ## newer versions of some applications which may provide useful features.
    22 ## Also, please note that software in backports WILL NOT receive any review
    23 ## or updates from the Ubuntu security team.
    24
    25 ## Uncomment the following two lines to add software from Canonical's
    26 ## 'partner' repository.
    27 ## This software is not part of Ubuntu, but is offered by Canonical and the
    28 ## respective vendors as a service to Ubuntu users.
    29 deb http://archive.canonical.com/ubuntu zesty partner
    30 deb-src http://archive.canonical.com/ubuntu zesty partner
    31
    32 deb http://archive.ubuntu.com/ubuntu zesty main universe restricted multiverse
    33 deb-src http://archive.ubuntu.com/ubuntu zesty multiverse universe restricted main #Added by software-properties
    34 deb http://security.ubuntu.com/ubuntu/ zesty-security multiverse universe restricted main
    35 deb http://archive.ubuntu.com/ubuntu zesty-updates multiverse universe restricted main
    36 deb http://archive.ubuntu.com/ubuntu zesty-backports multiverse universe restricted main
    37
entschuldigung@ilprincipe-X125:~$ sudo dpkg --audit

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Solved by:
IlPrincipe
Solved:
2017-02-09
Last query:
2017-02-09
Last reply:
2017-02-09

What is the output of these 3 Terminal commands?

grep roxy /etc/apt/apt.conf.d/*

grep 127 /etc/apt/apt.conf.d/*

apt-cache policy apt-cacher-ng

IlPrincipe (riccardomini) said : #2

entschuldigung@ilprincipe-X125:~$ grep roxy /etc/apt/apt.conf.d/*
/etc/apt/apt.conf.d/01acng:Acquire::http::Proxy "http://127.0.0.1:3142";
entschuldigung@ilprincipe-X125:~$ grep 127 /etc/apt/apt.conf.d/*
/etc/apt/apt.conf.d/01acng:Acquire::http::Proxy "http://127.0.0.1:3142";
entschuldigung@ilprincipe-X125:~$ apt-cache policy apt-cacher-ng
apt-cacher-ng:
  Installed: 2-1
  Candidate: 2-1
  Version table:
 *** 2-1 100
        100 /var/lib/dpkg/status
entschuldigung@ilprincipe-X125:~$

Do you use a proxy? You seem to have configured a proxy server (http://127.0.0.1:3142) that does not work....

Have you tried uninstalling apt-cacher-ng and also deleting the file /etc/apt/apt.conf.d/01acng?

Can you connect to the Internet without using a proxy server?

IlPrincipe (riccardomini) said : #4

I didn't think I was using a proxy. I don't know how that came about, although I had an hint that it might have something to do with it. I followed your suggestions and it seems to work.
I ll mark it as solved.

Thank you.