Day 7:Understanding package manager and systemctl

1)What is a package manager in Linux?

In simpler words, a package manager is a tool that allows users to install, remove, upgrade, configure and manage software packages on an operating system. The package manager can be a graphical application like a software center or a command lines tool like apt-get or Pacman.

You’ll often find me using the term ‘package’ in tutorials and articles, To understand package manager, you must understand what a package is.

2)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.

3)Different kinds of package managers

Based on the linux distro that you are using it will have a different package manager. Also a linux distro can have different package managers as well. Following is the list of linux distros and their respective package managers:

Debian and ubuntu => apt
CentOs and RHEL => yum, dnf

You have to install docker and Jenkins in your system from your terminal using package managers

To install docker and jenkins follow these steps

Now lets install docker

once installation starts; it asks if we want to continue; type ‘y’ and enter.

To check version of docker

Now lets Install Jenkins too :

After hitting error if you are getting this error in below screenshot . We need to install java first

Now if we are facing issue then lets install java first and after then then from the curl lets import all the jenkins package

The below code just copy paste it one by one in your terminal and if thet ask to contunue press Y or Yes

sudo apt install openjdk-17-jre

java -version

curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null

Now lets install Jenkins

Install Jenkins:

Now lets start the jenkins service as

To enable the Jenkins daemon to start on boot:

4)Difference in systemctl and systemd

systemd is a system and service manager for Linux systems that provides many powerful features for managing processes and system resources. systemctl is a command-line utility that is used to control and manage the systemd system and service manager.

With systemctl, you can start, stop, and restart services, enable and disable them to start at boot, and check the status of services. You can also use systemctl to view and manage system logs, configure system startup and shutdown, and set system-wide environment variables.

systemd gives us the systemctl commands suite which is mostly used to enable services to start at boot time. We can also start, stop, reload, restart and check status of services with the help of systemctl ; Whileas service command is a wrapper script that allows system administrators to start, stop, and check the status of services without worrying too much about the actual init system being used.

Did you find this article valuable?

Support Akshay Phadke by becoming a sponsor. Any amount is appreciated!