Table of Content:
✨ What is a package manager in Linux?
✨ What is a package?
✨ Different kinds of package managers
🧿Tasks:
✨Install docker and Jenkins in your system from your terminal using package manager.
✨SYSTEMCTL
✨SYSTEMD
✨Conclusion:
✨ What is a package manager in Linux?
A package manager is software that automates the process of installing, upgrading, configuring, and removing software packages within Linux systems. It ensures that software is consistently managed and maintained across the system. This eliminates the need for manual installations and updates, making it a vital component in the Linux infrastructure.
✨ What is a package?
A package is an archive file containing everything needed to install a piece of software, including executables, configuration files, and dependencies.
✨ Different kinds of package managers
There are various types of package managers used in different Linux distributions:
apt (for Debian-based systems like Ubuntu):
sudo apt update sudo apt install package_name sudo apt remove package_name
yum (for Red Hat-based systems like CentOS):
sudo yum install package_name sudo yum remove package_name
dpkg (low-level for Debian-based systems):
sudo dpkg -i package.deb sudo dpkg -r package_name
RPM (for Red Hat-based systems):
sudo rpm -ivh package.rpm sudo rpm -e package_name
These package managers facilitate the installation, removal, and management of software packages on Linux distributions, catering to the specific needs and package formats of each distribution family.
🧿Tasks:
✨Install docker and Jenkins in your system from your terminal using package manager.
✍️Docker Installation(Step by Step process):
Update packages:
sudo apt update sudo apt-get install docker.io
Check Docker status:
sudo service docker status
Enable Docker on boot:
sudo systemctl enable docker
✍️Jenkins Installation (Step by Step process):
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
✨systemctl and systemd :
systemctl is a command-line tool to control systemd, the system and service manager for Linux.
Common systemctl
commands:
Start a service:
sudo systemctl start service_name
Stop a service:
sudo systemctl stop service_name
Restart a service:
sudo systemctl restart service_name
Enable a service on boot:
sudo systemctl enable service_name
Check service status:
sudo systemctl status service_name
systemd manages system services and handles system events. Services are defined as units in systemd
(e.g., *.service
, *.socket
).
🌟 Conclusion
Linux package managers simplify software management. Mastering systemctl
and systemd
provides robust control over system services, ensuring efficient management and monitoring.
Happy Learning! 😊