3

Got this error while sudo apt update

Err:8 http://in.archive.ubuntu.com/ubuntu bionic InRelease                             
  Cannot initiate the connection to in.archive.ubuntu.com:80 (2403:8940:ffff::f). - connect (101: Network is unreachable) Could not connect to in.archive.ubuntu.com:80 (103.97.84.254), connection timed out


Searching I found that there may be problem resolving IPv6 address. So, forced IPv4 using sudo apt -o Acquire::ForceIPv4=true update, even though as we see above apt tries IPv4.

Err:8 http://in.archive.ubuntu.com/ubuntu bionic InRelease                                             
  Could not connect to in.archive.ubuntu.com:80 (103.97.84.254), connection timed out


To make sure problem is not caused by other ppa, I reset my /etc/apt/sources.list from http://repogen.simplylinux.ch/. Still doesn't solve the problem.

Hit:1 http://ppa.launchpad.net/audio-recorder/ppa/ubuntu bionic InRelease
Hit:2 http://dl.google.com/linux/chrome/deb stable InRelease                                           
Hit:3 http://packages.microsoft.com/repos/vscode stable InRelease                                      
Hit:4 http://ppa.launchpad.net/bookworm-team/bookworm/ubuntu bionic InRelease                          
Hit:5 http://repo.steampowered.com/steam precise InRelease                                             
Hit:6 http://ppa.launchpad.net/kritalime/ppa/ubuntu bionic InRelease                                   
Hit:7 http://ppa.launchpad.net/rvm/smplayer/ubuntu bionic InRelease                                    
Err:8 http://in.archive.ubuntu.com/ubuntu bionic InRelease                             
  Cannot initiate the connection to in.archive.ubuntu.com:80 (2403:8940:ffff::f). - connect (101: Network is unreachable) Could not connect to in.archive.ubuntu.com:80 (103.97.84.254), connection timed out
Err:9 http://in.archive.ubuntu.com/ubuntu bionic-security InRelease
  Cannot initiate the connection to in.archive.ubuntu.com:80 (2403:8940:ffff::f). - connect (101: Network is unreachable)
Err:10 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease
  Cannot initiate the connection to in.archive.ubuntu.com:80 (2403:8940:ffff::f). - connect (101: Network is unreachable)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
182 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Cannot initiate the connection to in.archive.ubuntu.com:80 (2403:8940:ffff::f). - connect (101: Network is unreachable) Could not connect to in.archive.ubuntu.com:80 (103.97.84.254), connection timed out
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Cannot initiate the connection to in.archive.ubuntu.com:80 (2403:8940:ffff::f). - connect (101: Network is unreachable)
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Cannot initiate the connection to in.archive.ubuntu.com:80 (2403:8940:ffff::f). - connect (101: Network is unreachable)
W: Some index files failed to download. They have been ignored, or old ones used instead.

Also tried changing mirror. Error persists

Finally I tried to see debug info using sudo apt -oDebug::pkgAcquire::Worker=1 update, but output doesn't give extra info

Hit:7 http://ppa.launchpad.net/rvm/smplayer/ubuntu bionic InRelease               
0% [Connecting to in.archive.ubuntu.com (2403:8940:ffff::f)] <- gpgv:200%20URI%20Start%0aURI:%20gpgv:/var/lib/apt/lists/ppa.launchpad.net_rvm_smplayer_ubuntu_dists_bionic_InRelease
0% [7 InRelease gpgv 15.4 kB] [Connecting to in.archive.ubuntu.com (2403:8940:ffff::f)] <- gpgv:201%20URI%20Done%0aGPGVOutput:%20GOODSIG%20A7E13D78E4A4F4F4%0aURI:%20gpgv:/var/lib/apt/lists/ppa.launchpad.net_rvm_smplayer_ubuntu_dists_bionic_InRelease%0aFilename:%20/var/lib/apt/lists/ppa.launchpad.net_rvm_smplayer_ubuntu_dists_bionic_InRelease
0% [Connecting to in.archive.ubuntu.com (2403:8940:ffff::f)] <- http:400%20URI%20Failure%0aTransient-Failure:%20true%0aFailReason:%20Timeout%0aURI:%20http://in.archive.ubuntu.com/ubuntu/dists/bionic/InRelease%0aMessage:%20Cannot%20initiate%20the%20connection%20to%20in.archive.ubuntu.com:80%20(2403:8940:ffff::f).%20-%20connect%20(101:%20Network%20is%20unreachable)%20Could%20not%20connect%20to%20in.archive.ubuntu.com:80%20(103.97.84.254),%20connection%20timed%20out
Err:8 http://in.archive.ubuntu.com/ubuntu bionic InRelease  
  Cannot initiate the connection to in.archive.ubuntu.com:80 (2403:8940:ffff::f). - connect (101: Network is unreachable) Could not connect to in.archive.ubuntu.com:80 (103.97.84.254), connection timed out
