Score:0

Ubuntu update and upgrade fails majorly with the main component

im flag

Both ubuntu update and upgrade fails irrespective of mirrors used for the main component with the following errors. This prevents the system from being up to date and installing new packages.

Update log

Ign:14 http://mirrors.piconets.webwerks.in/ubuntu-mirror/ubuntu jammy amd64 Contents (deb)                                                                                                                        
Ign:14 http://mirrors.piconets.webwerks.in/ubuntu-mirror/ubuntu jammy amd64 Contents (deb)
Err:14 http://mirrors.piconets.webwerks.in/ubuntu-mirror/ubuntu jammy amd64 Contents (deb)
  Connection failed [IP: 43.240.66.200 80]
Fetched 252 MB in 3min 44s (1,127 kB/s)
Reading package lists... Done
E: Failed to fetch http://mirrors.piconets.webwerks.in/ubuntu-mirror/ubuntu/dists/jammy/Contents-amd64  Connection failed [IP: 43.240.66.200 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

Upgrade log

Ign:21 http://mirrors.piconets.webwerks.in/ubuntu-mirror/ubuntu jammy amd64 Contents (deb)
Err:21 http://mirrors.piconets.webwerks.in/ubuntu-mirror/ubuntu jammy amd64 Contents (deb)
  Connection failed [IP: 43.240.66.200 80]
Fetched 249 MB in 2min 1s (2,054 kB/s)
Reading package lists... Done
E: Failed to fetch http://mirrors.piconets.webwerks.in/ubuntu-mirror/ubuntu/dists/jammy/Contents-amd64  Connection failed [IP: 43.240.66.200 80]
E: Failed to fetch https://ubuntu-ports.mirror.net.in/dists/jammy/main/binary-i386/Packages  404  Not Found [IP: 103.195.68.3 443]
E: Failed to fetch https://ubuntu-ports.mirror.net.in/dists/jammy-updates/main/binary-i386/Packages  404  Not Found [IP: 103.195.68.3 443]
E: Failed to fetch https://ubuntu-ports.mirror.net.in/dists/jammy-backports/main/binary-i386/Packages  404  Not Found [IP: 103.195.68.3 443]
E: Failed to fetch https://ubuntu-ports.mirror.net.in/dists/jammy-security/main/binary-amd64/Packages  404  Not Found [IP: 103.195.68.3 443]
E: Some index files failed to download. They have been ignored, or old ones used instead.
bhargav@bhargav-Lenovo-Legion-Y540-15IRH-PG0:~$ 

Initially though that my ISP was blocking URLs but the other machine within the same network works perfectly fine.

Mirrors tried till now,

http://archive.ubuntu.com/ubuntu
https://ubuntu-ports.mirror.net.in
https://mirror.renu.ac.ug/ubuntu
http://in.archive.ubuntu.com/ubuntu
http://mirrors.piconets.webwerks.in/ubuntu-mirror/ubuntu

