Package Management in Different Linux Distributions
Linux distributions utilize distinct package managers for software installation, updating, and removal. Administrative (root) privileges are required for these operations.
CentOS / RHEL (yum)
The yum package handler is the standard tool for Red Hat-based distributions.
To install a network utility like curl:
sudo yum install curl
To verify if a package is present on the system:
yum list installed | grep curl
Ubuntu / Debian (apt)
Debian-based systems rely on the apt utility for repository management.
Installing the same utility:
sudo apt install curl
Confirming the installation:
dpkg -l | grep curl
Managing Services with Systemctl
systemctl serves as the primary interface to the systemd init system and service manager. It allows administrators to manipulate the runtime state of daemons and system targets.
Core Operations
Using sshd as a concrete example:
Initiate a daemon:
sudo systemctl start sshd
Terminate a daemon:
sudo systemctl stop sshd
Reload configuration or restart:
sudo systemctl restart sshd
Inspect current runtime status:
sudo systemctl status sshd
Boot Persistence
Enable automatic launch at boot time:
sudo systemctl enable sshd
Prevent automatic launch at boot time:
sudo systemctl disable sshd
System Overview
Display all active service units:
systemctl list-units --type=service
Verify the firewall daemon state (CentOS):
sudo systemctl status firewalld
Compatibility Constraints
systemctl only governs processes that possess a registered unit file within the systemd framewokr. Native system daemons are typically pre-rgeistered. Third-party applicasions may require manual unit file creation if they do not automatically deploy one during installation.