Understanding package manager and systemctl :

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 :

  • apt : This is the default package manager on Debian, Ubuntu, and other Debian-based distributions. It is known for its simplicity and ease of use.
  • yum : This is an open source package management tool for install rpm based packages in linux system Yum overcome all drawback of rpm command. It allows users and system administrator to easily install, update, remove or search software packages on a systems.
  • dnf : This is the default package manager on Fedora and other Fedora-based distributions. It is an improvement over yum and is known for its speed and support for modularity.
  • rpm : This command is used to install package in Linux like (RHEL, CentOS and Fedora). rpm command use for standalone installation.
  • zypper : This is the default package manager on openSUSE and other SUSE-based distributions. It is known for its ability to handle multiple repositories and support for various package formats.
  • pacman : This is the default package manager on Arch Linux and other Arch-based distributions. It is known for its simplicity and speed, as it uses a simple, straightforward command-line interface and a single file for package management.

Tasks

1. You have to install docker and jenkins in your system from your terminal using package managers.

  • Installation of docker :

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.

No alt text provided for this image

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.

No alt text provided for this image

  • Installation of Jenkins :

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:

"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.

No alt text provided for this image

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 :

No alt text provided for this image

For stop the service of jenkins use "sudo systemctl stop jenkins" command.

No alt text provided for this image

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.

To view or add a comment, sign in

More articles by Nihal Apretwar

  • SQS (Simple Queue Service):

    What is SQS: Amazon Simple Queue Service (SQS) is a managed message queuing service technical professionals and…

  • Amazon S3: (Simple Storage service):

    What is S3: It provides object storage which is build for storing and recovering any amount of data from anywhere over…

  • Elastic Compute Cloud (EC2)

    What is EC2 : Amazon EC2 Provides secure and resizable compute capacity in the AWS cloud. You can use Amazon EC2 to…

  • IAM (Identity and Access Management)

    IAM : AWS identity access management is a web service that help you securely control access to AWS resources. You use…

  • AWS (Amazon Web Services)

    What is AWS ? AWS stands for Amazon web services. AWS is a secure cloud service platform that provides on-demand…

    1 Comment
  • Jenkins Declarative Pipeline:

    One of the most important parts of your DevOps and CICD journey is a Declarative Pipeline Syntax of Jenkins. Some…

  • Complete Jenkins CI/CD Project - Continued with Documentation

    I can imagine catching up will be tough so take a small breather today and complete the Jenkins CI/CD project from Day…

    6 Comments
  • Complete Jenkins CI/CD Project:

    Let's make a beautiful CI/CD Pipeline for your Node JS Application 😍 Task-01: Fork this repository: Create a…

    1 Comment
  • Jenkins Freestyle Project for DevOps Engineers:

    What is CI/CD? CI or Continuous Integration is the practice of automating the integration of code changes from multiple…

  • Getting Started with Jenkins:

    What is Jenkins? Jenkins is an open source continuous integration-continuous delivery and deployment (CI/CD) automation…

    2 Comments

Others also viewed

Explore content categories