Introduction to Package Managers and systemctl in Linux (original) (raw)

Last Updated : 19 May, 2026

Package managers and systemctl are essential tools in Linux used to manage software and control system services. Together, they help users install applications, handle dependencies, and start, stop, or monitor services efficiently.

Package Manager Architecture

A package manager interacts with the user system, repositories, packages, metadata, and dependencies to install and manage software.

1

Package Manager Working

1. User System

The user system is where commands are executed by the user.

2. Package Manager

The package manager acts as the central controller.

**Examples:

3. Repository

A repository is a remote or local storage location that contains software packages.

**Examples:

4. Metadata

Metadata contains information about the packages.

5. Packages

Packages are the actual software files.

**Examples:

6. Package Dependencies

Dependencies are additional packages required for software to work properly.

Most Widely used Package Managers

1. APT (Advanced Package Tool):

APT (Advanced Package Tool) is a powerful and widely used package manager in the Linux world. It's the default package manager for Debian-based distributions, including Debian itself, Ubuntu, and Linux Mint.

Basic commands in APT:

1. Installing a package:

sudo apt install package-name

2. Updating the package list:

sudo apt update

3. Upgrading packages:

sudo apt upgrade

4. Removing a package:

sudo apt remove package-name

5. Searching for packages:

apt search package-name

2. DNF (Dandified YUM) Package Manager

DNF is the successor to YUM and is now the recommended package manager for Red Hat based distributions. It provides a more modern and user-friendly experience. The syntax and commands for dnf are similar to yum.

Basic commands in DNF

1. Installing a package:

sudo dnf install

2. Updating packages****:**

sudo dnf upgrade

3. removing packages****:**

sudo dnf remove

4. searching for a package****:**

sudo dnf search

3. Pacman

Pacman is the package manager used in Arch Linux and its derivatives, such as Manjaro. Arch Linux is known for its simplicity, flexibility, and rolling-release model, and Pacman is a vital component that makes managing software on Arch-based systems efficient. In this section, we'll explore Pacman, its commands, and provide examples of its usage.

Basic commands in Pacman

1. Installing a package:

sudo pacman -S package-name

2. Updating the package list and upgrading packages:

sudo pacman -Syu

3. Removing a package:

sudo pacman -R package-name

4. Querying package information:

pacman -Q package-name

4. Zypper:

Zypper is the default package manager used in openSUSE and its derivatives. It plays a critical role in managing software packages on these Linux distributions. Zypper is known for its efficiency and robust dependency resolution capabilities. In this section, we will delve into Zypper, its commands, and provide examples of its usage.

Basic commands in Zypper

1. Installing a package:

sudo zypper in package-name

2. Updating packages:

sudo zypper up

3. Removing a package:

sudo zypper rm package-name

4. Searching for packages:

zypper se package-name

5. DPKG (Debian Package Manager):

DPKG (Debian Package Manager) is a fundamental package management tool for Debian-based Linux distributions, including Debian itself, Ubuntu, and their derivatives.

Basic commands in DPKG

1.Installing a package from a .deb file:

sudo dpkg -i package.deb

2. Removing a package:

sudo dpkg -r package-name

3. Querying package information:

dpkg -l | grep package-name

systemctl in Linux

systemctl is the primary command-line interface for interacting with systemd. It provides a wide range of functions for managing services, viewing their status, and controlling the system's behavior. Let's explore some of the most common systemctl commands and their usage.

Basic systemctl Commands

1. Starting and Stopping Services

To start a service, you use the start command. For example, to start the Apache web server:

sudo systemctl start apache2

12

start service

To stop a service, use the stop command:

sudo systemctl stop apache2

13

Stop service

2. Enabling and Disabling Services

To ensure a service starts at boot, you enable it using the enable command:

sudo systemctl enable apache2

To disable a service from starting at boot:

sudo systemctl disable apache2

15

Disable services

3. Restarting and Reloading Services

To restart a service:

sudo systemctl restart apache2

To reload configuration files without stopping the service:

sudo systemctl reload apache2

4. Checking Service Status

To view the status of a service, use the status command:

systemctl status apache2

16

Checking status

This provides information about whether the service is running, its process ID, and recent log entries.

5. Viewing Active Units

You can list all currently active units (services, sockets, targets, etc.) with:

systemctl list-units --type=service

17

currently active units

Package managers and systemd, with its systemctl command, are indispensable tools for Linux system administrators and users. Package managers streamline software management, making installation, updates, and removals a breeze while resolving dependencies.

Also Check: