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.
Package Managers for Different Linux Distributions
Different Linux distributions use different package management systems. Here are the main ones:
Debian-based Distributions (Debian, Ubuntu, Linux Mint)
APT (Advanced Package Tool)
Commands:
apt
,apt-get
,aptitude
Package format: .deb
Example:
sudo apt install package-name
Package repository:
/etc/apt/sources.list
Red Hat-based Distributions (RHEL, CentOS, Fedora)
YUM/DNF (Yellowdog Updater Modified/Dandified YUM)
Commands:
yum
(older versions),dnf
(newer versions)Package format: .rpm
Example:
sudo dnf install package-name
Package repository:
/etc/yum.repos.d/
Arch Linux-based Distributions (Arch, Manjaro)
Pacman
Command:
pacman
Package format: .pkg.tar.xz
Example:
sudo pacman -S package-name
Package repository:
/etc/pacman.conf
SUSE-based Distributions (openSUSE, SLES)
Zypper
Command:
zypper
Package format: .rpm
Example:
sudo zypper install package-name
Package repository:
/etc/zypp/repos.d/
Common Package Management Operations:
Update package list:
Debian:
sudo apt update
RHEL:
sudo dnf update
Arch:
sudo pacman -Sy
SUSE:
sudo zypper refresh
Upgrade packages:
Debian:
sudo apt upgrade
RHEL:
sudo dnf upgrade
Arch:
sudo pacman -Syu
SUSE:
sudo zypper update
Remove packages:
Debian:
sudo apt remove package-name
RHEL:
sudo dnf remove package-name
Arch:
sudo pacman -R package-name
SUSE:
sudo zypper remove package-name
Search for packages:
Debian:
apt search keyword
RHEL:
dnf search keyword
Arch:
pacman -Ss keyword
SUSE:
zypper search keyword
How to Install Packages on Ubuntu and CentOS
Introduction
In this article, we will use Docker as examples for package installation on Ubuntu and CentOS Linux distributions.
Docker is an essential tools in the DevOps toolkit. Docker allows you to containerize applications, while Jenkins automates the building, testing, and deployment of software. This guide will walk you through installing both tools on Ubuntu and CentOS using package managers.
Installing Docker on Ubuntu and CentOS
On Ubuntu
Update the Package Index:
sudo apt-get update
Install Required Packages:
sudo apt-get update && sudo apt install docker.io
Verify Docker Installation:
sudo systemctl status docker
On CentOS
Update the System:
sudo yum update
Install Docker:
sudo yum install docker-ce
Start Docker:
sudo systemctl start docker
Enable Docker to Start at Boot:
sudo systemctl enable docker
Verify Docker installation:
sudo systemctl status docker
Conclusion
By following these steps, you can easily install Docker or any other package on Ubuntu, CentOS, or any Linux distribution. These tools will help streamline your development and deployment processes.
Follow for more useful content!🙃🙃