Day-07: Understanding package manager and systemctl
๐ฆ Installing Docker and Jenkins using Package Managers on Ubuntu and CentOS ๐ณ
Hello there, tech enthusiasts! Today, we're going to dive into the exciting world of package managers and learn how to install two powerful tools, Docker and Jenkins, on Ubuntu and CentOS systems using these package managers. ๐
๐ง Package Manager - What's That?
Before we start, let's quickly understand what a package manager is in Linux. ๐ค
A package manager is like a magic wand ๐ช for your operating system. It allows you to effortlessly install, remove, upgrade, configure, and manage software packages. Think of these packages as little gift boxes ๐ containing amazing applications, both graphical and command-line tools, or even software libraries that other programs need to function. These packages come bundled with the necessary binary executables, configuration files, and sometimes information about their dependencies. ๐
๐ผ Package - Unwrapping the Gifts
Alright, let's get a clearer picture of what a package exactly is. ๐ฆ
A package typically refers to an application, but it could be anything from a user-friendly GUI app to a powerful command-line tool or a software library essential for other programs. It's like a neatly wrapped present ๐, containing all the goodies required to get the software up and running on your system. This includes the executable program itself, configuration files, and sometimes crucial information about any other software it relies on. ๐
๐ฆ Different Kinds of Package Managers
Now, let's explore some popular package managers and the systems they're used on. ๐ฆ
RPM Package Manager: This one is used on various Linux distributions and has package managers like Yum and DNF. ๐ฝ๏ธ
DEB Package Manager: This system is commonly found on Debian-based distributions, and it features package managers like apt-get and aptitude. ๐งญ
Now, let's get our hands dirty and install Docker and Jenkins on Ubuntu and CentOS using these package managers! ๐งฐ
๐ณ Installing Docker with Package Managers ๐ณ
Ubuntu - Using apt-get ๐
To install Docker on Ubuntu, open up your terminal and type in the following command:
$sudo apt-get update
$sudo apt-get install docker.io
CentOS - Using yum ๐ฎ
For CentOS, use the yum package manager to install Docker:
$sudoy yum update
$sudo yum install docker
๐จ Installing Jenkins with Package Managers ๐จ
Ubuntu - Using apt-get ๐
To install Jenkins on Ubuntu, follow these commands:
$sudo apt-get update
$sudo apt-get install jenkins
CentOS - Using yum ๐ฎ
For CentOS, use the yum package manager to install Jenkins:
$sudo yum update
$sudo yum install jenkins
๐ systemctl and systemd - Managing Services ๐
Now that we have Docker and Jenkins installed, let's learn about systemctl, which helps us examine and control services managed by systemd. ๐ ๏ธ
systemd is the superhero that manages services on Unix-like operating systems (most of them, not all). It handles starting, stopping, and maintaining these services with ease. ๐ฆธโโ๏ธ
๐ Checking Docker Service Status ๐
To check the status of Docker service, simply enter the following command:
$systemctl status docker
๐ Stopping Jenkins Service ๐
Let's put Jenkins on pause for a moment. Use the following commands to stop the Jenkins service:
$sudo systemctl stop jenkins
๐ธ Before and After Screenshots ๐ธ
Take screenshots before stopping the Jenkins service and after stopping it, and witness the magical change! โจ
๐ systemctl vs service - The Showdown ๐
Now, let's get into a thrilling showdown of systemctl vs service! ๐
Both systemctl and service are used to control services, but systemctl is the newer, more powerful contender, while service is the traditional champion. ๐ฅ
To check the Docker status, use:
$systemctl status docker
๐ป vs ๐ฅ๏ธ
$service docker status
In this corner, we have systemctl with its detailed status report, and in the opposite corner, we have the service command with its compact display. ๐ฅ
Choose your fighter and unleash the power of service management! ๐ฅ๐ก๏ธ
There you have it, folks! We've explored the enchanting world of package managers, installed Docker and Jenkins on Ubuntu and CentOS, and discovered the might of systemctl and systemd. ๐
Remember, with package managers at your disposal, installing and managing software becomes as easy as a few magical commands! So go ahead, explore, and make the most of these powerful tools. Happy coding! ๐๐ฅ
I hope you enjoyed this thrilling adventure! Until next time! ๐๐
Hope you like my blog...!
If you like the content follow me on LinkedIn: https://www.linkedin.com/in/ashok-sana
Follow my Whatsapp & telegram community: https://chat.whatsapp.com/BzX1aruZIH645l29LxvgO3
Happy learning......!