Na verdade, eu prefiro usar o gerenciador de pacotes aptitude
para instalar / resolver dependências de pacotes. Você instala com:
sudo apt-get install aptitude
Os comandos são bem parecidos com apt
/ apt-get
.
aptitude
parece ser mais inteligente que as outras ferramentas que lidam com dependências. Ele também mostra menus com alternativas para lidar com procedimentos de exclusão / instalação e mostra alternativas (se e quando existirem) quando você recusa a primeira opção.
$sudo aptitude purge libasound2
The following packages will be REMOVED:
libasound2{p} libasound2-data{u}
The following packages have unmet dependencies:
openjdk-8-jre : Depends: libasound2 (>= 1.0.16) but it is not going to be installed
The following actions will resolve these dependencies:
Remove the following packages:
1) openjdk-8-jre [8u111-b14-3 (now, testing)]
Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) libasound2 [1.1.2-1 (now, testing)]
2) libasound2-data [1.1.2-1 (now, testing)]
Accept this solution? [Y/n/q/?]
Do debt Aptitude wiki :
Aptitude has a number of useful features, including:
- a mutt-like syntax for matching packages in a flexible manner mark
- packages as "automatically installed" or "manually installed" so that packages can be auto-removed when no longer required
- colorful preview of actions about to be taken
- dselect-like persistence of user actions
- the ability to retrieve and display the Debian changelog of most packages
- AptCLI-like (= apt-get + apt-cache) command line mode ("aptitude install foo")
- Score-based and (usually) smarter dependency resolver than apt-get
Embora tenha sido classificado como obsoleto há muitos anos, e pode-se argumentar que outras ferramentas oferecem uma funcionalidade semelhante, eu também recomendo debfoster
para limpar a sujeira de um sistema. debfoster
é particularmente interessante, por exemplo, ao ajudar a reduzir uma VM base para usar como instalação / modelo base.
Você instala com:
sudo apt-get install debfoster
Eu também o uso frequentemente em VMs de pré-produção para salvar o estado real dos pacotes antes de fazer testes e, em seguida, usar o estado salvo para reverter para excluir todos os pacotes adicionados como estavam antes de executá-lo.
De HOWTO: usando o debfoster na prática
debfoster - weed unnecessary Debian packages
debfoster maintains a list of installed packages that were explicitly
requested rather than installed as a dependency. Arguments are
entirely optional, debfoster can be invoked per se after each run of
dpkg and/or apt-get.
Alternatively you can use debfoster to install and remove packages by
specifying the packages on the command line. Packages suffixed with a
- are removed while packages without a suffix are installed.
If a new package is encountered or if debfoster notices that a package
that used to be a dependency is now an orphan, it will ask you what to
do with it. If you decide to keep it, debfoster will just take note
and continue. If you decide that this package is not interesting
enough it will be removed as soon as debfoster is done asking
questions. If your choises cause other packages to become orphaned
more questions will ensue.
$sudo debfoster
smem is keeping the following 27 packages installed:
blt fonts-lyx libglade2-0 libjs-jquery libjs-jquery-ui liblapack3 libtk8.6 libwebp6
libwebpdemux2 libwebpmux2 libxss1 python-cairo python-cycler python-dateutil
python-glade2 python-gobject-2 python-gtk2 python-imaging python-matplotlib
python-matplotlib-data python-numpy python-pil python-pyparsing python-tk python-tz
tk8.6-blt2.5 ttf-bitstream-vera
Keep smem? [Ynpsiuqx?], [H]elp: Y
imvirt is keeping the following 9 packages installed:
imvirt-helper libemail-date-format-perl libfile-slurp-perl libfile-which-perl
libimvirt-perl libmime-lite-perl libmime-types-perl libmodule-find-perl pciutils
Keep imvirt? [Ynpsiuqx?], [H]elp: Y
linux-image-4.8.0-1-amd64-unsigned is keeping the following 9 packages installed:
busybox firmware-linux-free initramfs-tools initramfs-tools-core irqbalance
klibc-utils libklibc libnuma1 linux-base
Keep linux-image-4.8.0-1-amd64-unsigned? [Ynpsiuqx?], [H]elp: Y
faketime is keeping the following 1 packages installed:
libfaketime
Keep faketime? [Ynpsiuqx?], [H]elp: N
haveged is keeping the following 1 packages installed:
libhavege1
Keep haveged? [Ynpsiuqx?], [H]elp: Y
Keep libfaketime? [Ynpsiuqx?], [H]elp: N
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
faketime* libfaketime*
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
After this operation, 127 kB disk space will be freed.
Do you want to continue? [Y/n]