0% [Working] <- http:102%20Status%0aURI:%20http://in.archive.ubuntu.com/ubuntu/dists/bionic-security/InRelease%0aMessage:%20Connecting%20to%20in.archive.ubuntu.com%20(103.97.84.254)
 <- http:102%20Status%0aURI:%20http://in.archive.ubuntu.com/ubuntu/dists/bionic-security/InRelease%0aMessage:%20Connecting%20to%20in.archive.ubuntu.com%20(2403:8940:ffff::f)
 <- http:400%20URI%20Failure%0aFailReason:%20Timeout%0aURI:%20http://in.archive.ubuntu.com/ubuntu/dists/bionic-security/InRelease%0aMessage:%20Cannot%20initiate%20the%20connection%20to%20in.archive.ubuntu.com:80%20(2403:8940:ffff::f).%20-%20connect%20(101:%20Network%20is%20unreachable)

I also tried removing DNS cache using sudo systemd-resolve --flush-caches

Extra info /etc/apt/sources.list

#------------------------------------------------------------------------------#
#                            OFFICIAL UBUNTU REPOS                             #
#------------------------------------------------------------------------------#
Mirror

#deb http://mirror.cse.iitk.ac.in/ubuntu/ bionic main #deb-src http://mirror.cse.iitk.ac.in/ubuntu/ bionic main

Ubuntu Main Repos

deb http://in.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse deb-src http://in.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse

Ubuntu Update Repos

deb http://in.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse deb http://in.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://in.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://in.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse

ping in.archive.ubuntu.com

$ ping in.archive.ubuntu.com
PING ubuntu-archive.mirrors.estointernet.in (103.97.84.254) 56(84) bytes of data.
64 bytes from 103.97.84.254 (103.97.84.254): icmp_seq=1 ttl=57 time=100 ms
64 bytes from 103.97.84.254 (103.97.84.254): icmp_seq=2 ttl=57 time=99.7 ms
64 bytes from 103.97.84.254 (103.97.84.254): icmp_seq=3 ttl=57 time=100 ms
64 bytes from 103.97.84.254 (103.97.84.254): icmp_seq=4 ttl=57 time=100 ms

Comments

I cropped debug output to remove unnecessary output, but I can edit to post full output.

I mostly found issue was with DNS in other questions, but I am able to ping servers so that shouldn't be a problem.

Question

Is there a way I can fix this? If not, is there a way to reset DNS+apt+sources so that everything works(apart from reinstall ubuntu)?

Edit: Also, when I reset sources.list, I still see extra ppa like steam ppa, kritalime ppa, etc... Did I do miss something after writing sources.list ?

Infinity
  • 131

1 Answers1

0

As there was a problem with connecting in.archive.ubuntu.com itself, I solved it by changing all the URLs to working mirror.

/etc/apt/sources.list

#------------------------------------------------------------------------------#
#                            OFFICIAL UBUNTU REPOS                             #
#------------------------------------------------------------------------------#
Mirror

deb http://mirror.cse.iitk.ac.in/ubuntu/ bionic main deb-src http://mirror.cse.iitk.ac.in/ubuntu/ bionic main

Ubuntu Main Repos

#deb http://in.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse #deb-src http://in.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse

Ubuntu Update Repos

deb http://mirror.cse.iitk.ac.in/ubuntu/ bionic-security main restricted universe multiverse deb http://mirror.cse.iitk.ac.in/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirror.cse.iitk.ac.in/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirror.cse.iitk.ac.in/ubuntu/ bionic-updates main restricted universe multiverse

Infinity
  • 131