我尝试安装libmagick++-dev
(相关问题:如何在 Ubuntu 20.04 上安装 libmagick++-dev?)。但它需要降级几个软件包。我已经恢复了其中几个。但事实证明,其余需要降级的软件包需要删除太多已安装的软件包。我决定不这样做。现在我想恢复已安装软件包的先前版本。我该怎么做?
我的尝试记录如下:
sudo apt install libmagick++-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libmagick++-dev : Depends: imagemagick-6-common (= 8:6.9.10.23+dfsg-2.1ubuntu11) but 8:6.9.10.23+dfsg-2.1ubuntu11.10 is to be installed
Depends: libmagick++-6.q16-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
------
$ sudo apt install imagemagick-6-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
imagemagick-6-common is already the newest version (8:6.9.10.23+dfsg-2.1ubuntu11.10).
imagemagick-6-common set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.
------
$ sudo apt install imagemagick-6-common=8:6.9.10.23+dfsg-2.1ubuntu11
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
libimage-magick-perl
The following packages will be DOWNGRADED:
imagemagick-6-common
0 upgraded, 0 newly installed, 1 downgraded, 1 to remove and 15 not upgraded.
Need to get 60,8 kB of archives.
After this operation, 102 kB disk space will be freed.
Do you want to continue? [Y/n]
Get:1 http://archive.ubuntu.com/ubuntu focal/universe amd64 imagemagick-6-common all 8:6.9.10.23+dfsg-2.1ubuntu11 [60,8 kB]
Fetched 60,8 kB in 1s (82,4 kB/s)
(Reading database ... 365848 files and directories currently installed.)
Removing libimage-magick-perl (8:6.9.10.23+dfsg-2.1ubuntu11.10) ...
dpkg: warning: downgrading imagemagick-6-common from 8:6.9.10.23+dfsg-2.1ubuntu11.10 to 8:6.9.10.23+dfsg-2.1ubuntu11
(Reading database ... 365814 files and directories currently installed.)
Preparing to unpack .../imagemagick-6-common_8%3a6.9.10.23+dfsg-2.1ubuntu11_all.deb ...
Unpacking imagemagick-6-common (8:6.9.10.23+dfsg-2.1ubuntu11) over (8:6.9.10.23+dfsg-2.1ubuntu11.10) ...
Setting up imagemagick-6-common (8:6.9.10.23+dfsg-2.1ubuntu11) ...
Installing new version of config file /etc/ImageMagick-6/delegates.xml ...
Processing triggers for man-db (2.9.1-1) ...
----
Reverting is not working:
sudo apt install imagemagick-6-common=8:6.9.10.23+dfsg-2.1ubuntu11.10
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '8:6.9.10.23+dfsg-2.1ubuntu11.10' for 'imagemagick-6-common' was not found
apt list imagemagick-6-common
Listing... Done
imagemagick-6-common/focal,focal,now 8:6.9.10.23+dfsg-2.1ubuntu11 all [installed]
apt-cache madison imagemagick-6-common # list all versions of a package
imagemagick-6-common | 8:6.9.10.23+dfsg-2.1ubuntu11 | http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
imagemagick-6-common | 8:6.9.10.23+dfsg-2.1ubuntu11 | http://archive.ubuntu.com/ubuntu focal/universe i386 Packages
apt policy imagemagick-6-common
imagemagick-6-common:
Installed: 8:6.9.10.23+dfsg-2.1ubuntu11
Candidate: 8:6.9.10.23+dfsg-2.1ubuntu11
Version table:
*** 8:6.9.10.23+dfsg-2.1ubuntu11 500
500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
500 http://archive.ubuntu.com/ubuntu focal/universe i386 Packages
100 /var/lib/dpkg/status
由于某种原因,软件包的先前版本imagemagick-6-common=8:6.9.10.23+dfsg-2.1ubuntu11.10
在软件包管理系统中不可用。如何恢复?