Table of contents
- What is a package manager in Linux?
- What is a package?
- Different kinds of package managers
- Tasks
- Task1: Docker Installation, Starting Docker, and Checking Docker Service Status Install Docker:
- Task2: Jenkins Installation, Starting Jenkins, and Checking Jenkins Service Status Install Jenkins:
- Task 3:Explanation of systemctl vs service:
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 package manager, you must understand what a package is.
What is a package?
A package is usually referred to 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 packaging system but 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.
RPM-based systems:
Yum: Used in CentOS and Fedora.
DNF: Next-gen replacement for Yum in Fedora.
DEB-based systems:
apt-get: Found in Debian, Ubuntu, and derivatives.
aptitude: Another option for Debian-based systems.
Arch Linux:
- Pacman: Handles package management tasks.
Gentoo Linux:
- Portage: Source-based package manager.
SUSE Linux:
- ZYpp: Utilized in openSUSE.
FreeBSD:
- pkg: Binary package manager for FreeBSD.
Each package manager is tailored to its respective distribution, offering commands and features suited to its system's needs.
Tasks
Task1: Docker Installation, Starting Docker, and Checking Docker Service Status Install Docker:
sudo apt-get install docker.io
Start Docker:
sudo systemctl start docker
Check Docker Service Status:
sudo systemctl status docker
Stop Docker Service:
sudo systemctl stop docker
Check Docker Service Status Again:
sudo systemctl status docker
Task2: Jenkins Installation, Starting Jenkins, and Checking Jenkins Service Status Install Jenkins:
sudo apt-get update
sudo apt-get install openjdk-8-jdk
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
Start Jenkins:
sudo systemctl start jenkins
Check Jenkins Service Status:
sudo systemctl status jenkins
Stop Jenkins Service:
sudo systemctl stop jenkins
Check Jenkins Service Status Again:
sudo systemctl status jenkins
Task 3:Explanation of systemctl vs service:
Explanation of systemctl vs service:
systemctl: It is a control utility for systemd, a system and service manager for Linux.
systemctl
is used to manage system services, including starting, stopping, restarting, enabling/disabling services, and querying service status. It provides more advanced functionalities and better integration with modern Linux systems.Example:
systemctl status docker
will display the status of the Docker service.service:
service
is a more traditional command-line tool for managing system services. It is used to start, stop, restart, and query the status of services. While it is still commonly used and available on many Linux distributions, it's being gradually replaced bysystemctl
in newer versions of Linux distributions.Example:
service docker status
will also display the status of the Docker service, but it's considered less modern compared tosystemctl
and may lack certain features