DEV Community

Udoh Deborah
Udoh Deborah

Posted on

Day 7 Task: Understanding Package Manager and Systemctl

  1. What is a Package Manager in Linux?

A package manager in Linux is a tool that automates the process of installing, updating, configuring, and removing software packages on a system.
Instead of downloading software manually and managing dependencies yourself, a package manager does it all for you, making system maintenance much easier.

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

A package is a compressed collection of files that make up a piece of software. This software could be:

  • A command-line tool (like curl or htop)

  • A graphical application (like Firefox)

  • A software library (used by other programs to function)

What’s Inside a Package?
A typical Linux package contains:

  • The binary executable (the program you run)

  • Configuration files (to customize behavior)

  • Dependency info (which other packages it needs to work)

  • Optional scripts (for installation or setup tasks)

  1. Install Docker on Ubuntu/Debian Update your system:
sudo apt update
sudo apt upgrade -y
Enter fullscreen mode Exit fullscreen mode

Check Docker status:

 sudo service docker status

Enter fullscreen mode Exit fullscreen mode

Enable Docker on boot:

 sudo systemctl enable docker

Enter fullscreen mode Exit fullscreen mode
  1. Jenkins Installation Step by Step Update packages:
  sudo apt update
Enter fullscreen mode Exit fullscreen mode

Install Java:

  sudo apt install -y openjdk-11-jdk

Enter fullscreen mode Exit fullscreen mode

Add Jenkins Repository and Install:

  wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
  sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
  sudo apt update
  sudo apt install -y jenkins

Enter fullscreen mode Exit fullscreen mode

Start and enable Jenkins

 sudo systemctl start jenkins
  sudo systemctl enable jenkins
Enter fullscreen mode Exit fullscreen mode

Check Jenkins Status:

  sudo systemctl status jenkins

Enter fullscreen mode Exit fullscreen mode
  1. systemctl is a command-line tool used to manage and check the status of services controlled by systemd — the system and service manager used by most modern Unix-like operating systems. While not all Linux distributions use systemd, it has become the default on many due to its powerful service and process management capabilities.

  2. Systemctl vs. Service

Here’s a simple explanation of systemctl vs. service:


What Is service?

  • The service command is a traditional way to manage system services.
  • It works with System V init scripts (older systems).
  • Example:
  service docker status
Enter fullscreen mode Exit fullscreen mode

What Is systemctl?

  • The systemctl command is the modern tool for managing services on systems using systemd, which most modern Linux distros use.
  • It offers more control, like starting, stopping, enabling on boot, reloading configurations, and checking logs.

  • Example:

  systemctl status docker
Enter fullscreen mode Exit fullscreen mode

Key Differences:

Feature service systemctl
Compatibility Works with SysV init Works with systemd
Verbosity Basic output More detailed status
Boot-time management No Yes (enable/disable)
Logging support Limited Integrated with journalctl
Modern usage Deprecated on newer systems Standard on modern Linux

📝 Summary:

Use systemctl for systems running systemd (most distributions like Ubuntu 16.04+, CentOS 7+, Debian 8+, etc.).
Stick to service only if you're working with older systems that haven't transitioned to systemd.

Top comments (0)