[Solved] sudo apt upgrade errors

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
remus
Posts: 93
Joined: 2008-06-03 02:39

[Solved] sudo apt upgrade errors

#1 Post by remus »

Greetings,

Laptop running Debian 11

Code: Select all

$ cat /etc/debian_version 
11.7
/etc/apt/sources.list

Code: Select all

deb http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://deb.debian.org/debian bullseye-backports main contrib non-free
deb http://security.debian.org/debian-security/ bullseye-security main contrib non-free
I stopped doing updates/upgrade due to lack of space on /

Recently resized / +2Gb

Code: Select all

$ sudo apt update
Hit:1 http://deb.debian.org/debian bullseye InRelease
Hit:2 http://deb.debian.org/debian bullseye-updates InRelease
Hit:3 http://deb.debian.org/debian bullseye-backports InRelease
Hit:4 http://security.debian.org/debian-security bullseye-security InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
76 packages can be upgraded. Run 'apt list --upgradable' to see them.

Code: Select all

$ sudo apt upgrade
$ sudo apt upgrade -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  amd64-microcode base-files curl firefox-esr firefox-esr-l10n-ar
  firefox-esr-l10n-ast firefox-esr-l10n-be firefox-esr-l10n-bg
  firefox-esr-l10n-bn firefox-esr-l10n-bs firefox-esr-l10n-ca
  firefox-esr-l10n-cs firefox-esr-l10n-cy firefox-esr-l10n-da
  firefox-esr-l10n-de firefox-esr-l10n-el firefox-esr-l10n-en-gb
  firefox-esr-l10n-eo firefox-esr-l10n-es-ar firefox-esr-l10n-es-cl
  firefox-esr-l10n-es-es firefox-esr-l10n-es-mx firefox-esr-l10n-et
  firefox-esr-l10n-eu firefox-esr-l10n-fa firefox-esr-l10n-fi
  firefox-esr-l10n-fr firefox-esr-l10n-ga-ie firefox-esr-l10n-gl
  firefox-esr-l10n-gu-in firefox-esr-l10n-he firefox-esr-l10n-hi-in
  firefox-esr-l10n-hr firefox-esr-l10n-hu firefox-esr-l10n-id
  firefox-esr-l10n-is firefox-esr-l10n-it firefox-esr-l10n-ja
  firefox-esr-l10n-kk firefox-esr-l10n-km firefox-esr-l10n-kn
  firefox-esr-l10n-ko firefox-esr-l10n-lt firefox-esr-l10n-lv
  firefox-esr-l10n-mk firefox-esr-l10n-mr firefox-esr-l10n-nb-no
  firefox-esr-l10n-ne-np firefox-esr-l10n-nl firefox-esr-l10n-nn-no
  firefox-esr-l10n-pa-in firefox-esr-l10n-pl firefox-esr-l10n-pt-br
  firefox-esr-l10n-pt-pt firefox-esr-l10n-ro firefox-esr-l10n-ru
  firefox-esr-l10n-si firefox-esr-l10n-sk firefox-esr-l10n-sl
  firefox-esr-l10n-sq firefox-esr-l10n-sr firefox-esr-l10n-sv-se
  firefox-esr-l10n-ta firefox-esr-l10n-te firefox-esr-l10n-th
  firefox-esr-l10n-tr firefox-esr-l10n-uk firefox-esr-l10n-vi
  firefox-esr-l10n-zh-cn firefox-esr-l10n-zh-tw intel-microcode
  libcurl3-gnutls libcurl3-gnutls:i386 libcurl4 libcurl4:i386 usb.ids
76 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 9,062 kB/121 MB of archives.
After this operation, 782 kB of additional disk space will be used.
Err:1 http://deb.debian.org/debian bullseye/main amd64 base-files amd64 11.1+deb11u10
  404  Not Found [IP: 151.101.130.132 80]
Err:2 http://deb.debian.org/debian bullseye/non-free amd64 amd64-microcode amd64 3.20230808.1.1~deb11u1
  404  Not Found [IP: 151.101.130.132 80]
Err:3 http://deb.debian.org/debian bullseye/main amd64 curl amd64 7.74.0-1.3+deb11u12
  404  Not Found [IP: 151.101.130.132 80]
