Understanding package manager and systemctl :
1. What is package manager in Linux ?
In Linux Package Managers are essentially software applications that help users to: Search, Download, Install, Remove and Update software applications on their computer operating system. These can be either Command Line tools or a complete Graphical User Interface application. Experienced Linux users will very rarely download software from websites or any other location. The primary reasons for this included aspects as ease of use, security and the fact that most Linux distributions have a list of sources where users can download free open source software packages.
2. What is a package?
All software on a Linux system is divided into packages that can be installed, uninstalled or upgrade. In Linux distributions, a “package” refers to a compressed file archive containing all of the files that come with a particular application.
3. Different kinds of package managers ?
In the Linux operating system, there are many package managers to choose from, each with its own set of features and capabilities. Some of the most popular package managers for Linux include :
Tasks :
1. You have to install docker and jenkins in your system from your terminal using package managers.
First we need to check 'docker' is install or not. By checking ‘docker’ command from command prompt.
Here we are use apt package manager, because the server is Ubuntu.
Use "sudo apt install docker.io" command for installation of docker.
after that press 'y' and the docker will be installed in our system.
For check the status of docker use "sudo systemctl status docker" command.
If it is inactive, then start with the help of "sudo systemctl start docker" command.
The version of Jenkins included with the default Ubuntu packages is often behind the latest available version from the project itself. To ensure you have the latest fixes and features, use the project-maintained packages to install Jenkins.
First, add the repository key to your system:
Recommended by LinkedIn
"wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key |sudo gpg --dearmor -o /usr/share/keyrings/jenkins.gpg"
The gpg --dearmor command is used to convert the key into a format that apt recognizes.
Next, let’s append the Debian package repository address to the server’s sources list:
"sudo sh -c 'echo deb [signed-by=/usr/share/keyrings/jenkins.gpg] http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list"
The [signed-by=/usr/share/keyrings/jenkins.gpg] portion of the line ensures that apt will verify files in the repository using the GPG key that you just downloaded.
After both commands have been entered, run apt update so that apt will use the new repository.
"sudo apt update"
Finally, install Jenkins and its dependencies:
"sudo apt-get install jenkins"
after that type 'y' and the jenkins will be installed.
Now that Jenkins and its dependencies are in place, we’ll start the Jenkins server.
now that Jenkins is installed, start it by using systemclt :
For stop the service of jenkins use "sudo systemctl stop jenkins" command.
4. systemctl vs service command ?
systemctl is part of the systemd system and service manager, which is responsible for controlling the startup, shutdown, and runtime processes of many of the system's services. systemctl is a powerful tool that allows you to start, stop, restart, enable, or disable system services, as well as check the status of a service or get a list of all available services on the system.
service is a legacy tool that was used on older Linux distributions to manage system services. It is still present on some modern distributions, but it has been superseded by systemctl on many systems. service is a simpler tool that only allows you to start, stop, or restart services, and does not have the same level of functionality as systemctl.
In general, it is recommended to use systemctl to manage system services on a Linux system, as it is a more powerful and feature-rich tool. However, if you are using an older distribution that does not have systemctl, you can use service as an alternative.
Thank you for reading! I hope you find this article helpful.