LFCS Admin Exam preparation guide series, main page can be found here.
This post is part of the Operation of Running Systems from the domain competency list for the exam. The full list can be found in the link above paragraph or the Linux Foundation page here.
As an Operating System, Linux needs to be updated and upgrade from time to time. Debian / Ubuntu provides few tools to keep our OS up to date and applications current.
dpkg is a package manager for the Debian system, a low-level tool to install, remove, build, and manage the packages. Using this tool to install the package will not perform a dependency check. dpkg is entirely controlled from command line parameters. dpkg maintains usable information about the available packages.
We can use the dpkg -l command to list out all packages installed on the system.
aptitude id Debian package interface, which provides a command-line frontend to install, upgrade, remove, and get information about .deb packages. aptitude tool will help us to check if the new software we are trying to install has any dependency and it will download and install at the same time. We can use this tool both as a command tool and as well as access its interactive interface. This tool is not installed by default on Ubuntu OS. We can install it by running sudo apt-get install aptitude. When running aptitude we need elevated access and we should use sudo before the command. We can navigate this tool by using the keyboard arrows, selecting the package we want, and pressing Enter will display more detailed information about the package.
apt / apt-get
apt / apt-get provides a command-line interface to install, upgrade, remove, and display information about packages. This tool will help us to perform a dependency check. We need to run this command in elevated privileges by using sudo in front of it. When we want to check if our system is up to date, we will run sudo apt update to review all current repository if there are any updates to packages installed on our system. After this command completes, we will see information about how many packages can be upgraded. If we want to check what packages will be upgraded we run sudo apt list –upgradable. Finally, we run sudo apt upgrade -y to upgrade all the packages, the -y option not to be prompt for confirmation.
We can use apt to search for packages by using a search operator and providing the package name, to find out more information about the package we use the show option.
apt /apt-get can be used to install and remove the packages, to install package run sudo apt install <package name>, we will be present with information about how many packages will be installed and how much space it will additionally use if we do not specify the -y operator we will be asked to type y to continue or n to cancel. When we decide that we don’t need the package anymore, we will run sudo apt remove <package name>, we will see similar info, how many packages will be removed, and how much disk space will be reclaimed. Removing package does not remove the dependency packages.
Thank you for reading, keep learning!!