Day 7 Task: Understanding Package Manager and systemctl

Welcome back to our Linux journey! In this article, we will explore two crucial aspects of managing your Linux system: package managers and systemctl. We will walk you through the process of installing Docker and Jenkins on Ubuntu and CentOS using package managers, and also explain the differences between systemctl and service commands.

What is a Package Manager in Linux?

A package manager is an essential tool for every Linux user. It simplifies the process of installing, removing, upgrading, configuring, and managing software packages on your operating system. Packages can be anything from graphical applications to command-line tools or software libraries. They typically include binary executables, configuration files, and information about dependencies.

Types of Package Managers
Linux has several package managers, and their availability often depends on the distribution you're using. Let's take a look at a few:

APT:

Used in Debian-based distributions like Ubuntu, APT is one of the most popular package managers. It includes tools like apt-get and aptitude for managing packages.

YUM/DNF:

Commonly used in Red Hat-based distributions like CentOS and Fedora, YUM (Yellowdog Updater, Modified) and DNF (Dandified YUM) are package managers for these systems.

Now, let's move on to the practical part of this article.
Installing Docker and Jenkins using Package Managers
Installing Docker on Ubuntu using APT

Open your terminal and execute the following commands:
sudo apt update
sudo apt install docker

Installing Docker on CentOS using YUM
For CentOS, use the following commands:
sudo yum install docker

Installing Jenkins on Ubuntu using APT
**Install Jenkins on Ubuntu with APT:
**sudo apt update
sudo apt install jenkins

Installing Jenkins on CentOS using YUM
On CentOS, use YUM to install Jenkins:
sudo yum install jenkins

Remember that these are basic installation commands. You might need to adjust configurations based on your specific requirements.

Understanding systemctl and systemd
systemctl is a powerful command that helps you examine and control the state of the "systemd" system and service manager. systemd is the default init system for most Unix-like operating systems, including many Linux distributions. It's responsible for managing system processes and services.

Using systemctl
Now, let's perform a couple of tasks with systemctl:

Check the status of the Docker service:
systemctl status docker
This command will display detailed information about the Docker service, including whether it's running or not.

Stop the Jenkins service:
sudo systemctl stop jenkins

systemctl and service are two different ways to manage services on your system. Here's how you can use them to check the status of the Docker service:

systemctl:
systemctl status docker

service:
service docker status

Both commands provide similar information about the status of the service. However, systemctl offers more advanced features for service management, making it a more powerful tool.

In conclusion, package managers simplify software installation and management on Linux, while systemctl and systemd are essential tools for controlling system services and processes. Keep exploring and learning more about these topics to become a proficient Linux user. Happy learning!

Did you find this article valuable?

Support DevOpsExplorer by becoming a sponsor. Any amount is appreciated!