- 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.
- 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)
- Install Docker on Ubuntu/Debian Update your system:
sudo apt update
sudo apt upgrade -y
Check Docker status:
sudo service docker status
Enable Docker on boot:
sudo systemctl enable docker
- Jenkins Installation Step by Step Update packages:
sudo apt update
Install Java:
sudo apt install -y openjdk-11-jdk
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
Start and enable Jenkins
sudo systemctl start jenkins
sudo systemctl enable jenkins
Check Jenkins Status:
sudo systemctl status jenkins
systemctlis 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 usesystemd, it has become the default on many due to its powerful service and process management capabilities.Systemctl vs. Service
Here’s a simple explanation of systemctl vs. service:
What Is service?
- The
servicecommand is a traditional way to manage system services. - It works with System V init scripts (older systems).
- Example:
service docker status
What Is systemctl?
- The
systemctlcommand is the modern tool for managing services on systems usingsystemd, 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
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)