Err:4 http://deb.debian.org/debian bullseye/main i386 libcurl4 i386 7.74.0-1.3+deb11u12
  404  Not Found [IP: 151.101.130.132 80]
Err:5 http://deb.debian.org/debian bullseye/main amd64 libcurl4 amd64 7.74.0-1.3+deb11u12
  404  Not Found [IP: 151.101.130.132 80]
Err:6 http://deb.debian.org/debian bullseye/non-free amd64 intel-microcode amd64 3.20240514.1~deb11u1
  404  Not Found [IP: 151.101.130.132 80]
Err:7 http://deb.debian.org/debian bullseye/main amd64 libcurl3-gnutls amd64 7.74.0-1.3+deb11u12
  404  Not Found [IP: 151.101.130.132 80]
Err:8 http://deb.debian.org/debian bullseye/main i386 libcurl3-gnutls i386 7.74.0-1.3+deb11u12
  404  Not Found [IP: 151.101.130.132 80]
Ign:9 http://deb.debian.org/debian bullseye/main amd64 usb.ids all 2024.01.20-0+deb11u1
Err:9 http://deb.debian.org/debian bullseye/main amd64 usb.ids all 2024.01.20-0+deb11u1
  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/b/base-files/base-files_11.1%2bdeb11u10_amd64.deb  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/non-free/a/amd64-microcode/amd64-microcode_3.20230808.1.1%7edeb11u1_amd64.deb  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/c/curl/curl_7.74.0-1.3%2bdeb11u12_amd64.deb  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/c/curl/libcurl4_7.74.0-1.3%2bdeb11u12_i386.deb  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/c/curl/libcurl4_7.74.0-1.3%2bdeb11u12_amd64.deb  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/non-free/i/intel-microcode/intel-microcode_3.20240514.1%7edeb11u1_amd64.deb  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/c/curl/libcurl3-gnutls_7.74.0-1.3%2bdeb11u12_amd64.deb  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/c/curl/libcurl3-gnutls_7.74.0-1.3%2bdeb11u12_i386.deb  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/u/usb.ids/usb.ids_2024.01.20-0%2bdeb11u1_all.deb  404  Not Found [IP: 151.101.130.132 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Code: Select all

sudo apt upgrade --fix-missing 
Got me through a bunch of em, leaving 9 that won't update

Code: Select all

$ sudo apt list --upgradable
Listing... Done
amd64-microcode/oldstable 3.20230808.1.1~deb11u1 amd64 [upgradable from: 3.20230719.1~deb11u1]
base-files/oldstable 11.1+deb11u10 amd64 [upgradable from: 11.1+deb11u7]
curl/oldstable 7.74.0-1.3+deb11u12 amd64 [upgradable from: 7.74.0-1.3+deb11u11]
intel-microcode/oldstable 3.20240514.1~deb11u1 amd64 [upgradable from: 3.20230214.1~deb11u1]
libcurl3-gnutls/oldstable 7.74.0-1.3+deb11u12 amd64 [upgradable from: 7.74.0-1.3+deb11u11]
libcurl3-gnutls/oldstable 7.74.0-1.3+deb11u12 i386 [upgradable from: 7.74.0-1.3+deb11u11]
libcurl4/oldstable 7.74.0-1.3+deb11u12 amd64 [upgradable from: 7.74.0-1.3+deb11u11]
libcurl4/oldstable 7.74.0-1.3+deb11u12 i386 [upgradable from: 7.74.0-1.3+deb11u11]
usb.ids/oldstable,oldstable 2024.01.20-0+deb11u1 all [upgradable from: 2023.01.16-0+deb11u1]
And.....

Code: Select all

$ sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  amd64-microcode base-files curl intel-microcode libcurl3-gnutls
  libcurl3-gnutls:i386 libcurl4 libcurl4:i386 usb.ids
9 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 9,062 kB of archives.
After this operation, 2,012 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Err:1 http://deb.debian.org/debian bullseye/main amd64 base-files amd64 11.1+deb11u10
  404  Not Found [IP: 151.101.130.132 80]
Err:2 http://deb.debian.org/debian bullseye/non-free amd64 amd64-microcode amd64 3.20230808.1.1~deb11u1
  404  Not Found [IP: 151.101.130.132 80]
Err:3 http://deb.debian.org/debian bullseye/main amd64 curl amd64 7.74.0-1.3+deb11u12
  404  Not Found [IP: 151.101.130.132 80]
Err:4 http://deb.debian.org/debian bullseye/main i386 libcurl4 i386 7.74.0-1.3+deb11u12
  404  Not Found [IP: 151.101.130.132 80]
Err:5 http://deb.debian.org/debian bullseye/main amd64 libcurl4 amd64 7.74.0-1.3+deb11u12
  404  Not Found [IP: 151.101.130.132 80]
Err:6 http://deb.debian.org/debian bullseye/non-free amd64 intel-microcode amd64 3.20240514.1~deb11u1
  404  Not Found [IP: 151.101.130.132 80]
Err:7 http://deb.debian.org/debian bullseye/main i386 libcurl3-gnutls i386 7.74.0-1.3+deb11u12
  404  Not Found [IP: 151.101.130.132 80]
Err:8 http://deb.debian.org/debian bullseye/main amd64 libcurl3-gnutls amd64 7.74.0-1.3+deb11u12
  404  Not Found [IP: 151.101.130.132 80]
Ign:9 http://deb.debian.org/debian bullseye/main amd64 usb.ids all 2024.01.20-0+deb11u1
Err:9 http://deb.debian.org/debian bullseye/main amd64 usb.ids all 2024.01.20-0+deb11u1
  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/b/base-files/base-files_11.1%2bdeb11u10_amd64.deb  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/non-free/a/amd64-microcode/amd64-microcode_3.20230808.1.1%7edeb11u1_amd64.deb  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/c/curl/curl_7.74.0-1.3%2bdeb11u12_amd64.deb  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/c/curl/libcurl4_7.74.0-1.3%2bdeb11u12_i386.deb  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/c/curl/libcurl4_7.74.0-1.3%2bdeb11u12_amd64.deb  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/non-free/i/intel-microcode/intel-microcode_3.20240514.1%7edeb11u1_amd64.deb  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/c/curl/libcurl3-gnutls_7.74.0-1.3%2bdeb11u12_i386.deb  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/c/curl/libcurl3-gnutls_7.74.0-1.3%2bdeb11u12_amd64.deb  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/u/usb.ids/usb.ids_2024.01.20-0%2bdeb11u1_all.deb  404  Not Found [IP: 151.101.130.132 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

I'm fresh out of ideas...

Suggestions and comments welcome

Hope someone can help :)
Last edited by remus on 2024-10-15 16:06, edited 1 time in total.

Aki
Global Moderator
Global Moderator
Posts: 4036
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 112 times
Been thanked: 532 times

Re: sudo apt upgrade errors

#2 Post by Aki »

Hello,

You can see the following previous discussion:
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
Uptorn
Posts: 423
Joined: 2022-01-22 01:07
Has thanked: 331 times
Been thanked: 112 times

Re: sudo apt upgrade errors

#3 Post by Uptorn »

For the sake of those who will arrive at this thread by search engines:
Aki wrote: 2024-09-22 16:41 It’s probably a problem with the CDN in your region:

Code: Select all

Fastly error: unknown domain: 151.101.38.132. Please check that this domain has been added to a service.

Details: cache-ams21042-AMS (151.101.38.132)
Replace deb.debian.org in apt configuration with the address of a mirror from here: Then, run again:

Code: Select all

sudo apt update
sudo apt upgrade

remus
Posts: 93
Joined: 2008-06-03 02:39

SOLVED Re: sudo apt upgrade errors

#4 Post by remus »

It was a sources.list error

Bit of research led me to https://dslg.gnu.style/

Which made it easy for me.

My /etc/apt/sources.list file now looks like this

Code: Select all

deb http://ftp.au.debian.org/debian/ bullseye main contrib non-free
deb http://ftp.au.debian.org/debian/ bullseye-updates main contrib non-free
deb http://security.debian.org/debian-security bullseye-security main contrib non-free

deb http://ftp.au.debian.org/debian/ bullseye-backports main contrib non-free
Thanks for all the input :)

