Table of contents
- What is a package manager in Linux? ๐ง
- What is a package? ๐ฆ
- Different kinds of package managers ๐ฆ
- Write a small blog or article to install these tools using package managers on Ubuntu and CentOS
- /systemctl and systemd
- check the status of the docker service in your system
- Read about the commands systemctl vs service
What is a package manager in Linux? ๐ง
In simpler words, a package manager is a tool that allows users to install, remove, upgrade, configure, and manage software packages on an operating system. The package manager can be a graphical application like a software center or a command-line tool like apt-get or Pacman. ๐ป๐ง
What is a package? ๐ฆ
A package is usually referred to as an application, but it could be a GUI application, command-line tool, or 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 ๐ฆ
Package managers differ based on the packaging system, but the same packaging system may have more than one package manager.
For example, RPM has Yum and DNF package managers. For DEB, you have apt-get and aptitude command-line-based package managers. ๐ฆ๐
Having a package manager in Linux makes software installation and management a breeze! ๐ฌ๏ธ๐จ Whether you're a command-line guru or a fan of graphical interfaces, Linux offers a variety of package managers to suit your preferences. So go ahead and explore the vast world of software packages in the Linux ecosystem! ๐๐ง
Write a small blog or article to install these tools using package managers on Ubuntu and CentOS
๐ DevOps Magic: Installing Tools with Package Managers on Ubuntu and CentOS ๐ง๐ป
As a DevOps enthusiast, you know that choosing the right tools can make all the difference in streamlining your development and deployment processes. Thankfully, package managers come to our rescue, simplifying the installation and management of various software on Linux distributions like Ubuntu and CentOS. Let's explore how to wield this DevOps magic on both of these popular distros! ๐ฉโจ
๐ฅ๏ธ Ubuntu: A Rock-Solid Foundation ๐๏ธ
Ubuntu, known for its user-friendly interface and wide community support, relies on the APT (Advanced Package Tool) package manager. Let's see how we can wield this tool to install some essential DevOps goodies. ๐ ๏ธ๐ง
1. Docker: Containerization Made Easy ๐ณ๐ฆ
With Docker, you can pack your applications in containers, making them portable and easy to deploy. To install Docker on Ubuntu, execute the following commands:
sudo apt update
sudo apt install docker.io
2. Jenkins: The Automation Guru ๐ค๐
Jenkins, the automation powerhouse, is a must-have for any DevOps workflow. To get Jenkins up and running on Ubuntu, use these commands:
sudo apt update
sudo apt install jenkins
๐ง CentOS: The Reliable Workhorse ๐๐พ
CentOS, renowned for its stability and long-term support, relies on YUM (Yellowdog Updater Modified) as its trusty package manager. Let's harness its power to install some crucial DevOps tools. ๐ ๏ธ๐
1. Docker: The Container Enchanter ๐ณ๐ฆ
Install Docker on CentOS with the following commands:
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce
sudo systemctl start docker
sudo systemctl enable docker
2. Jenkins: The Master of CI/CD ๐ค๐ง
For Jenkins on CentOS, perform these incantations:
sudo yum install -y java-11-openjdk-devel
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 -y jenkins
sudo systemctl start jenkins
sudo systemctl enable jenkins
๐ Congratulations, DevOps Wizard! ๐ง๐ปโโ๏ธ๐
By harnessing the power of package managers on Ubuntu and CentOS, you've unleashed the full potential of your DevOps journey. Docker for containerization and Jenkins for automation is just the beginning of your magical toolset. As you continue your DevOps quest, remember that package managers are your trusted allies, ensuring a smooth and efficient software installation experience. ๐๐ซ
Embrace the magic of DevOps, and may your deployments be swift, your pipelines be robust, and your infrastructure be rock-solid! Happy DevOpsing! ๐๐ง
Docker Installation results -->
Jenkins Installation results -->
Once the installation is done, we need to go to Security group settings and allow port 8080 since Jenkin runs on the 8080 port. Once we do that, copy the public IP of our EC2 machine and paste it into the browser with port 8080 and you'll be able to access Jenkins there. When it asks for an administrative password, just copy the path /var/lib/jenkins/secrets/initialAdminPassword and see the content using the cat command and copy that password.
Create your user & Install the suggested plugins.
Here you go - Jenkins is ready to use and explore.
Reference article to install Jenkins - youtube.com/watch?v=lRpS2CovMrs & pkg.jenkins.io/debian-stable
Jenkins installation YouTube video link
/systemctl and systemd
systemctl is 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(most of the distributions, not all).
check the status of the docker service in your system
systemctl status docker
service docker status
stop the service Jenkins and post before and after screenshots
When Jenkins service is in a running state
When Jenkins service is in an inactive state
Read about the commands systemctl vs service
๐ง DevOps Magic: Understanding systemctl
vs. service
Commands ๐ง๐ปโโ๏ธ๐
๐น๏ธ service
: The Old Guardian ๐ฐ๐ด
service
has been a long-standing guardian of service management in Linux. It is compatible with traditional init systems such as SysVinit. In a world where init scripts ruled the land, service
was the go-to spellcaster to start, stop, restart, or check the status of a service. Its incantations were straightforward to remember:
To start a service:
sudo service serviceName start
To stop a service:
sudo service serviceName stop
To restart a service:
sudo service serviceName restart
To check the status of a service:
sudo service serviceName status
๐งโโ๏ธ systemctl
: The Modern Enchanter ๐ง๐ปโโ๏ธ๐ฐ
With the advent of newer init systems like systemd, a new enchantment was introduced: systemctl
. This modern enchanter has become the preferred method for service management in most modern Linux distributions. Its powers are vast, offering more control and versatility over services. Here's how systemctl
casts its spells:
To start a service:
sudo systemctl start serviceName
To stop a service:
sudo systemctl stop serviceName
To restart a service:
sudo systemctl restart serviceName
To check the status of a service:
sudo systemctl status serviceName
To enable a service to start at boot:
sudo systemctl enable serviceName
To disable a service from starting at boot:
sudo systemctl disable serviceName
To reload the configuration of a service without stopping it:
sudo systemctl reload serviceName
๐งโโ๏ธ Choosing the Right Spell ๐ง๐ปโโ๏ธ๐ฎ
Both service
and systemctl
are powerful allies in your DevOps journey. While service
works with traditional init systems, systemctl
empowers you in the realm of systemd. When working with older systems or scripts, you may find service
more fitting. However, for modern systems and distributions, systemctl
is your go-to choice.
With the knowledge of these magical commands, you can confidently navigate your Linux environment, controlling services like a true DevOps sorcerer. Combine their powers wisely, and may your systems run smoothly and reliably in the realm of DevOps! ๐๐ง๐ปโโ๏ธ๐งโจ
Thanks for reading the blog & do share them with someone in need :)
Please share your views and suggestions, they are always welcome.
See you then in the next blog.
Happy learning :)