After I upgraded a package, when I ran apt-cache policy <package-name>
, I saw that the previous version of this same package is not there in the list.
Before the bind9-dnsutils package was upgraded, cache list showed three different versions of this package:
$ apt-cache policy bind9-dnsutils
bind9-dnsutils:
Installed: 1:9.16.1-0ubuntu2.8
Candidate: 1:9.16.1-0ubuntu2.9
Version table:
1:9.16.1-0ubuntu2.9 500
500 http://pl.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
500 http://pl.archive.ubuntu.com/ubuntu focal-security/main amd64 Packages
*** 1:9.16.1-0ubuntu2.8 100
100 /var/lib/dpkg/status
1:9.16.1-0ubuntu2 500
500 http://pl.archive.ubuntu.com/ubuntu focal/main amd64 Packages
I performed bind9-dnsutils package upgrade to the latest version successfully. After package bind9-dnsutils is upgraded, when checked the cache list for this package is not showing the previous version 1:9.16.1-0ubuntu2.8 in the list.
$ sudo aptitude install bind9-dnsutils=1:9.16.1-0ubuntu2.9
bind9-dnsutils:
Installed: 1:9.16.1-0ubuntu2.9
Candidate: 1:9.16.1-0ubuntu2.9
Version table:
*** 1:9.16.1-0ubuntu2.9 500
500 http://pl.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
500 http://pl.archive.ubuntu.com/ubuntu focal-security/main amd64 Packages
100 /var/lib/dpkg/status
1:9.16.1-0ubuntu2 500
500 http://pl.archive.ubuntu.com/ubuntu focal/main amd64 Packages
As a result if I try to downgrade to version 1:9.16.1-0ubuntu2.8 I get this error message:
Unable to find a version "1:9.16.1-0ubuntu2.8" for the package "bind9-dnsutils"
Unable to apply some actions, aborting
Is there a way to maintain the immediate previous version in the cache so, that I can rollback to it in case I have to do so?
/etc/apt/apt.conf.d/20archive
, and broaden the range of packages to be kept. – user535733 Dec 06 '21 at 15:18Thanks for quick reply. I tried two approaches broaden the range and also by disabled the archiving by putting zero value for each variable. Both approach didn't work
APT::Archives::MaxAge "60";
APT::Archives::MinAge "60";
APT::Archives::MaxSize "1000";
APT::Archives::MaxAge "0";
APT::Archives::MinAge "0";
APT::Archives::MaxSize "0";
Ubuntu Version details
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3
LTS Release: 20.04 Codename: focal
Thanks Ani
– user3737851 Dec 07 '21 at 08:01