Skip to main content

Command Palette

Search for a command to run...

🚀 Day 7: Understanding package manager and systemctl

Updated
•3 min read
🚀 Day 7: Understanding package manager and systemctl
T

As a DevOps Engineer, I'm passionate about building and maintaining robust, efficient, and scalable infrastructure to enable seamless software delivery. With a strong foundation in C/C++, Linux, and a toolkit that spans AWS, Jenkins, Docker, Nagios, Kubernetes, YAML, Ansible, Terraform, Bash Scripting, Git, and GitHub, I'm well-equipped to tackle the challenges of modern software development and deployment.

  1. What is a package manager in Linux?

A package manager keeps track of what software is installed on your computer, and allows you to easily install new software, upgrade software to newer versions, or remove software that you previously installed. As the name suggests, package managers deal with packages: collections of files that are bundled together and can be installed and removed as a group.

What is a package?

A package is usually referred to an application but it could be a GUI application, command line tool or a software library (required by other software programs). A package is essentially an archive file containing the binary executable, configuration file and sometimes information about the dependencies.

Different kinds of package managers..

There are several package managers available for different Linux distributions, and they vary in terms of package formats, command syntax, and package management philosophies. Here are some of the different kinds of package managers used in various Linux distributions:

1.Debian Package Manager: is the low-level package manager used in Debian and Debian-based distributions like Ubuntu. It deals with .deb package files.

2.Red Hat Package Manager (RPM): RPM package manager used in Red Hat-based distributions, including (RHEL), CentOS, and Fedora. It manages .rpm packages.

3.Advanced Package Tool (APT): APT is a higher-level package manager used in Debian/Ubuntu and its derivatives. Common APT commands include apt and apt-get

4.Yellowdog Updater, Modified (YUM) and Dandified YUM (DNF): YUM was the primary package manager for Red Hat-based systems, but it has been largely replaced by DNF. DNF is the default package manager in recent versions of Fedora, RHEL, and CentOS. Both YUM and DNF work with RPM packages.

Task1: You have to install docker and jenkins in your system from your terminal using package managers

*Installing Docker on Ubuntu:

  1. Update the package list: command: sudo apt update

  1. Install the necessary packages to allow apt to use a repository over HTTPS:

command:sudo apt install -y apt-transport-https ca-certificates curl software-properties-common

  1. Add the official Docker repository key:

command: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

  1. Add the Docker repository:

command:echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

  1. Update the package list again: Update the package list:

  2. Install Docker: command: sudo apt install -y docker-ce docker-ce-cli containerd.io

  1. Start and enable the Docker service: command: sudo systemctl start docker sudo systemctl enable docker

*Installing Jenkins on Ubuntu:

  1. Jenkins repository key:

  1. Add the Jenkins repository:

  1. Update the package list: command: sudo apt update

  2. Install Jenkins: command:sudo apt install -y jenkins

  3. Start jenkins Service : command:sudo systemctl start jenkins.service

Copy Password and put it on Jenkins dashboard:

  1. Jenkins Dashboard:-

Task2: systemctl and systemd:

systemctl is used to examine and control the state of “systemd” system and service manager. systemd is system and service manager for Unix like operating systems(most of the distributions, not all).

  1. check the status of docker service in your system:

  2. stop the service jenkins and post before and after screenshots

  3. read about the commands systemctl vs service

eg. systemctl status docker vs service docker status

More from this blog

Trushid's blog

90 posts

Proficient in DevOps, Cloud & SDLC including analysis, design. Scripting, testing, automation, version control, documentation and support