Understanding package manager and systemctl

Understanding package manager and systemctl

Package management

Package management in Linux can be defined as the way of installing, updating and uninstalling the software from the system. It plays an important role in Linux as it is responsible for the secure system and updation of the software. Package management in Linux and be easily defined by the following diagram:

Package Manager

A Package manager in Linux can be defined as a tool that helps in managing the software packages. Package managers perform different operations to manage software packages. Operations that are performed by the package manager are listed as follows:

  • Installation

  • Removal

  • Updation

  • Dependency resolution

  • Repository Management

Installation of Docker with APT

Step 1: First we need to update the package list by opening the terminal. It is needed to ensure the latest versions.

Step 2: Now we will install docker, We can install docker by the following command:

Step 3: Now to confirm that we have installed docker we will run the following command:

Install Jenkins with APT

Step 1: First we need to check whether we have installed Java or not and to check this we will run the following command:

If you see Java version information then we have Java installed. If you do not get any version information you can install Java by running the following command Sudo apt install openjdk-17-jre .

Step 2: Now we will install Jenkins. We will use APT Package Manager to install Jenkins.

Step 3: Start and Enable Jenkins Once Jenkins is installed, we need to start the service and make sure it automatically starts whenever you boot up your system:

Step 4: Unlock Jenkins and Set Up Now, Let's access Jenkins through its web interface.

Now copy the password and paste the password to the Jenkins site. You now have Jenkins up and running on your system!

Task 1:

To check the Docker Status

Task 2:

Stopping Jenkins Service

Systemctl VS Service

systemctl:

  • systemctl is the primary command-line tool for controlling and managing services in Linux systems that use systems as the init system.

  • systemd is a system and service manager that provides advanced features for service management, logging, and system initialization.

  • systemctl allows you to start, stop, restart, enable, disable, reload, and check the status of services and other system units (like timers, sockets, etc.).

  • Syntax :

    systemctl [OPTIONS] COMMAND [UNIT]

service:

The service command in Linux is a legacy tool used for controlling system services on older Linux distributions that use the traditional System V init system.

Syntax:

service <service-name> <action>

[action]: The action represents what you want to do with the service. Common actions include:

  • start: Start the specified service.

  • stop: Stop the specified service.

  • restart: Restart the specified service.

  • reload: Reload the configuration of the specified service without stopping it.

  • status: Show the current status of the specified service.

    Thanks For Reading!

    #90daysodfdevops #TrainWithShubham #devops

    Let's connect on Linkedin- https:linkedin.com/in/piyush-verma-8b1b4426a