#1059954 apt: "apt changelog" may fail because it tries to fetch an old version

Package:
apt
Source:
apt
Description:
commandline package manager
Submitter:
Vincent Lefevre
Date:
2026-02-17 14:37:03 UTC
Severity:
normal
#1059954#5
Date:
2024-01-04 02:26:44 UTC
From:
To:
I get the following error (after "apt update"):

cventin:~> apt changelog dkms
Err:1 https://metadata.ftp-master.debian.org dkms 3.0.12-3 Changelog
  Changelog unavailable for dkms=3.0.12-3 (404  Not Found [IP: 146.75.118.132 443])
E: Failed to fetch https://metadata.ftp-master.debian.org/changelogs/main/d/dkms/dkms_3.0.12-3_changelog  Changelog unavailable for dkms=3.0.12-3 (404  Not Found [IP: 146.75.118.132 443])

"apt changelog" should take the latest version to avoid a failure,
e.g.

https://metadata.ftp-master.debian.org/changelogs/main/d/dkms/dkms_3.0.12-4_changelog

I already got such an error for another package 2 days ago
(bug 1059822), so this seems to be rather common.

#1059954#12
Date:
2024-11-27 10:07:02 UTC
From:
To:
This is currently occurring again with binutils:

Err:1 https://metadata.ftp-master.debian.org binutils 2.43.50.20241126-1 Changelog
  Changelog unavailable for binutils=2.43.50.20241126-1 (404  Not Found [IP: 2a04:4e42:6a::644 443])
E: Failed to fetch https://metadata.ftp-master.debian.org/changelogs/main/b/binutils/binutils_2.43.50.20241126-1_changelog  Changelog unavailable for binutils=2.43.50.20241126-1 (404  Not Found [IP: 2a04:4e42:6a::644 443])

Because old versions for the distribution are systematically removed,
I don't think that it makes sense to try to fetch a fixed version.
Since metadata.ftp-master.debian.org contains <dist>_changelog files,
such a file should be fetched instead (for the default distribution,
use the same as what "apt-get install" does).

Related to this issue, the apt-get(8) man page says

  changelog
    changelog tries to download the changelog of a package and displays
    it through sensible-pager. By default it displays the changelog for
    the version that is installed. However, you can specify the same
    options as for the install command.

First, the "By default it displays the changelog for the version that
is installed." is incorrect: 2.43.1-5 is currently installed on my
machine, not 2.43.50.20241126-1 (the version apt tries to fetch).

BTW, since 2.43.1-5 is currently "testing", the changelog is still
available on metadata.ftp-master.debian.org.

Moreover, the "However, you can specify the same options as for the
install command." is incorrect too. Since the install command supports
the -t option (e.g. -t unstable), this should also be the case for the
changelog command. This seems to work for "testing", but neither for
"unstable" or "stable", e.g.

qaa:~> apt-get changelog -t stable binutils
Err:1 https://metadata.ftp-master.debian.org binutils 2.43.50.20241126-1 Changelog
  Changelog unavailable for binutils=2.43.50.20241126-1 (404  Not Found [IP: 2a04:4e42:6a::644 443])
E: Failed to fetch https://metadata.ftp-master.debian.org/changelogs/main/b/binutils/binutils_2.43.50.20241126-1_changelog  Changelog unavailable for binutils=2.43.50.20241126-1 (404  Not Found [IP: 2a04:4e42:6a::644 443])

while "apt-show-versions -a binutils" says that the stable version
is 2.40-2; so, fetching the 2.43.50.20241126-1 version does not make
sense at all.

#1059954#21
Date:
2025-02-14 12:56:58 UTC
From:
To:
Control: found -1 2.9.28
[...]

Note that this kind of error may be permanent. For instance,
there is the same issue with

$ apt changelog libmimalloc2.0
Err:1 https://metadata.ftp-master.debian.org mimalloc 3.0.1+ds-1 Changelog
  Changelog unavailable for mimalloc=3.0.1+ds-1 (404  Not Found [IP: 146.75.118.132 443])
Error: Failed to fetch https://metadata.ftp-master.debian.org/changelogs/main/m/mimalloc/mimalloc_3.0.1%2bds-1_changelog  Changelog unavailable for mimalloc=3.0.1+ds-1 (404  Not Found [IP: 146.75.118.132 443])

as mimalloc 3.0.1+ds-2 has been available for 3 weeks. However,
libmimalloc2.0 3.0.1+ds-1 is the latest version because the package
is no longer built:

https://packages.debian.org/en/sid/libmimalloc2.0 says:

Package: libmimalloc2.0 (3.0.1+ds-1 and others)
                         ^^^^^^^^^^

#1059954#28
Date:
2025-02-14 13:40:54 UTC
From:
To:
BTW, I've just noticed that contrary to "apt changelog", this web page
uses the correct link to the changelog:

https://metadata.ftp-master.debian.org/changelogs//main/m/mimalloc/mimalloc_3.0.1+ds-2_changelog

(over "Debian Changelog" in the links on the right).

#1059954#33
Date:
2025-02-25 18:54:27 UTC
From:
To:
Control: severity -1 wishlist

Adjusting the severity based on the complexity on the request. This
requires calculating multiple changepaths and URLs, setting up fallback
URLs etc, such that we first try the installed version - as we must
do - and then try the candidate.

#1059954#44
Date:
2026-02-17 14:36:51 UTC
From:
To:
Note that though apt-listchanges outputs an error about this issue,
it is able to display the expected changelog.

For instance, with "apt install linux-doc", it gives

apt-listchanges: Unable to retrieve changelog for package linux-doc; 'apt-get changelog' failed with: E: Failed to fetch https://metadata.ftp-master.debian.org/changelogs/main/l/linux/linux_6.18.10-1_changelog  Changelog unavailable for linux=6.18.10-1 (404  Not Found [IP: 146.75.118.132 443])

but then

apt-listchanges: Changelogs
---------------------------

linux (6.18.10-1) unstable; urgency=medium
[...]