Remove packages and clean up dependencies

This chapter describes how to remove packages from your system using apt. Two methods are available for this.

Remove packages with sudo apt remove

With sudp apt remove a package is removed from the system, but the configuration files in the file system that were created by the package are retained (e.g. in /etc). The advantage of this is that the configuration files can be reused at a later date and automatically adopted during a new installation.

Example:

sudo apt remove tf6100-opc-ua-server

Completely remove packages with sudo apt purge

With sudo apt purge the package and the associated configuration files are completely removed from the system. This method can be used to remove configurations from the system that are no longer required and are causing problems, for example. Complete reinstallations of packages without legacy issues are therefore possible

Example:

sudo apt purge tf6100-opc-ua-server

Notice : files modified or created by the administrator (e.g. log files or databases) can remain available.

Remove package dependencies with sudo apt autoremove

sudo apt autoremove is used to remove packages that were originally installed automatically to fulfill dependencies of other packages. These packages are deleted if they are no longer required because dependencies have changed or the corresponding packages have been uninstalled in the meantime.

The packages to be removed are displayed and you are asked for confirmation before execution. Check whether the list contains packages that you are still using even though they were only installed as a dependency of another package.