Day 7: Understanding package manager and systemctl 📝

💬What is a package manager in Linux?

A package manager or package-management system is a collection of software tools that automates the process of installing, upgrading, configuring, and removing computer programs for a computer in a consistent manner.

💬What is a package?

A Package can be defined as a grouping of related types (classes, interfaces, enumerations and annotations ) providing access protection and namespace management. Programmers can define their own packages to bundle group of classes/interfaces

💬Different kinds of package managers

All Linux distributions have some form of a package manager. They all handle the same job, though:

  • Installing applications

  • Upgrading applications

  • Managing application dependencies

  • Removing applications

  • Handling OS updates

Depending on the Linux distribution you are using, it will have a different Linux package manager. Here's a quick list of each package manager for popular distributions:

Linux Distribution

Linux Package Manager

REHL

Yum

Ubuntu / Debian

Apt

Arch

Pacman

Gentoo

Portage

Zyper

Open Suse

💬What is systemctl and systemd ?

Systemd is the modern replacement for the legacy Linux initialization systems, System V (SysV) and Linux Standard Base init (LSB init). systemd owns PID 1, and is started directly by the kernel. All other processes are either started directly by systemd , or by one of its child processes.

Systemctl command manages both system and service configurations, enabling administrators to manage the OS and control the status of services. Further, systemctl is useful for troubleshooting and basic performance tuning.

  • Check the status of a service: systemctl status <service-name>

  • Start a service: systemctl start <service-name>

  • Stop a service: systemctl stop <service-name>

  • Restart a service: systemctl restart <service-name>

  • Enable a service: systemctl enable <service-name>

  • Disable a service: systemctl disable <service-name>

  1. systemctl is the newer tool and is used on systems that use the Systemd init system, which is now widely adopted as the default init system for many popular Linux distributions, including Fedora, Red Hat Enterprise Linux, and Ubuntu.

  2. service is the older tool and is used on systems that use the System V init system, which was the previous standard init system used in many popular Linux distributions.

  3. systemctl provides more advanced features compared to service, such as the ability to manage units, which are the basic building blocks of Systemd. This allows you to manage not just services, but also other system components, such as sockets, devices, and mount points, with a unified interface.

  4. service is limited to managing services only, and its syntax and options are not as advanced as those of systemctl.