Here is log with archive.ubuntu.com

Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease       
Hit:4 http://archive.ubuntu.com/ubuntu jammy-security InRelease        
Hit:5 https://apt.kitware.com/ubuntu focal InRelease
Get:6 http://archive.ubuntu.com/ubuntu jammy amd64 Contents (deb) [46.9 MB]
Ign:6 http://archive.ubuntu.com/ubuntu jammy amd64 Contents (deb)                                                                                                                                         
Get:7 http://archive.ubuntu.com/ubuntu jammy i386 Contents (deb) [36.9 MB]
Get:8 http://archive.ubuntu.com/ubuntu jammy/main amd64 c-n-f Metadata [30.3 kB]                                                                                                                          
Get:9 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [129 kB]                                                                                                                           
Get:10 http://archive.ubuntu.com/ubuntu jammy/restricted i386 Packages [30.4 kB]                                                                                                                          
Get:11 http://archive.ubuntu.com/ubuntu jammy/restricted Translation-en [18.6 kB]                                                                                                                         
Get:12 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 c-n-f Metadata [488 B]                                                                                                                     
Get:13 http://archive.ubuntu.com/ubuntu jammy/universe i386 Packages [7,474 kB]                                                                                                                           
Get:14 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [14.1 MB]                                                                                                                           
Get:15 http://archive.ubuntu.com/ubuntu jammy/universe Translation-en [5,652 kB]                                                                                                                          
Get:16 http://archive.ubuntu.com/ubuntu jammy/universe amd64 DEP-11 Metadata [3,559 kB]                                                                                                                   
Get:17 http://archive.ubuntu.com/ubuntu jammy/universe DEP-11 48x48 Icons [3,447 kB]                                                                                                                      
Ign:17 http://archive.ubuntu.com/ubuntu jammy/universe DEP-11 48x48 Icons                                                                                                                                 
Get:18 http://archive.ubuntu.com/ubuntu jammy/universe DEP-11 64x64 Icons [7,609 kB]
Get:18 http://archive.ubuntu.com/ubuntu jammy/universe DEP-11 64x64 Icons [7,609 kB]                                                                                                                      
Get:19 http://archive.ubuntu.com/ubuntu jammy/universe DEP-11 64x64@2 Icons [69.3 kB]                                                                                                                     
Get:20 http://archive.ubuntu.com/ubuntu jammy/universe amd64 c-n-f Metadata [286 kB]                                                                                                                      
Get:21 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [217 kB]                                                                                                                          
Get:22 http://archive.ubuntu.com/ubuntu jammy/multiverse i386 Packages [112 kB]                                                                                                                           
Get:23 http://archive.ubuntu.com/ubuntu jammy/multiverse Translation-en [112 kB]                                                                                                                          
Get:24 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 DEP-11 Metadata [42.1 kB]                                                                                                                  
Get:25 http://archive.ubuntu.com/ubuntu jammy/multiverse DEP-11 48x48 Icons [42.7 kB]                                                                                                                     
Get:26 http://archive.ubuntu.com/ubuntu jammy/multiverse DEP-11 64x64 Icons [193 kB]                                                                                                                      
Get:27 http://archive.ubuntu.com/ubuntu jammy/multiverse DEP-11 64x64@2 Icons [214 B]                                                                                                                     
Get:28 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 c-n-f Metadata [8,372 B]                                                                                                                   
Ign:6 http://archive.ubuntu.com/ubuntu jammy amd64 Contents (deb)                                                                                                                                         
Get:17 http://archive.ubuntu.com/ubuntu jammy/universe DEP-11 48x48 Icons [3,447 kB]
Ign:17 http://archive.ubuntu.com/ubuntu jammy/universe DEP-11 48x48 Icons                                                                                                                                 
Ign:6 http://archive.ubuntu.com/ubuntu jammy amd64 Contents (deb)
Ign:17 http://archive.ubuntu.com/ubuntu jammy/universe DEP-11 48x48 Icons
Err:6 http://archive.ubuntu.com/ubuntu jammy amd64 Contents (deb)
  Connection failed [IP: 91.189.91.38 80]
Ign:17 http://archive.ubuntu.com/ubuntu jammy/universe DEP-11 48x48 Icons
Fetched 73.3 MB in 5min 53s (208 kB/s)
Reading package lists... Done
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/Contents-amd64  Connection failed [IP: 91.189.91.38 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
pl flag
Please revert to the standard mirror - `archive.ubuntu.com` and show us the output of `sudo apt update`, pasted in the question above.
Bhargav Das avatar
im flag
@popey I have attached the log, please check.
pl flag
Do you have a dodgy/slow internet connection? Because that seemed to mostly work? It's likely not the mirror at fault but your network connection.
Bhargav Das avatar
im flag
The connection is not slow, as my other ubuntu machines updates successfully.
Score:0
im flag

After digging a lot why apt doesn't work (fiddling with nameserver, proxy's and DNS) though those urls and IPs are reachable found that my ISP gives up on the sources as soon as the speed throttles. Finally found this page whose Method 2 works https://docs.e2enetworks.com/guides/apt_slow.html .

Here is what I did to solve the issue.

  1. Downloaded netselect (this package is not present in ubuntu pool also I was not able to install anything via apt)
wget http://ftp.au.debian.org/debian/pool/main/n/netselect/netselect_0.3.ds1-28+b1_amd64.deb 
  1. Install
sudo dpkg -i netselect_0.3.ds1-28+b1_amd64.deb
  1. Searched for the fastest mirror available near me using,
sudo netselect -s 20 -t 40 $(wget -qO - http://mirrors.ubuntu.com/mirrors.txt)
   26 http://ftp.iitm.ac.in/ubuntu/
   37 http://mirrors.piconets.webwerks.in/ubuntu-mirror/ubuntu/
   68 https://in.mirror.coganng.com/ubuntu-ports/
   97 http://repos.del.extreme-ix.org/ubuntu/
   99 http://ubuntu.hbcse.tifr.res.in/ubuntu/
  564 http://archive.ubuntu.com/ubuntu/
  578 http://archive.ubuntu.com/ubuntu/
 1080 http://archive.ubuntu.com/ubuntu/
 1696 http://archive.ubuntu.com/ubuntu/
Only found  9 hosts out of 20 requested.

  1. Replaced http://archive.ubuntu.com/ubuntu with http://ftp.iitm.ac.in/ubuntu/ in /etc/apt/sources.list

Now everything started working again :)

Bhargav Das avatar
im flag
This solution also works if you are completely offline https://www.ibm.com/docs/en/linux-on-systems?topic=linuxonibm/liabu/liabunointernetupdateubuntu.html
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.