Tentei instalar libmagick++-dev
(pergunta relacionada: Como instalar libmagick++-dev no Ubuntu 20.04? ). Mas é preciso fazer downgrade de vários pacotes. Reverti vários deles. Mas, como se viu, o restante do downgrade requer a remoção de muitos dos pacotes instalados. Decidi não fazer isso. Agora, gostaria de restaurar as versões anteriores dos pacotes instalados. Como posso fazer isso?
O registro das minhas tentativas é o seguinte:
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
A versão anterior do pacote imagemagick-6-common=8:6.9.10.23+dfsg-2.1ubuntu11.10
por algum motivo não está disponível no sistema de gerenciamento de pacotes. Como restaurá-lo?
Normalmente, para reverter o pacote rebaixado, basta
sudo apt install package-name
usar o seguinte.Eu tive problemas com fontes apt. Eu esqueci que defina fontes Debian em vez de fontes apt Ubuntu. E havia outras versões de pacotes. Detalhes nesta resposta para a pergunta relacionada "Como instalar libmagick++-dev no Ubuntu 20.04?" .