# Understanding package manager and systemctl

### What is a package manager in Linux?

A package manager is like a smart helper that makes installing and updating programs on your computer easy. It's like a digital store where you can find and download software easily.

### Different kinds of package managers

**RPM (Redhat Package Manager** )

RPM is a package managing system (a collection of tools to manage software packages). RPM is a powerful software management tool for installing, uninstalling, verifying, querying, and updating software packages.

**YUM (Yellowdog Updater Modified)**

It is an open-source and popular command line package manager that works as an interface for users to RPM. An older version of DNF is used in some Red Hat-based systems.

**APT (Advanced Package Tool)**

This is found in Debian and Ubuntu-based systems. It handles updates and keeps your software up-to-date automatically. APT is like a friendly guide that helps you find and install software

**DNF (Dandified Yum)**

It is used in Fedora and Red Hat-based systems. DNF is designed to make installing, updating, and removing software on your system easier and more efficient.

## Task- 1 You have to install docker using package managers

Docker Installation:

For Debian/Ubuntu-based distributions (APT)

```basic
apt install docker
```

For Red Hat/CentOS-based distributions(Yum)

```basic
yum install docker
```

For fedora-based distributions (DNF)

```basic
dnf install docker
```

## Task- 2 You have to install Jenkins using package managers

Jenkins Installation

For Debian/Ubuntu-based distributions (APT)

```basic

wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo gpg --dearmor -o /usr/share/keyrings/jenkins.gpg

sudo sh -c 'echo deb [signed-by=/usr/share/keyrings/jenkins.gpg] http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'

sudo apt install jenkins
```

For Red Hat/CentOS-based distributions(Yum)

```basic
sudo  curl --silent --location http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo | sudo tee /etc/yum.repos.d/jenkins.repo

sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key

sudo yum install jenkins
```

For fedora-based distributions (DNF)

```basic
sudo wget -O /etc/yum.repos.d/jenkins.repo     https://pkg.jenkins.io/redhat-stable/jenkins.repo 

sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io-2023.key

sudo dnf install jenkins
```

## systemctl and systemd

**Systemd :**

Systemd is a special software program that manages how your computer starts up, operates, and shuts down.

**Systemctl :**

Systemctl is a powerful tool in Linux that allows you to manage and control various services on your computer.

## Task -3 check the status of docker service in your system

```basic
systemctl status docker
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690288547759/72982cbf-0ceb-4b85-a14b-69a6b5bedb8f.png align="center")

## Task -4 stop the service jenkins:

```basic
systemctl status jenkins
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690289238590/aa753c40-c95a-483d-848a-e7e613709f07.png align="center")

```basic
systemctl stop jenkins
systemctl status jenkins
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690289295210/da1f85ba-6d1a-4501-92ec-99e585e1aaa7.png align="center")
