Installing and managing programs
In this module, we will go through how to manage installed packages in a Linux environment and install or remove them.
In Debian-based operating systems, package management is handled through a package management system. Package management is responsible for installing, updating, removing software packages, and managing their dependencies. Ubuntu primarily uses the Advanced Package Tool (APT) system and its derived tools, such as apt-get and apt.
Key commands for package management
Installing the package
1sudo apt-get install package_nameThis command downloads and installs the desired software or package.
Package removal
1sudo apt-get remove package_nameThis removes the installed software, but not its configuration files.
Removing the package and deleting the configuration files
1sudo apt-get purge package_nameThis command deletes the program and its configuration files.
Updating Packages
1sudo apt-get update
2sudo apt-get upgradeThe first command updates the database from local packages, and the second updates installed software to the latest available versions.
Checking Dependencies
1sudo apt-get checkChecks if all dependencies are in order. Typically, one package/program utilizes other packages and programs. These are called dependencies because without the required packages, the program may not necessarily function.
Search for packages
1apt-cache search keywordSearching for packages in the database based on the keyword you entered.
Viewing package information
1apt-cache show package_nameDisplays information about a specific package.
Autoremove
1apt-get autoremoveRemoves unnecessary packages that are no longer dependencies of any other package.
List of Installed Packages
1apt list --installedInstalling the Package from .deb File
Sometimes you may not have access to the Internet, for example, and you may not be able to download the package you want in the usual way, so you can also install the package from a file if you can transfer it to the machine through other routes. These come in Debian-based systems in files named .deb and these can be installed, for example, as follows.
1dpkg -i package.debPackage management in the Debian operating system is efficient and helps keep your system up to date and secure. The APT system also manages package dependencies automatically, making software installation and updates relatively easy.
Learn to hack — start here
Hundreds of interactive courses, virtual labs and CTF challenges in your browser. Start a free trial — no card required.