Aki
Global Moderator
Global Moderator
Posts: 4036
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 112 times
Been thanked: 532 times

Re: sudo apt upgrade errors

#5 Post by Aki »

Hello,

I'm glad you sorted it out. :)

Please, mark the discussion as "solved" manually adding the text tag "[Solved]" at the beginning of the subject of the first message.

I would suggest to change the title of the first post to make in more informative for other users with the same issue; e.g.:
[Solved] sudo apt upgrade errors (404 Not Found)
Thanks.

Happy Debian ! :)
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
sunrat
Site admin
Site admin
Posts: 7450
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 134 times
Been thanked: 665 times

Re: sudo apt upgrade errors

#6 Post by sunrat »

I'm in AU and never had a problem using deb.debian.org

I checked a couple of the packages that failed to download and they are not the current versions in the repo eg.:
intel-microcode should be 3.20240813.1~deb11u1 whereas your post shows 3.20240514.1~deb11u1 is failing to download.
Did you run apt update before apt upgrade?
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
Bloom
df -h | grep > 90TiB
df -h | grep > 90TiB
Posts: 530
Joined: 2017-11-11 12:23
Been thanked: 34 times

Re: sudo apt upgrade errors

#7 Post by Bloom »

For the sake of being complete, I'll give another tip.
You can use netselect-apt to get the fastest mirror where you live:

