A reboot is recommended after kernel updates.
How to manage software packages on Linux
Packages are archives containing binaries, configuration files, and dependency information for software. A package manager automates software installation, upgrades, and configuration, keeping track of all installed packages and their versions.
This guide covers package management on the following distributions:
- Debian
- Ubuntu
- CentOS
- AlmaLinux
Before you startLink to this anchor
To complete the actions presented below, you must have:
Debian and Ubuntu: Using APTLink to this anchor
On Debian and Ubuntu, use the APT (Advanced Package Tool) package manager.
How to update repositoriesLink to this anchor
Update your package information with the following command:
sudo apt-get update
How to update packagesLink to this anchor
After updating your repositories, upgrade your packages:
sudo apt-get upgrade
How to search for packagesLink to this anchor
Search for specific software packages, such as MariaDB:
apt-cache search mariadb
How to install a packageLink to this anchor
Install a package, for example, MariaDB server:
sudo apt-get install mariadb-server
How to keep your system tidyLink to this anchor
Remove unused dependencies:
sudo apt-get autoremove
How to uninstall a packageLink to this anchor
Remove a package, for example, MariaDB server:
sudo apt-get remove mariadb-server
To also remove all dependencies installed with the package:
sudo apt-get autoremove mariadb-server
CentOS and AlmaLinux: Using YUM/DNFLink to this anchor
On CentOS and AlmaLinux, use the YUM (Yellowdog Updater, Modified) or DNF (Dandified YUM) package manager.
How to update repositoriesLink to this anchor
Update your package information with the following command:
sudo yum update
Or, if using DNF:
sudo dnf update
How to update packagesLink to this anchor
After updating your repositories, upgrade your packages:
sudo yum upgrade
Or, if using DNF:
sudo dnf upgrade
How to search for packagesLink to this anchor
Search for specific software packages, such as MariaDB:
sudo yum search mariadb
Or, if using DNF:
sudo dnf search mariadb
How to install a packageLink to this anchor
Install a package, for example, MariaDB server:
sudo yum install mariadb-server
Or, if using DNF:
sudo dnf install mariadb-server
How to keep your system tidyLink to this anchor
Remove unused dependencies:
sudo yum autoremove
Or, if using DNF:
sudo dnf autoremove
How to uninstall a packageLink to this anchor
Remove a package, for example, MariaDB server:
sudo yum remove mariadb-server
Or, if using DNF:
sudo dnf remove mariadb-server
To also remove all dependencies installed with the package:
sudo yum autoremove mariadb-server
Or, if using DNF:
sudo dnf autoremove mariadb-server