A resposta é usar dpkg --set-selections
. Se você executar o comando dpkg --get-selections
, poderá ver o que já está definido:
$ dpkg --get-selections | head
acct install
adduser install
apparmor install
apparmor-utils install
apt install
apt-transport-https install
apt-utils install
aptitude install
at install
auditd install
Considere, neste caso, o pacote dnsutils
:
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
bind9-host dnsutils libbind9-60 libdns64 libisc60 libisccc60 libisccfg60 liblwres60
8 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,257kB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? n
Abort.
Agora vamos alterá-lo - colocar o pacote em espera:
$ echo dnsutils hold | sudo dpkg --set-selections
Verifique os resultados:
$ dpkg --get-selections | grep dnsutils
dnsutils hold
Tente a atualização novamente:
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
bind9-host dnsutils libbind9-60 libdns64 libisc60 libisccfg60 liblwres60
The following packages will be upgraded:
libisccc60
1 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
Need to get 29.9kB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? n
Abort.
Agora, dnsutils
- e seus pacotes relacionados - estão sendo retidos, exatamente como desejávamos.