Day 7 Task: Understanding Package Manager and systemctl ๐Ÿ“ฆ๐Ÿ”ง

ยท

5 min read

Table of contents

No heading

No headings in the article.

What is a Package Manager in Linux? In the world of Linux, a package manager is like a magic wand that allows you to effortlessly install, remove, upgrade, configure, and manage software packages on your operating system. These packages may include applications, GUI tools, command-line utilities, or essential software libraries needed by other programs. Package managers come in different forms: some are graphical applications with user-friendly interfaces (like a software center), while others are command-line tools like apt-get or pacman.

๐Ÿ’ก Understanding Packages Before diving deeper into package managers, let's briefly understand what a package is. A package refers to a specific software component that can be installed on your system. These packages are essentially archive files containing the binary executables, configuration files, and sometimes information about the dependencies (other software components required to run the package).

Different Kinds of Package Managers Package managers vary based on the packaging system used in the Linux distribution. However, the same packaging system might have multiple package managers associated with it. For example, in the RPM packaging system, you'll find Yum and DNF as package managers. On the other hand, in the DEB packaging system, you have apt-get and aptitude as command-line-based package managers.

๐Ÿ“‹ Tasks: Installing Docker and Jenkins using Package Managers on Ubuntu and CentOS

Ubuntu: To install Docker and Jenkins on Ubuntu, follow these steps in your terminal:

  1. Install Docker: Use the package manager 'apt-get' to install Docker.

     sudo apt-get update
     sudo apt-get install docker.io
    
  2. Install Jenkins: Jenkins can be installed using the package manager 'apt-get' as well.

     sudo apt-get install jenkins
    

CentOS: To install Docker and Jenkins on CentOS, follow these steps in your terminal:

  1. Install Docker: Use the package manager 'yum' to install Docker.

     sudo yum install docker
     sudo systemctl start docker
     sudo systemctl enable docker
    
  2. Install Jenkins: To install Jenkins on CentOS, we need to add the Jenkins repository first.

     sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
     sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
     sudo yum install jenkins
     sudo systemctl start jenkins
     sudo systemctl enable jenkins
    

๐Ÿ” Systemctl and systemd Now, let's explore 'systemctl,' a powerful tool used to examine and control the state of the "systemd" system and service manager. 'systemd' is a system and service manager for Unix-like operating systems, which includes the majority of Linux distributions.

๐Ÿ“‹ Tasks:

Check Docker Service Status: To check the status of the Docker service in your system, run the following command:

systemctl status docker

Stop Jenkins Service and Post Screenshots: To stop the Jenkins service and capture screenshots before and after stopping it, follow these commands:

# Check Jenkins service status before stopping
systemctl status jenkins

# Stop Jenkins service
sudo systemctl stop jenkins

# Check Jenkins service status after stopping
systemctl status jenkins

๐Ÿง systemctl vs. service '๐Ÿ” systemctl status docker' and 'service docker status' essentially provide the same information about the Docker service's status. However, 'systemctl' is the modern and recommended way to manage services on systems using 'systemd.' The 'service' command is used on older systems that use the System V init system.

By utilizing 'systemctl,' you gain access to more advanced features and better integration with 'systemd.'

With these tasks completed, you now have a better understanding of package managers and how to use them to install Docker and Jenkins on both Ubuntu and CentOS systems. You've also learned about 'systemctl' and its advantages over the 'service' command when managing services.

๐Ÿ“ Day 8 Task: Basic Git & GitHub for DevOps Engineers ๐Ÿ™๐ŸŽฏ

What is Git? Git is a game-changer for the world of version control systems. It empowers you to track changes to files, coordinate collaboration among multiple people, and manage software development efficiently. Whether it's a simple configuration file or a complex software project, Git enables you to maintain a record of who made changes, when they made them, and what parts of the files were modified.

๐ŸŒ What is GitHub? GitHub is a web-based platform that provides hosting for version control using Git. As a subsidiary of Microsoft, GitHub integrates all the functionality of Git while offering its own set of features. Developers worldwide use GitHub to share, collaborate, and host open-source projects.

๐Ÿ“œ What is Version Control? Version control is a system that keeps a historical record of changes made to files or a set of files over time. It allows you to access previous versions, compare changes, identify the causes of issues, and more.

Types of Version Control Systems There are two main types of version control systems:

  1. Centralized Version Control Systems (CVCS): In CVCS, a central server stores all versions of a project's files. Developers "check out" files from the central server, make changes, and then "check in" the updated files. Examples include Subversion (SVN) and Perforce.

  2. Distributed Version Control Systems (DVCS): DVCS allows developers to "clone" an entire repository, including its entire version history. This means they have a complete local copy, including all branches and past versions. Developers can work independently and later merge their changes back into the main repository. Git, Mercurial, and Darcs are examples of DVCS.

๐Ÿ“‹ Task: Getting Started with Git and GitHub

  1. Install Git: If Git is not already installed on your computer, download it from the official website at https://git-scm.com/downloads and install it.

  2. Create a GitHub Account: If you don't have one, sign up for a free GitHub account at https://github.com/.

  3. Learn the Basics of Git: Watch beginner-friendly tutorials or read guides to grasp the fundamentals of Git. Understanding concepts like 'commit,' 'branch,' 'merge,' and 'pull request' is essential.

๐Ÿ‹๏ธโ€โ™€๏ธ Exercises:

  1. Create a Repository on GitHub and Clone It:

    • Log in to your GitHub account and create a new repository with a suitable name.

    • Clone the newly created repository to your local machine using the 'git clone' command.

  2. Make Changes and Commit:

    • Add a new file or modify an existing file within the cloned repository.

    • Use 'git add' to stage the changes and 'git commit' to save them with a descriptive commit message.

  3. Push Changes to GitHub:

    • Push the committed changes back to the repository on GitHub using 'git push.'

You've now accomplished Day 8's basic Git and GitHub tasks! You've set up Git, created a repository on GitHub

ย