Day 7: Understanding Package Manager and Systemctl
What is a package manager:
A package manager in Linux is a software tool that helps users to install, remove, and manage software packages on their system. It automates the process of finding, downloading, and installing packages, as well as managing dependencies between packages.
There are several popular package managers available for Linux, including APT (Advanced Package Tool) used by Debian and Ubuntu, RPM (Red Hat Package Manager) used by Red Hat, CentOS, and Fedora, and Pacman used by Arch Linux. Each package manager has its own set of commands and syntax, but they all serve the same purpose of simplifying the process of installing and managing software on a Linux system.
Different kinds of package managers:
APT (Advanced Package Tool): APT is the default package manager used by Debian and its derivatives, such as Ubuntu and Linux Mint. It is a command-line tool that can install, update, and remove packages and their dependencies.
YUM (Yellowdog Updater Modified): YUM is the default package manager used by Red Hat, CentOS, and Fedora. It is a command-line tool that can install, update, and remove packages and their dependencies.
Docker Installation:
Update the package list:
sudo apt-get
Install the Docker package and its dependencies:
sudo apt-get install docker.io
Check the version of Docker:
docker --version
Installing Jenkins:
Step-1 Installing Java:
sudo apt-cache search openjdk
sudo apt-get install fontconfig openjdk-11-jre
Step-3 Add Jenkins Repository:
curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee \
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
Step-4 Add the Jenkins software repository to the source list and provide the authentication key:
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
https://pkg.jenkins.io/debian binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
1. Update the system repository one more time. Updating refreshes the cache and makes the system aware of the new Jenkins repository.
sudo apt update
Step-6 Run Installing Jenkins:
sudo apt-get install jenkins
To check if Jenkins is installed and running, run the following command:
sudo systemctl status jenkins
Step-8 Open a web browser and navigate to your server's IP address. Use the following syntax:
http://ip_address_or_domain:8080
Note: use your Instance Public id if you are using Instance as your Server:
Update the Security rules to allow inbound access to port 8080 of server:
Now go to web browser and access Jenkins:
Here It will ask for a password to log in as path of the password is highlighted in red colour just copy it and paste into your browser:
Now Just Login into Jenkins:
Create your username and Password:
Finally Jenkins setup is completed and the below screen will be visible!
systemctl and systemd:
Systemd is a system and service manager, while systemctl is a command-line utility for managing system services.
Systemd provides a suite of daemons, libraries, and utilities to manage system components, while systemctl is a specific tool within that suite.
Check the status of the docker service in your system:
Install Docker through command:
apt-get install docker -y
Check the status of the Docker service on your Linux system using the following command in the terminal:
systemctl status docker
To Stop the Service:
To stop the Docker service, you can use the following command in the terminal:
sudo systemctl stop docker
This will stop the Docker service immediately. If you want to prevent the service from starting automatically at boot, you can also disable it using the following command:
sudo systemctl disable docker
Check the status of Jenkins service in your system:
systemctl status jenkins
To Stop the Service:
To stop the Jenkins service, you can use the following command in the terminal:
sudo systemctl stop jenkins
Note: I have used APT PackageManager here to install both Jenkins and Docker
APT (Advanced Package Tool) is a package manager used in Debian-based Linux distributions like Ubuntu, Linux Mint, and Debian itself. APT provides a simple way to manage packages, which are collections of software files that can be installed and removed from the system.
---------- THANK YOU FOR READING :)-----------
Shubham Jangale