# Day 7 - Task: Understanding Package Manager and Systemctl

# **💡**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 line tool like apt-get or pacman.

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

# **💡**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. **Install Docker and Jenkins:**
    

Install Docker and Jenkins on your system from your terminal using package managers.

**First-Installing Docker**

Update the package list and install required packages:

```bash
sudo apt update
sudo apt upgrade -y
```

install docker

```bash
sudo apt-get install docker.io
```

Check Docker installation:

```bash
   sudo systemctl status docker
```

**Installing Jenkins**

```bash
   sudo apt update
```

Install Jenkins:

```bash
sudo wget -O /etc/apt/keyrings/jenkins-keyring.asc \
  https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
echo "deb [signed-by=/etc/apt/keyrings/jenkins-keyring.asc]" \
  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins
```

Start Jenkins:

```bash
   sudo systemctl enable jenkins
   sudo systemctl start jenkins
   sudo systemctl status jenkins
```

Note:

* First, check whether JAVA is installed or not.
    
    ```bash
       java -version
    ```
    

# Systemctl and Systemd

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

2. ### **Check Docker Service Status:**
    
    Check the status of the Docker service on your system (ensure you have completed the installation tasks above).
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748882588208/2da4c3d7-2f8d-405a-b872-eafe36103b6d.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748882607888/b7dc561f-c58b-48cd-af96-c08345d9407f.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748882626970/b794990c-3f31-4f42-b365-9ee1ff09c844.png align="center")
    
    3. ### **Manage Jenkins Service:**
        
    
    Stop the Jenkins service and post before and after screenshots
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748882671375/0f99d4b5-6a3f-4143-8e67-76124d07ddea.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748882685269/070b392c-bc14-4cb9-97e2-b54776bce34d.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748882702907/f002f850-aeb2-49b4-8270-a83468273d46.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748882786069/22fa219f-d80b-4297-86df-18b5977c95a4.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748883766137/f7f67b8d-639c-44dc-8a74-f0f7730fcfc4.png align="center")
    
    4. ### **Read About Systemctl vs. Service:**
        
    
    Both are commands you use in Linux to **start, stop, check, or manage services** — like web servers (e.g., Apache), databases (e.g., MySQL), or background jobs.
    
    ### What’s the difference?
    
    | `service` | `systemctl` |
    | --- | --- |
    | Old way of doing things | Newer, modern way |
    | Works on older systems | Works on modern systems (like Ubuntu 20.04, CentOS 7+) |
    | Simple, but limited | Powerful and gives more control |
    
3. ### **Enable and Disable Services:**
    

Use systemctl to enable Docker to start on boot and disable Jenkins from starting on boot.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748882815193/8cb4dfbe-caa4-4a14-a1ca-4df86ff73bca.png align="center")

6. ### **Analyze Logs:**
    
    Use journalctl to analyze the logs of the Docker and Jenkins services. Post your findings.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748882835074/9c455b6e-9ec6-4cba-a18d-e76259595c1d.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1748882851454/65da88ac-bfc7-484f-afc7-40f99f545fce.png align="center")
    
    ***📚 Happy Learning :)😊***