Code: Select all

sudo netselect-apt -n
The -n tells it to include the non-free repositories. We don't specify a release, so it will use the systems' on which it runs.
If you get an error saying the command cannot be found, install it:

Code: Select all

sudo apt install netselect-apt
After running netselect-apt, you will find a sources.list file in your current directory. Use sudo to copy or move it to /etc/apt/.

remus
Posts: 93
Joined: 2008-06-03 02:39

Re: sudo apt upgrade errors

#8 Post by remus »

sunrat wrote: 2024-10-14 06:37 I'm in AU and never had a problem using deb.debian.org

I checked a couple of the packages that failed to download and they are not the current versions in the repo eg.:
intel-microcode should be 3.20240813.1~deb11u1 whereas your post shows 3.20240514.1~deb11u1 is failing to download.
Did you run apt update before apt upgrade?
Yes, I always run

sudo apt update

first

User avatar
fabien
Forum Helper
Forum Helper
Posts: 1158
Joined: 2019-12-03 12:51
Location: Anarres (Toulouse, France actually)
Has thanked: 101 times
Been thanked: 265 times

Re: sudo apt upgrade errors

#9 Post by fabien »

remus wrote: 2024-10-14 15:20
sunrat wrote: 2024-10-14 06:37 I'm in AU and never had a problem using deb.debian.org

I checked a couple of the packages that failed to download and they are not the current versions in the repo eg.:
intel-microcode should be 3.20240813.1~deb11u1 whereas your post shows 3.20240514.1~deb11u1 is failing to download.
Did you run apt update before apt upgrade?
Yes, I always run

sudo apt update

first
So, as @sunrat pointed out, it was not a problem with deb.debian.org (it was a different kind of problem). But by changing the sources.list you updated the files in /var/lib/apt/lists/ and that fixed the problem.
You can confirm this by going back to deb.debian.org in your sources.list, it should work now.
ImageShare your Debian SCRIPTS
There will be neither barrier nor walls, neither official nor guard, there will be no more desert and the entire world will become a garden. — Anacharsis Cloots

Aki
Global Moderator
Global Moderator
Posts: 4036
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 112 times
Been thanked: 532 times

Re: sudo apt upgrade errors

#10 Post by Aki »

Hello @fabien,
fabien wrote: 2024-10-14 22:37 So, as @sunrat pointed out, it was not a problem with deb.debian.org (it was a different kind of problem). But by changing the sources.list you updated the files in /var/lib/apt/lists/ and that fixed the problem.
You can confirm this by going back to deb.debian.org in your sources.list, it should work now.
May you please recap the cause and the preferred solution ?

Thanks. :D
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

remus
Posts: 93
Joined: 2008-06-03 02:39

Re: sudo apt upgrade errors

#11 Post by remus »

I restored my original sources.list file as suggested and things are still working fine.

Code: Select all

