brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: apt-cache rdepends shows what needs a package before apt removes it

Apt
~/tips/tip-apt-rdepends-reverse-dependencies

apt-cache rdepends --installed libssl3

Lists installed packages that depend on a given package.

Before I remove a library, I want to know who still uses it. The reverse dependency list answers that.

apt-cache rdepends --installed libssl3
apt-cache rdepends --installed --no-recommends libssl3

Without a filter, rdepends lists every package in the archive that depends on the name, which can be hundreds of lines. --installed narrows it down to packages on your machine. Add --no-recommends to hide the packages that only recommend it. The output is the opposite of apt-cache depends. A simulated removal with apt remove -s shows the same thing from the other side.

Further reading: apt-cache manual page

More Apt tips sudo apt-mark minimize-manual apt list '~c' grep -E ' (install|upgrade|remove) ' /var/log/dpkg.log | tail -o Dpkg::Options::="–force-confold" upgrade sudo apt-get -d -y full-upgrade All Apt tips (42) All topics

Link