Day 7 Understanding package manager and systemctl

Day 7 Understanding package manager and systemctl

Day 7 of #90daysofdevops

Hey Techies! Welcome to this blog

In this blog, we are going to discuss Understanding package manager and systemctl.

What is a package manager in Linux?

A package management system or package manager is a group of software tools. It automates the installation process, upgrading process, configuration process, and removal process of the computer programs for an operating system of the computer efficiently. A package manager works with packages, data within archive files, and software distributions.

What is a package?

A package is usually referred to as an application but it could be a GUI application, command line tool or a software library (required by other software programs). A package is essentially an archive file containing the binary executable, configuration file and sometimes information about the dependencies.

Different kinds of package managers:

Package Managers differ based on the packaging system but the same packaging system may have more than one package manager.

For example, RPM has Yum and DNF package managers. For DEB, you have apt-get, aptitude command line-based package managers.

Tasks

  1. You have to install Docker and Jenkins in your system from your terminal using package managers.

Update the package manager’s cache using the command:

 sudo apt-get update

You can refer to Install Docker

Install Docker using the command:

sudo apt-get install docker-ce

Verify that Docker is installed correctly by running the command:

docker --version

Installing Jenkins:

You can refer to Install Jenkins

Update the package manager’s cache using the command:

sudo apt-get update

Install Jenkins using the command:

sudo apt-get install jenkins

Start the Jenkins service using the command:

sudo systemctl start jenkins

Enable the Jenkins service to start on boot using the command:

sudo systemctl enable jenkins
  1. Write a small blog or article to install these tools using package managers on Ubuntu and CentOS.

For Ubuntu

APT (Advanced Package Tool) is a more advanced front-end for dpkg (Debian Package), the lowest-level package management system for Debian-based Linux distributions. APT is a powerful command-line package management tool providing an interface for better interactive usage. As with dpkg, APT can install, remove, and build packages. APT can be called a user-friendly package manager as it has a fairly simple syntax.

For Centos

Just as APT is a more advanced front-end for dpkg, YUM (Yellow Dog Updater) is the most popular choice as a front-end for RPM, the basic package management software for RHEL operating systems. YUM can perform such operations as searching for packages in repositories, installing packages from repositories, installing packages from .rpm files, updating the system, removing packages, and downgrading packages.

systemctl and systemd

systemctl is used to examine and control the state of “systemd” system and service manager. systemd is a system and service manager for Unix-like operating systems(most of the distributions, not all).

Check the status of the Docker service in your system:

sudo systemctl status docker

Stop the service Jenkins and post before and after screenshots

Before:

sudo systemctl status jenkins

After:

sudo systemctl stop jenkins

Read about the commands systemctl vs service

systemctl and service are both tools used to manage and control services on a Linux system. However, they have some differences:

  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 provider 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.

systemctl commands :

  • systemctl start <service-name>

  • systemctl stop <service-name>

  • systemctl restart <service-name>

  • systemctl enable <service-name>

  • systemctl disable <service-name>

  • systemctl status <service-name>

service commands :

  • service <service-name> start

  • service <service-name> status

  • service <service-name> stop

  • service <service-name> restart

Thank you so much for taking the time to read till the end! Hope you found this blog informative and helpful.

Feel free to explore more of my content, and don't hesitate to reach out if need any assistance from me or in case of you have any questions.

Happy Learning!

~kritika :)

Connect with me: linkedin.com/in/kritikashaw

Follow my Blog channel: hashnode.com/@kritikashaw