Taco Steemers

A personal blog.

Notes on apt (the package manager)

How can we search which packages exist?

apt search <search term>

... where we replace with our search term.

Combine it with grep to filter the results.

How can we find out more about a package?

list information about a package, such as the version number and description

apt show <package name>

... where we replace with the actual package name.

How can we find out if a package has been installed through apt?

We can use apt list --installed . This command does not use administrator rights.

Let's try:

$ apt list --installed | grep mariadb
$

No result. Apparently we don't have MariaDB installed.

$ apt list --installed | grep mysql
libmysqlclient20/bionic-updates,bionic-security,now 5.7.33-0ubuntu0.18.04.1 amd64 [installed]
mysql-common/bionic,bionic,now 5.8+1.0.4 all [installed,automatic]
$

The results show that we do have MySQL installed.

Updating, upgrading packages and upgrading the distribution

Updating and upgrading:

apt update
apt upgrade

Upgrading packages should be safe. Upgrading your distribution may have more risk of ending up with a broken operating system. Make sure that you have working backups or a system restore image and some time - for fixing whatever broke - or reinstalling and restoring from backup - or restoring from a system restore image

apt dist-upgrade