Connection Refused while apt-get update ubuntu 18.04 over proxy












0















I recently installed ubuntu 18.04 and wanted to install sublime. Howver I tried running sudo apt-get update before that and I get the following output



Err:1 http://archive.canonical.com/ubuntu bionic InRelease
Could not connect to archive.canonical.com:80 (91.189.91.15). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::16). - connect (101: Network is unreachable) Could not connect to archive.canonical.com:80 (91.189.92.150). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1562::1c). - connect (101: Network is unreachable) Could not connect to archive.canonical.com:80 (91.189.92.191). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::1b). - connect (101: Network is unreachable)
Err:2 https://download.sublimetext.com apt/stable/ InRelease
Could not connect to download.sublimetext.com:443 (104.236.0.104). - connect (111: Connection refused)
Err:3 http://security.ubuntu.com/ubuntu bionic-security InRelease
Could not connect to security.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::16). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.91.23). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::19). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.26). - connect (111: Connection refused)
Err:4 http://in.archive.ubuntu.com/ubuntu bionic InRelease
Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) Could not connect to in.archive.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused)
Err:5 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease
Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable)
Err:6 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease
Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable)
Reading package lists... Done
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/bionic/InRelease Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) Could not connect to in.archive.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused)
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable)
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable)
W: Failed to fetch http://archive.canonical.com/ubuntu/dists/bionic/InRelease Could not connect to archive.canonical.com:80 (91.189.91.15). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::16). - connect (101: Network is unreachable) Could not connect to archive.canonical.com:80 (91.189.92.150). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1562::1c). - connect (101: Network is unreachable) Could not connect to archive.canonical.com:80 (91.189.92.191). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::1b). - connect (101: Network is unreachable)
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Could not connect to security.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::16). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.91.23). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::19). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.26). - connect (111: Connection refused)
W: Failed to fetch https://download.sublimetext.com/apt/stable/InRelease Could not connect to download.sublimetext.com:443 (104.236.0.104). - connect (111: Connection refused)
W: Some index files failed to download. They have been ignored, or old ones used instead.


I am connected via proxy and the internet working fine on browser. I tried the following as well :



m@m-Lenovo-ideapad-500-15ISK:~$ ping archive.ubuntu.com
PING archive.ubuntu.com (91.189.88.161) 56(84) bytes of data.
64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=1 ttl=45 time=127 ms
64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=2 ttl=45 time=127 ms
64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=3 ttl=45 time=127 ms
64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=4 ttl=45 time=127 ms
64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=5 ttl=45 time=127 ms
^C
--- archive.ubuntu.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4001ms
rtt min/avg/max/mdev = 127.232/127.426/127.761/0.296 ms


env | grep proxy returns the following:



m@m-Lenovo-ideapad-500-15ISK:~$ env | grep proxy
HTTP_PROXY=http://proxy.iiit.ac.in:8080/
FTP_PROXY=http://proxy.iiit.ac.in:8080/
https_proxy=http://proxy.iiit.ac.in:8080/
http_proxy=http://proxy.iiit.ac.in:8080/
ALL_PROXY=socks://proxy.iiit.ac.in:8080/
no_proxy=localhost,127.0.0.0/8,::1
HTTPS_PROXY=http://proxy.iiit.ac.in:8080/
all_proxy=socks://proxy.iiit.ac.in:8080/
ftp_proxy=http://proxy.iiit.ac.in:8080/


Note that apt-get update is working fine without proxy on my mobile hotspot but not via the proxy on my lan / wifi. How do I fix this ?



edit



Trying to install sublime gives the following error :