$ sudo apt update
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://security.debian.org/debian-security bullseye-security InRelease [27.2 kB]
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]        
Hit:4 https://brave-browser-apt-release.s3.brave.com stable InRelease          
Hit:5 https://download.docker.com/linux/debian bullseye InRelease              
Get:6 http://deb.debian.org/debian bullseye-backports InRelease [49.0 kB]      
Hit:7 https://linux.teamviewer.com/deb stable InRelease                      
Get:8 http://deb.debian.org/debian bullseye/main amd64 Packages [8,066 kB]
Get:9 http://deb.debian.org/debian bullseye/main i386 Packages [8,007 kB]
Get:10 http://deb.debian.org/debian bullseye/main Translation-en [6,235 kB]
Get:11 http://deb.debian.org/debian bullseye/main amd64 DEP-11 Metadata [4,049 kB]
Get:12 http://deb.debian.org/debian bullseye/main DEP-11 48x48 Icons [3,478 kB]
Get:13 http://deb.debian.org/debian bullseye/main DEP-11 64x64 Icons [7,315 kB]
Get:14 http://deb.debian.org/debian bullseye/main i386 Contents (deb) [10.3 MB]
Get:15 http://deb.debian.org/debian bullseye/main amd64 Contents (deb) [10.3 MB]
Get:16 http://deb.debian.org/debian bullseye/main all Contents (deb) [31.3 MB] 
Get:17 http://deb.debian.org/debian bullseye/contrib i386 Packages [45.2 kB]   
Get:18 http://deb.debian.org/debian bullseye/contrib amd64 Packages [50.4 kB]  
Get:19 http://deb.debian.org/debian bullseye/contrib Translation-en [46.9 kB]  
Get:20 http://deb.debian.org/debian bullseye/contrib amd64 DEP-11 Metadata [13.6 kB]
Get:21 http://deb.debian.org/debian bullseye/contrib DEP-11 48x48 Icons [47.2 kB]
Get:22 http://deb.debian.org/debian bullseye/contrib DEP-11 64x64 Icons [93.3 kB]
Get:23 http://deb.debian.org/debian bullseye/contrib all Contents (deb) [57.3 kB]
Get:24 http://deb.debian.org/debian bullseye/contrib amd64 Contents (deb) [54.7 kB]
Get:25 http://deb.debian.org/debian bullseye/contrib i386 Contents (deb) [33.6 kB]
Get:26 http://deb.debian.org/debian bullseye/non-free amd64 Packages [96.4 kB] 
Get:27 http://deb.debian.org/debian bullseye/non-free i386 Packages [78.5 kB]  
Get:28 http://deb.debian.org/debian bullseye/non-free Translation-en [92.5 kB] 
Get:29 http://deb.debian.org/debian bullseye/non-free amd64 DEP-11 Metadata [17.9 kB]
Get:30 http://deb.debian.org/debian bullseye/non-free DEP-11 48x48 Icons [741 B]
Get:31 http://deb.debian.org/debian bullseye/non-free DEP-11 64x64 Icons [27.7 kB]
Get:32 http://deb.debian.org/debian bullseye/non-free i386 Contents (deb) [29.4 kB]
Get:33 http://deb.debian.org/debian bullseye/non-free amd64 Contents (deb) [81.1 kB]
Get:34 http://deb.debian.org/debian bullseye/non-free all Contents (deb) [888 kB]
Get:35 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [18.8 kB]
Get:36 http://deb.debian.org/debian bullseye-updates/main i386 Packages [19.3 kB]
Get:37 http://deb.debian.org/debian bullseye-updates/main Translation-en [10.9 kB]
Get:38 http://deb.debian.org/debian bullseye-updates/main all Contents (deb) [27.3 kB]
Get:39 http://deb.debian.org/debian bullseye-updates/main amd64 Contents (deb) [88.3 kB]
Get:40 http://deb.debian.org/debian bullseye-updates/main i386 Contents (deb) [90.0 kB]
Get:41 http://deb.debian.org/debian bullseye-backports/main i386 Packages [398 kB]
Get:42 http://deb.debian.org/debian bullseye-backports/main amd64 Packages [403 kB]
Get:43 http://deb.debian.org/debian bullseye-backports/main Translation-en [344 kB]
Get:44 http://deb.debian.org/debian bullseye-backports/main i386 Contents (deb) [1,213 kB]
Get:45 http://deb.debian.org/debian bullseye-backports/main amd64 Contents (deb) [1,133 kB]
Get:46 http://deb.debian.org/debian bullseye-backports/main all Contents (deb) [4,672 kB]
Get:47 http://deb.debian.org/debian bullseye-backports/contrib i386 Packages [5,568 B]
Get:48 http://deb.debian.org/debian bullseye-backports/contrib amd64 Packages [6,164 B]
Get:49 http://deb.debian.org/debian bullseye-backports/contrib Translation-en [6,128 B]
Get:50 http://deb.debian.org/debian bullseye-backports/contrib amd64 Contents (deb) [17.3 kB]
Get:51 http://deb.debian.org/debian bullseye-backports/contrib all Contents (deb) [22.2 kB]
Get:52 http://deb.debian.org/debian bullseye-backports/contrib i386 Contents (deb) [17.0 kB]
Get:53 http://deb.debian.org/debian bullseye-backports/non-free amd64 Packages [14.4 kB]
Get:54 http://deb.debian.org/debian bullseye-backports/non-free i386 Packages [12.4 kB]
Get:55 http://deb.debian.org/debian bullseye-backports/non-free Translation-en [28.2 kB]
Get:56 http://deb.debian.org/debian bullseye-backports/non-free all Contents (deb) [58.5 kB]
Get:57 http://deb.debian.org/debian bullseye-backports/non-free i386 Contents (deb) [6,117 B]
Get:58 http://deb.debian.org/debian bullseye-backports/non-free amd64 Contents (deb) [11.5 kB]
Fetched 99.7 MB in 24s (4,163 kB/s)                                            
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.

