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 show tells you what a package is before you install it

Apt
~/tips/tip-apt-show-package-details

apt show nginx

Prints a package's description, size, dependencies and source repository.

A package name alone says little. Before you install something unfamiliar, apt show tells you what it is, how big it is and where it comes from.

Give it one or more package names:

apt show nginx
apt show -a nginx

The output has the version, the section, the maintainer, the installed size, the download size, the dependencies, a homepage and the full description. For a package you already have, it also shows APT-Manual-Installed: yes or no, which tells you whether you asked for it or it came along as a dependency, and APT-Sources, the repository it comes from.

By default you get the candidate version, the one apt would install. -a shows every version that your repositories offer, one block each, which is handy when a PPA or a backports repository has a newer one.

I’d look at three fields. Depends and Recommends show what else will come along, and Installed-Size keeps you from pulling 500 MB of desktop libraries onto a small server by accident.

The apt command prints a warning that its output isn’t stable for scripts. For a script, use apt-cache show, which prints the same kind of record without that warning. And it only knows what your package lists know, so run sudo apt update first if the lists are old.

Further reading: apt(8) manual page, apt-cache(8) 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