# Day 7 - Simplifying Software Management on Linux: A Guide to Package Managers and Systemctl (Dec 3, 2023)

**Introduction:** Managing software on a Linux system involves the use of package managers and tools like systemctl. In this guide, we'll explore the basics of package managers and demonstrate how to install Docker and Jenkins using package managers on Ubuntu and CentOS. Additionally, we'll delve into the functionalities of systemctl and compare it with the traditional 'service' command.

**Understanding Package Managers:** In the Linux ecosystem, a package manager is a crucial tool that simplifies the installation, removal, upgrade, configuration, and management of software packages. Packages, in this context, refer to applications, whether they are GUI applications, command line tools, or software libraries essential for other programs. These packages are archive files containing binaries, configuration files, and sometimes dependency information.

Different Linux distributions adopt various packaging systems, each with its own set of package managers. For instance, RPM-based distributions like CentOS use Yum and DNF, while Debian-based systems like Ubuntu utilize apt-get and aptitude.

**Installing Docker and Jenkins:**

*On Ubuntu:* To install Docker and Jenkins on Ubuntu, open the terminal and use the following commands:

```plaintext
sudo apt-get update
sudo apt-get install docker.io
sudo apt-get install jenkins
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1701686168312/e0b54d21-fa30-4113-9ae7-32dc752da1f3.png align="center")

*On CentOS:* For CentOS, you can use the Yum package manager:

```plaintext
sudo yum install docker
sudo yum install jenkins
```

These commands will download and install Docker and Jenkins along with their dependencies.

**Understanding Systemctl and systemd:** Systemctl is a command-line tool used to examine and control the state of the "systemd" system and service manager. Systemd, in turn, is a comprehensive system and service manager for Unix-like operating systems. It has become the standard initialization system for most Linux distributions.

**Systemctl Tasks:**

*Check Docker Service Status:* To check the status of the Docker service, use the following command:

```plaintext
systemctl status docker
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1701686314184/afcc593d-ea2e-4299-86aa-9c983a0737f7.png align="center")

*Stop Jenkins Service:* To stop the Jenkins service, use the command:

```plaintext
sudo systemctl stop jenkins
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1701686299507/5d754017-b2a2-4a02-aab4-93de421be5f9.png align="left")

*Compare systemctl vs service:* The 'systemctl' and 'service' commands both manage services, but 'systemctl' is more feature-rich and is compatible with the modern 'systemd' init system. For instance:

```plaintext
systemctl status docker
service docker status
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1701686283676/7ae62e0a-a895-4350-a6b7-bab8a7ad080f.png align="center")

The 'systemctl' command provides more detailed information and additional control options compared to the traditional 'service' command.
