Day6/90daysofdevopschallenge-Understanding Package Manager and Systemctl
What is a Package Manager?
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. A package manager works with packages, data within archive files, and software distributions.
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 archive that contains software, its files, and information needed for installation and management. It simplifies software distribution and installation on Linux systems.
Functions of Package Manager:
A software package can be defined as an archive file combining a computer program and essential metadata for development. The system program could be within the source code that has to be built and compiled first.
Packages include metadata like the name of the software, description of its objective, dependency list, vendor, and version number essential for the software to properly run
Different kinds of package managers
Package Managers differ based on 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.
Task 1:
Docker
Steps to install docker using package managers:
sudo apt update sudo apt install docker.io -y
For Red Hat/CentOS-based distributions (using YUM):
sudo yum install docker
For Fedora (using DNF):
sudo dnf install docker
Start and Enable Docker Service: After installing Docker, start and enable the Docker service to ensure it starts automatically upon system boot.
sudo systemctl start docker
sudo systemctl enable docker
docker --version
Jenkins
Steps to install Jenkins using Package Manager:
java --version
sudo apt install -y openjdk-17-jdk
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm — import https://pkg.jenkins.io/redhat/jenkins.io.key
Update the system repository one more time. Updating refreshes the cache and makes the system aware of the new Jenkins repository.
sudo apt update
sudo yum install jenkins
Recommended by LinkedIn
sudo systemctl start jenkins
sudo systemctl enable jenkins
sudo systemctl status jenkins
Jenkins will be available on port 8080 by default. we should open port 8080 in our security group.
Now, Copy the path given there and get a password from the server.
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
systemctl and systemd:
systemctl is the command line tool used to control and manage the systemd system and service manager. It provides various commands to start, stop, restart, enable, and disable services, as well as other functionalities such as inspecting the status of services, displaying log messages, and managing system-level settings and configurations.
Here are a few examples of common tasks that can be performed using systemctl:
systemd is a Linux init system and system manager that is widely used in modern Linux distributions as the default init system. It provides a way to manage and control the various services that run on a Linux system, as well as other system-level functionality.
Task2
service docker status
sudo systemctl stop docker
sudo systemctl status jenkins
systemctl stop jenkins
Read about the commands systemctl vs service
systemctl and service are both tools used to manage and control services on a Linux system. However, they have some differences:
Thank you, for your precious time in reading the article/blog.
Happy Learning