m@m-Lenovo-ideapad-500-15ISK:~$ sudo apt-get install sublime-text
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
sublime-text
0 upgraded, 1 newly installed, 0 to remove and 90 not upgraded.
Need to get 8,494 kB of archives.
After this operation, 25.1 MB of additional disk space will be used.
Err:1 https://download.sublimetext.com apt/stable/ sublime-text 3176
Could not connect to download.sublimetext.com:443 (104.236.0.104). - connect (111: Connection refused)
E: Failed to fetch https://download.sublimetext.com/files/sublime-text_build-3176_amd64.deb Could not connect to download.sublimetext.com:443 (104.236.0.104). - connect (111: Connection refused)
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?


However, I can ping with 0 packet loss on the given IP over the same connection



ping 104.236.0.104
PING 104.236.0.104 (104.236.0.104) 56(84) bytes of data.
64 bytes from 104.236.0.104: icmp_seq=1 ttl=48 time=206 ms
64 bytes from 104.236.0.104: icmp_seq=2 ttl=48 time=207 ms
64 bytes from 104.236.0.104: icmp_seq=3 ttl=48 time=206 ms
64 bytes from 104.236.0.104: icmp_seq=4 ttl=48 time=206 ms
64 bytes from 104.236.0.104: icmp_seq=5 ttl=48 time=207 ms
^C
--- 104.236.0.104 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 206.334/206.879/207.767/0.593 ms









