HAKATEMIA
04Management

Installing and managing programs

Easy10MIN

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

BASH
1sudo apt-get install package_name

This command downloads and installs the desired software or package.

Package removal

BASH
1sudo apt-get remove package_name

This removes the installed software, but not its configuration files.

Removing the package and deleting the configuration files

BASH
1sudo apt-get purge package_name

This command deletes the program and its configuration files.

Updating Packages

BASH
1sudo apt-get update
2sudo apt-get upgrade

The first command updates the database from local packages, and the second updates installed software to the latest available versions.

Checking Dependencies

BASH
1sudo apt-get check

Checks 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

BASH
1apt-cache search keyword

Searching for packages in the database based on the keyword you entered.

Viewing package information

BASH
1apt-cache show package_name

Displays information about a specific package.

Autoremove

BASH
1apt-get autoremove

Removes unnecessary packages that are no longer dependencies of any other package.

List of Installed Packages

BASH
1apt list --installed

Installing 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.

BASH
1dpkg -i package.deb

Package 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.

1 / 3
Hakatemia Pro

Learn to hack — start here

Hundreds of interactive courses, virtual labs and CTF challenges in your browser. Start a free trial — no card required.