Skip to main content

Command Palette

Search for a command to run...

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

Updated
2 min read
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:

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

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

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:

systemctl status docker

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

sudo systemctl stop jenkins

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:

systemctl status docker
service docker status

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

More from this blog

DevOps Journey with M Hassan

174 posts

I am writing these blogs because I recently completed a comprehensive DevOps course where I gained in-depth knowledge of the topics mentioned. As I progressed through the course, I realized the importance of having a concise and accessible resource to revise and reinforce my understanding of each topic. Therefore, I decided to create cheat sheets in the form of blog posts. These cheat sheets will not only serve as a handy reference for myself but also benefit others who are also interested in mastering DevOps concepts. By documenting each topic and providing concise explanations, I aim to create a valuable resource that simplifies complex concepts and facilitates hands-on practice. This way, I can solidify my own understanding while helping others on their DevOps journey.