share|improve this question





























    0















    I recently installed ubuntu 18.04 and wanted to install sublime. Howver I tried running sudo apt-get update before that and I get the following output



    Err:1 http://archive.canonical.com/ubuntu bionic InRelease
    Could not connect to archive.canonical.com:80 (91.189.91.15). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::16). - connect (101: Network is unreachable) Could not connect to archive.canonical.com:80 (91.189.92.150). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1562::1c). - connect (101: Network is unreachable) Could not connect to archive.canonical.com:80 (91.189.92.191). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::1b). - connect (101: Network is unreachable)
    Err:2 https://download.sublimetext.com apt/stable/ InRelease
    Could not connect to download.sublimetext.com:443 (104.236.0.104). - connect (111: Connection refused)
    Err:3 http://security.ubuntu.com/ubuntu bionic-security InRelease
    Could not connect to security.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::16). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.91.23). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::19). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.26). - connect (111: Connection refused)
    Err:4 http://in.archive.ubuntu.com/ubuntu bionic InRelease
    Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) Could not connect to in.archive.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused)
    Err:5 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease
    Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable)
    Err:6 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease
    Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable)
    Reading package lists... Done
    W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/bionic/InRelease Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) Could not connect to in.archive.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused)
    W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable)
    W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable)
    W: Failed to fetch http://archive.canonical.com/ubuntu/dists/bionic/InRelease Could not connect to archive.canonical.com:80 (91.189.91.15). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::16). - connect (101: Network is unreachable) Could not connect to archive.canonical.com:80 (91.189.92.150). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1562::1c). - connect (101: Network is unreachable) Could not connect to archive.canonical.com:80 (91.189.92.191). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::1b). - connect (101: Network is unreachable)
    W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Could not connect to security.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::16). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.91.23). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::19). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.26). - connect (111: Connection refused)
    W: Failed to fetch https://download.sublimetext.com/apt/stable/InRelease Could not connect to download.sublimetext.com:443 (104.236.0.104). - connect (111: Connection refused)
    W: Some index files failed to download. They have been ignored, or old ones used instead.


    I am connected via proxy and the internet working fine on browser. I tried the following as well :



    m@m-Lenovo-ideapad-500-15ISK:~$ ping archive.ubuntu.com
    PING archive.ubuntu.com (91.189.88.161) 56(84) bytes of data.
    64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=1 ttl=45 time=127 ms
    64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=2 ttl=45 time=127 ms
    64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=3 ttl=45 time=127 ms
    64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=4 ttl=45 time=127 ms
    64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=5 ttl=45 time=127 ms
    ^C
    --- archive.ubuntu.com ping statistics ---
    5 packets transmitted, 5 received, 0% packet loss, time 4001ms
    rtt min/avg/max/mdev = 127.232/127.426/127.761/0.296 ms


    env | grep proxy returns the following:



    m@m-Lenovo-ideapad-500-15ISK:~$ env | grep proxy
    HTTP_PROXY=http://proxy.iiit.ac.in:8080/
    FTP_PROXY=http://proxy.iiit.ac.in:8080/
    https_proxy=http://proxy.iiit.ac.in:8080/
    http_proxy=http://proxy.iiit.ac.in:8080/
    ALL_PROXY=socks://proxy.iiit.ac.in:8080/
    no_proxy=localhost,127.0.0.0/8,::1
    HTTPS_PROXY=http://proxy.iiit.ac.in:8080/
    all_proxy=socks://proxy.iiit.ac.in:8080/
    ftp_proxy=http://proxy.iiit.ac.in:8080/


    Note that apt-get update is working fine without proxy on my mobile hotspot but not via the proxy on my lan / wifi. How do I fix this ?



    edit



    Trying to install sublime gives the following error :



    m@m-Lenovo-ideapad-500-15ISK:~$ sudo apt-get install sublime-text
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following NEW packages will be installed:
    sublime-text
    0 upgraded, 1 newly installed, 0 to remove and 90 not upgraded.
    Need to get 8,494 kB of archives.
    After this operation, 25.1 MB of additional disk space will be used.
    Err:1 https://download.sublimetext.com apt/stable/ sublime-text 3176
    Could not connect to download.sublimetext.com:443 (104.236.0.104). - connect (111: Connection refused)
    E: Failed to fetch https://download.sublimetext.com/files/sublime-text_build-3176_amd64.deb Could not connect to download.sublimetext.com:443 (104.236.0.104). - connect (111: Connection refused)
    E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?


    However, I can ping with 0 packet loss on the given IP over the same connection



    ping 104.236.0.104
    PING 104.236.0.104 (104.236.0.104) 56(84) bytes of data.
    64 bytes from 104.236.0.104: icmp_seq=1 ttl=48 time=206 ms
    64 bytes from 104.236.0.104: icmp_seq=2 ttl=48 time=207 ms
    64 bytes from 104.236.0.104: icmp_seq=3 ttl=48 time=206 ms
    64 bytes from 104.236.0.104: icmp_seq=4 ttl=48 time=206 ms
    64 bytes from 104.236.0.104: icmp_seq=5 ttl=48 time=207 ms
    ^C
    --- 104.236.0.104 ping statistics ---
    5 packets transmitted, 5 received, 0% packet loss, time 4006ms
    rtt min/avg/max/mdev = 206.334/206.879/207.767/0.593 ms









    share|improve this question



























      0












      0








      0








      I recently installed ubuntu 18.04 and wanted to install sublime. Howver I tried running sudo apt-get update before that and I get the following output



      Err:1 http://archive.canonical.com/ubuntu bionic InRelease
      Could not connect to archive.canonical.com:80 (91.189.91.15). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::16). - connect (101: Network is unreachable) Could not connect to archive.canonical.com:80 (91.189.92.150). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1562::1c). - connect (101: Network is unreachable) Could not connect to archive.canonical.com:80 (91.189.92.191). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::1b). - connect (101: Network is unreachable)
      Err:2 https://download.sublimetext.com apt/stable/ InRelease
      Could not connect to download.sublimetext.com:443 (104.236.0.104). - connect (111: Connection refused)
      Err:3 http://security.ubuntu.com/ubuntu bionic-security InRelease
      Could not connect to security.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::16). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.91.23). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::19). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.26). - connect (111: Connection refused)
      Err:4 http://in.archive.ubuntu.com/ubuntu bionic InRelease
      Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) Could not connect to in.archive.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused)
      Err:5 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease
      Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable)
      Err:6 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease
      Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable)
      Reading package lists... Done
      W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/bionic/InRelease Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) Could not connect to in.archive.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused)
      W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable)
      W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable)
      W: Failed to fetch http://archive.canonical.com/ubuntu/dists/bionic/InRelease Could not connect to archive.canonical.com:80 (91.189.91.15). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::16). - connect (101: Network is unreachable) Could not connect to archive.canonical.com:80 (91.189.92.150). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1562::1c). - connect (101: Network is unreachable) Could not connect to archive.canonical.com:80 (91.189.92.191). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::1b). - connect (101: Network is unreachable)
      W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Could not connect to security.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::16). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.91.23). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::19). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.26). - connect (111: Connection refused)
      W: Failed to fetch https://download.sublimetext.com/apt/stable/InRelease Could not connect to download.sublimetext.com:443 (104.236.0.104). - connect (111: Connection refused)
      W: Some index files failed to download. They have been ignored, or old ones used instead.


      I am connected via proxy and the internet working fine on browser. I tried the following as well :



      m@m-Lenovo-ideapad-500-15ISK:~$ ping archive.ubuntu.com
      PING archive.ubuntu.com (91.189.88.161) 56(84) bytes of data.
      64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=1 ttl=45 time=127 ms
      64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=2 ttl=45 time=127 ms
      64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=3 ttl=45 time=127 ms
      64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=4 ttl=45 time=127 ms
      64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=5 ttl=45 time=127 ms
      ^C
      --- archive.ubuntu.com ping statistics ---
      5 packets transmitted, 5 received, 0% packet loss, time 4001ms
      rtt min/avg/max/mdev = 127.232/127.426/127.761/0.296 ms


      env | grep proxy returns the following:



      m@m-Lenovo-ideapad-500-15ISK:~$ env | grep proxy
      HTTP_PROXY=http://proxy.iiit.ac.in:8080/
      FTP_PROXY=http://proxy.iiit.ac.in:8080/
      https_proxy=http://proxy.iiit.ac.in:8080/
      http_proxy=http://proxy.iiit.ac.in:8080/
      ALL_PROXY=socks://proxy.iiit.ac.in:8080/
      no_proxy=localhost,127.0.0.0/8,::1
      HTTPS_PROXY=http://proxy.iiit.ac.in:8080/
      all_proxy=socks://proxy.iiit.ac.in:8080/
      ftp_proxy=http://proxy.iiit.ac.in:8080/


      Note that apt-get update is working fine without proxy on my mobile hotspot but not via the proxy on my lan / wifi. How do I fix this ?



      edit



      Trying to install sublime gives the following error :



      m@m-Lenovo-ideapad-500-15ISK:~$ sudo apt-get install sublime-text
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      The following NEW packages will be installed:
      sublime-text
      0 upgraded, 1 newly installed, 0 to remove and 90 not upgraded.
      Need to get 8,494 kB of archives.
      After this operation, 25.1 MB of additional disk space will be used.
      Err:1 https://download.sublimetext.com apt/stable/ sublime-text 3176
      Could not connect to download.sublimetext.com:443 (104.236.0.104). - connect (111: Connection refused)
      E: Failed to fetch https://download.sublimetext.com/files/sublime-text_build-3176_amd64.deb Could not connect to download.sublimetext.com:443 (104.236.0.104). - connect (111: Connection refused)
      E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?


      However, I can ping with 0 packet loss on the given IP over the same connection



      ping 104.236.0.104
      PING 104.236.0.104 (104.236.0.104) 56(84) bytes of data.
      64 bytes from 104.236.0.104: icmp_seq=1 ttl=48 time=206 ms
      64 bytes from 104.236.0.104: icmp_seq=2 ttl=48 time=207 ms
      64 bytes from 104.236.0.104: icmp_seq=3 ttl=48 time=206 ms
      64 bytes from 104.236.0.104: icmp_seq=4 ttl=48 time=206 ms
      64 bytes from 104.236.0.104: icmp_seq=5 ttl=48 time=207 ms
      ^C
      --- 104.236.0.104 ping statistics ---
      5 packets transmitted, 5 received, 0% packet loss, time 4006ms
      rtt min/avg/max/mdev = 206.334/206.879/207.767/0.593 ms









      share|improve this question
















      I recently installed ubuntu 18.04 and wanted to install sublime. Howver I tried running sudo apt-get update before that and I get the following output



      Err:1 http://archive.canonical.com/ubuntu bionic InRelease
      Could not connect to archive.canonical.com:80 (91.189.91.15). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::16). - connect (101: Network is unreachable) Could not connect to archive.canonical.com:80 (91.189.92.150). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1562::1c). - connect (101: Network is unreachable) Could not connect to archive.canonical.com:80 (91.189.92.191). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::1b). - connect (101: Network is unreachable)
      Err:2 https://download.sublimetext.com apt/stable/ InRelease
      Could not connect to download.sublimetext.com:443 (104.236.0.104). - connect (111: Connection refused)
      Err:3 http://security.ubuntu.com/ubuntu bionic-security InRelease
      Could not connect to security.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::16). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.91.23). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::19). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.26). - connect (111: Connection refused)
      Err:4 http://in.archive.ubuntu.com/ubuntu bionic InRelease
      Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) Could not connect to in.archive.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused)
      Err:5 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease
      Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable)
      Err:6 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease
      Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable)
      Reading package lists... Done
      W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/bionic/InRelease Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) Could not connect to in.archive.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to in.archive.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused)
      W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable)
      W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable)
      W: Failed to fetch http://archive.canonical.com/ubuntu/dists/bionic/InRelease Could not connect to archive.canonical.com:80 (91.189.91.15). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::16). - connect (101: Network is unreachable) Could not connect to archive.canonical.com:80 (91.189.92.150). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1562::1c). - connect (101: Network is unreachable) Could not connect to archive.canonical.com:80 (91.189.92.191). - connect (111: Connection refused) Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::1b). - connect (101: Network is unreachable)
      W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Could not connect to security.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::16). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.91.23). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::19). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::17). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::11). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.161). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.26). - connect (111: Connection refused)
      W: Failed to fetch https://download.sublimetext.com/apt/stable/InRelease Could not connect to download.sublimetext.com:443 (104.236.0.104). - connect (111: Connection refused)
      W: Some index files failed to download. They have been ignored, or old ones used instead.


      I am connected via proxy and the internet working fine on browser. I tried the following as well :



      m@m-Lenovo-ideapad-500-15ISK:~$ ping archive.ubuntu.com
      PING archive.ubuntu.com (91.189.88.161) 56(84) bytes of data.
      64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=1 ttl=45 time=127 ms
      64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=2 ttl=45 time=127 ms
      64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=3 ttl=45 time=127 ms
      64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=4 ttl=45 time=127 ms
      64 bytes from keeton.canonical.com (91.189.88.161): icmp_seq=5 ttl=45 time=127 ms
      ^C
      --- archive.ubuntu.com ping statistics ---
      5 packets transmitted, 5 received, 0% packet loss, time 4001ms
      rtt min/avg/max/mdev = 127.232/127.426/127.761/0.296 ms


      env | grep proxy returns the following:



      m@m-Lenovo-ideapad-500-15ISK:~$ env | grep proxy
      HTTP_PROXY=http://proxy.iiit.ac.in:8080/
      FTP_PROXY=http://proxy.iiit.ac.in:8080/
      https_proxy=http://proxy.iiit.ac.in:8080/
      http_proxy=http://proxy.iiit.ac.in:8080/
      ALL_PROXY=socks://proxy.iiit.ac.in:8080/
      no_proxy=localhost,127.0.0.0/8,::1
      HTTPS_PROXY=http://proxy.iiit.ac.in:8080/
      all_proxy=socks://proxy.iiit.ac.in:8080/
      ftp_proxy=http://proxy.iiit.ac.in:8080/


      Note that apt-get update is working fine without proxy on my mobile hotspot but not via the proxy on my lan / wifi. How do I fix this ?



      edit



      Trying to install sublime gives the following error :



      m@m-Lenovo-ideapad-500-15ISK:~$ sudo apt-get install sublime-text
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      The following NEW packages will be installed:
      sublime-text
      0 upgraded, 1 newly installed, 0 to remove and 90 not upgraded.
      Need to get 8,494 kB of archives.
      After this operation, 25.1 MB of additional disk space will be used.
      Err:1 https://download.sublimetext.com apt/stable/ sublime-text 3176
      Could not connect to download.sublimetext.com:443 (104.236.0.104). - connect (111: Connection refused)
      E: Failed to fetch https://download.sublimetext.com/files/sublime-text_build-3176_amd64.deb Could not connect to download.sublimetext.com:443 (104.236.0.104). - connect (111: Connection refused)
      E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?


      However, I can ping with 0 packet loss on the given IP over the same connection



      ping 104.236.0.104
      PING 104.236.0.104 (104.236.0.104) 56(84) bytes of data.
      64 bytes from 104.236.0.104: icmp_seq=1 ttl=48 time=206 ms
      64 bytes from 104.236.0.104: icmp_seq=2 ttl=48 time=207 ms
      64 bytes from 104.236.0.104: icmp_seq=3 ttl=48 time=206 ms
      64 bytes from 104.236.0.104: icmp_seq=4 ttl=48 time=206 ms
      64 bytes from 104.236.0.104: icmp_seq=5 ttl=48 time=207 ms
      ^C
      --- 104.236.0.104 ping statistics ---
      5 packets transmitted, 5 received, 0% packet loss, time 4006ms
      rtt min/avg/max/mdev = 206.334/206.879/207.767/0.593 ms






      apt updates internet 18.04 proxy






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jun 11 '18 at 9:49







      fireball.1

















      asked Jun 11 '18 at 9:14









      fireball.1fireball.1

      1118




      1118






















          2 Answers
          2






          active

          oldest

          votes


















          1














          The issue is that the proxy settings are not being passed to the "sudo" level. You are able to ping and wget stuff as a normal user since you have the http_proxy and https_proxy settings set for that current user. When you use sudo, those environment variables are not passed to the elevated user.



          The solution is to use -E with sudo to pass on those environment variables to the elevated user.



          For example, do the following:



          sudo -E apt-get update


          It should work.






          share|improve this answer































            0














            The following work as a charm :



            Append this in ~/.bashrc file



            alias iiitproxy='export http_proxy="http://proxy.iiit.ac.in:8080"; export https_proxy="http://proxy.iiit.ac.in:8080";export ftp_proxy="http://proxy.iiit.ac.in:8080"; echo "Acquire::http::proxy "http://proxy.iiit.ac.in:8080/";" | sudo tee /etc/apt/apt.conf'


            then run the following in your terminal:



             source ~/.bashrc 


            to refresh terminal and,



            iiitproxy


            I am not too sure what is different here, but it worked






            share|improve this answer























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "89"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1045547%2fconnection-refused-while-apt-get-update-ubuntu-18-04-over-proxy%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              The issue is that the proxy settings are not being passed to the "sudo" level. You are able to ping and wget stuff as a normal user since you have the http_proxy and https_proxy settings set for that current user. When you use sudo, those environment variables are not passed to the elevated user.



              The solution is to use -E with sudo to pass on those environment variables to the elevated user.



              For example, do the following:



              sudo -E apt-get update


              It should work.






              share|improve this answer




























                1














                The issue is that the proxy settings are not being passed to the "sudo" level. You are able to ping and wget stuff as a normal user since you have the http_proxy and https_proxy settings set for that current user. When you use sudo, those environment variables are not passed to the elevated user.



                The solution is to use -E with sudo to pass on those environment variables to the elevated user.



                For example, do the following:



                sudo -E apt-get update


                It should work.






                share|improve this answer


























                  1












                  1








                  1







                  The issue is that the proxy settings are not being passed to the "sudo" level. You are able to ping and wget stuff as a normal user since you have the http_proxy and https_proxy settings set for that current user. When you use sudo, those environment variables are not passed to the elevated user.



                  The solution is to use -E with sudo to pass on those environment variables to the elevated user.



                  For example, do the following:



                  sudo -E apt-get update


                  It should work.






                  share|improve this answer













                  The issue is that the proxy settings are not being passed to the "sudo" level. You are able to ping and wget stuff as a normal user since you have the http_proxy and https_proxy settings set for that current user. When you use sudo, those environment variables are not passed to the elevated user.



                  The solution is to use -E with sudo to pass on those environment variables to the elevated user.



                  For example, do the following:



                  sudo -E apt-get update


                  It should work.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 16 at 15:31









                  shailenTJshailenTJ

                  1113




                  1113

























                      0














                      The following work as a charm :



                      Append this in ~/.bashrc file



                      alias iiitproxy='export http_proxy="http://proxy.iiit.ac.in:8080"; export https_proxy="http://proxy.iiit.ac.in:8080";export ftp_proxy="http://proxy.iiit.ac.in:8080"; echo "Acquire::http::proxy "http://proxy.iiit.ac.in:8080/";" | sudo tee /etc/apt/apt.conf'


                      then run the following in your terminal:



                       source ~/.bashrc 


                      to refresh terminal and,



                      iiitproxy


                      I am not too sure what is different here, but it worked






                      share|improve this answer




























                        0














                        The following work as a charm :



                        Append this in ~/.bashrc file



                        alias iiitproxy='export http_proxy="http://proxy.iiit.ac.in:8080"; export https_proxy="http://proxy.iiit.ac.in:8080";export ftp_proxy="http://proxy.iiit.ac.in:8080"; echo "Acquire::http::proxy "http://proxy.iiit.ac.in:8080/";" | sudo tee /etc/apt/apt.conf'


                        then run the following in your terminal:



                         source ~/.bashrc 


                        to refresh terminal and,



                        iiitproxy


                        I am not too sure what is different here, but it worked






                        share|improve this answer


























                          0












                          0








                          0







                          The following work as a charm :



                          Append this in ~/.bashrc file



                          alias iiitproxy='export http_proxy="http://proxy.iiit.ac.in:8080"; export https_proxy="http://proxy.iiit.ac.in:8080";export ftp_proxy="http://proxy.iiit.ac.in:8080"; echo "Acquire::http::proxy "http://proxy.iiit.ac.in:8080/";" | sudo tee /etc/apt/apt.conf'


                          then run the following in your terminal:



                           source ~/.bashrc 


                          to refresh terminal and,



                          iiitproxy


                          I am not too sure what is different here, but it worked






                          share|improve this answer













                          The following work as a charm :



                          Append this in ~/.bashrc file



                          alias iiitproxy='export http_proxy="http://proxy.iiit.ac.in:8080"; export https_proxy="http://proxy.iiit.ac.in:8080";export ftp_proxy="http://proxy.iiit.ac.in:8080"; echo "Acquire::http::proxy "http://proxy.iiit.ac.in:8080/";" | sudo tee /etc/apt/apt.conf'


                          then run the following in your terminal:



                           source ~/.bashrc 


                          to refresh terminal and,



                          iiitproxy


                          I am not too sure what is different here, but it worked







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Jun 11 '18 at 14:05









                          fireball.1fireball.1

                          1118




                          1118






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Ask Ubuntu!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1045547%2fconnection-refused-while-apt-get-update-ubuntu-18-04-over-proxy%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Human spaceflight

                              Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                              張江高科駅