User avatar
fabien
Forum Helper
Forum Helper
Posts: 1158
Joined: 2019-12-03 12:51
Location: Anarres (Toulouse, France actually)
Has thanked: 101 times
Been thanked: 265 times

Re: sudo apt upgrade errors

#12 Post by fabien »

remus wrote: 2024-10-15 16:05 I restored my original sources.list file as suggested and things are still working fine.
Thanks for your feedback and confirmation.
Aki wrote: 2024-10-15 15:52 May you please recap the cause and the preferred solution ?
Hello @Aki, of course.

When we run apt update, APT compares the local Release files in /var/lib/apt/lists/ with the remote Release files on the server.
APT does this simply by comparing the timestamps of the Release files. Only timestamps are taken into account, this relies on a simple HTTP mechanism, not, for example, file checksums.
If the local Release file is older than the remote file, APT downloads the new Release file and then the Packages files. The timestamp of these local files is that of the server.

If APT downloads a new Release file but for some reason does not download the corresponding Packages files, the old Packages files remain until a new Release file on the server (with a newer timestamp than the local one) gives a chance to correct the situation, there is no checking mechanism (I point out that why-pkg -x detects this situation). This isn't really a problem for repositories that change frequently like the security repository, but it is for repositories like the main repository that may remain unchanged for weeks or even months.

This is the direct cause of problems like the one in this topic. The root cause, however, is still unknown. What causes APT to fail to download (or maybe, more likely, copy from a temporary location?) Packages files after successfully downloading a Release file? And this without triggering an error or warning? Hard to know without being able to reproduce the problem.

The root cause is difficult to know, the direct cause is easier to find, and the solution, once the problem is detected, is really simple. Anything that can trigger a normal sequence, that is, make APT download the Release file which should be followed by the download of the Packages files:
  • touch the relevant Release file with an older date than the one on the server should work according to the above observation (not confirmed though)
  • rm the relevant Release file
  • mv /var/lib/apt/lists/ /var/lib/apt/lists-BACK/
  • apt distclean (apt >= 2.7.8 i.e. currently in testing and unstable)
  • as seen in this thread, by modifying the source of the relevant Release file
Solutions 3 and 4 are probably the simplest for those who don't want to delve further. I'm interested in feedback on solution 1. Solution 5 is probably not really wanted.

edit Sun Oct 20 09:43:21 UTC 2024: I forgot to mention the open bug: apt update silently leaves old index data
ImageShare your Debian SCRIPTS
There will be neither barrier nor walls, neither official nor guard, there will be no more desert and the entire world will become a garden. — Anacharsis Cloots

Post Reply