Day 7 Task: Understanding package manager and systemctl

Day 7 Task: Understanding package manager and systemctl

Package Management

In Linux, package management refers to the process of installing, updating, and removing software packages on the system. It is a crucial aspect of Linux system administration, as it simplifies the management of software and ensures that the system stays up-to-date and secure. Linux distributions use package managers to handle software installation and dependency resolution.

Package Manager

A package manager is a software tool that simplifies the process of installing, updating, and removing software packages on a computer system. It automates the management of software packages by handling dependencies, versioning, and providing an organized repository of software.

The primary functions of a package manager include:

  • Package Installation

  • Package Update

  • Package Removal

  • Dependency Resolution

  • Repository Management

Installing docker with APT

Step 1: Update Your Package List Open a terminal by pressing Ctrl + Alt + T, and let's update our package list to ensure we get the latest versions:

Step 2: Install Docker Now, we can install Docker using the following command:

Step 3: Verify Docker Installation To confirm that Docker is up and running, run this command:

You should see the version number of Docker installed on your system.

Installing Jenkins with APT

Step 0: Check Java Installation To check if Java is already installed, open your terminal and run:

If you see the version information, great! You already have Java installed, and you can proceed to install Jenkins.

Step 1: Install Java If you need to install Java, use the APT package manager to install OpenJDK, which is the most popular Java version for Linux systems:

Step 3: Install Jenkins It's time for Jenkins to shine! Use the APT package manager to install Jenkins:

Step 4: 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 5: Unlock Jenkins and Set Up Now, let's access Jenkins through its web interface.

Copy the password and paste it into the Jenkins web page to unlock the magic of Jenkins!

Step 6: Jenkins Is All Yours! Follow the on-screen instructions to customize your Jenkins setup, choose your favorite plugins, and create your admin user.

Congratulations! You now have Jenkins up and running on your system!

Task 1

Check 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 systemd 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 systemd 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!

#devops#90DaysOfDevops#TrainWithShubham

Let's connect on Linkedin - linkedin.com/in/namya-khullar-7b5758200