Day - 7 DevOps challenge

Day - 7 DevOps challenge

Understanding package manager and systemctl

✔️ What is a package?

In Linux, a package is a bundled collection of files that make up a software application or library. Packages are typically distributed in a compressed format and contain all the necessary files for the software to run. They often include executable files, configuration files, documentation, and dependencies. Packages are managed by the package manager, which handles their installation, removal, and updates. Packages enable efficient and organized software distribution and management on Linux systems.

✔️ What is a package manager in Linux?

A package manager in Linux is a tool for managing software packages on a system. It simplifies the installation, removal, and updating of software. Package managers work with repositories, which store software packages. They handle dependencies, ensuring that required libraries and components are installed. Package managers provide a centralized and efficient way to manage software on Linux systems.

✔️ Different kinds of package managers:

  1. APT (Advanced Package Tool): Used by Debian and Ubuntu-based distributions, APT uses the .deb package format and features tools like apt-get and aptitude.

  2. YUM (Yellowdog Updater Modified): Employed by Red Hat, CentOS, and Fedora, YUM utilizes the .rpm package format and provides tools like yum and dnf.

  3. Zypper: Found in openSUSE and SUSE Linux Enterprise, Zypper uses the .rpm package format and supports features like package management and software repository management.

  4. Pacman: Utilized by Arch Linux and its derivatives, Pacman uses the .pkg.tar.xz package format and focuses on simplicity, speed, and minimalism.

  5. Portage: Used by Gentoo Linux, Portage is a source-based package manager that compiles software from source code according to system specifications.

  6. Snap: Supported by various Linux distributions, including Ubuntu, Snap provides a universal package format and manages software through sandboxing and automatic updates.

  7. DNF (Dandified YUM): Introduced in Fedora 18, DNF is the next-generation package manager for RPM-based distributions and aims to improve performance and resolve dependency issues.

  8. Pkgtool: Commonly used in Slackware Linux, Pkgtool is a simple command-line package manager that works with the .tgz package format.

  9. Eopkg: Used in Solus, Eopkg is a package manager that focuses on simplicity, dependency tracking, and system stability, utilizing the .eopkg package format.

    ✔️ Let's install docker in your system :

    step 1: Go to your terminal and update your system using sudo apt-get update

    step 2: Type sudo apt-get install docker.io then, the system asks you for your confirmation, as do you want to continue: type 'Y'

    step4: Let's check if docker is installed or not: by the command

    sudo docker --version

    got an output like this :

    ✔️ Let's install Jenkins in your system:

    Jenkins is an open-source automation server that automates the repetitive technical tasks involved in the continuous integration and delivery of software. Jenkins is Java-based, you have to install Java first.

    step 1: At first update your system using sudo apt-get update

    step 2: To install Java type : sudo apt install openjdk-11-jre

    step 3:to verify whether Java is installed or not type java --version

    you get an output as below:

step 4: type this command :

step 5: update your system again using sudo apt-get update

step 6: Type to install Jenkins sudo apt-get install jenkins

step 7: Type to verify jenkins --version jenkins is installed or not.

finally, your Jenkins server is set up.

✔️To check the status of Docker before and after while running in your system:

Type : sudo systemctl status docker

when docker is active/running:

When Docker is inactive/stopped :

To check the status of Jenkins before and after while running in your system:
Type sudo service jenkins status

when Jenkins is active and running:

when jenkins is stopped/inactive

systemctl and service is generating the same output but there are some differences between them.

let's see what are the difference b/w them :

FeaturesSystemSystemctl
Init SystemResult of the classic init system used in systemd machinesA newer superset of commands that are built on top of the SysV architecture
PortabilityWrapper function thus can run on any Linux distro for architecture.Cannot run on non-SysV systems, particularly older devices
FunctionalityExtra error checks and data validation before the command is sent to be executedMore powerful commands that can do more than what simple system commands do

Thank you so much for reading.

Follow me on LinkedIn to see interesting posts like this : )

linkedin.com/in/prabir-kumar-mahatha-6a0025..