📜 Day 7: Diving Deep into Linux Package Managers & Systemctl!
Hey Hashnode Devs! 💻
Today’s #90DaysOfDevOps challenge is all about making your life easier as a DevOps engineer by mastering package managers and systemctl. Whether you’re managing Docker 🐳 or Jenkins 🛠️, these tools are essential!
What’s a Package Manager? 🤔
A package manager is the system tool that handles all software installations and upgrades in Linux. It’s a lifesaver for managing dependencies and making sure everything works smoothly. 🔥
💻 Installing Docker & Jenkins
Let’s get Docker and Jenkins installed using apt and yum:
On Ubuntu:
sudo apt update
sudo apt install docker.io jenkins -y
On CentOS:
sudo yum install docker jenkins -y
🚀 Controlling Services with Systemctl
Next, we’re using systemctl to control services. Want to check if Docker is running? Use this command:
sudo systemctl status docker
Stopping Jenkins is just as simple:
sudo systemctl stop jenkins
⚙️ Automate Docker and Jenkins Services
Automation is key to DevOps, so here’s a quick bash script that automates the starting and stopping of services:
#!/bin/bash
sudo systemctl start docker
sudo systemctl start jenkins
echo "Services started!"
Systemctl vs. Service Commands – What’s the Difference?
Systemctl is modern and provides more control over services. Service is the older way of doing things but still works on legacy systems. Use systemctl for more advanced features and control.
🔍 Analyzing Logs with Journalctl
Finally, use journalctl to check out Docker logs:
sudo journalctl -u docker
Congrats! We have completed Day 7. Share your progress tag me in #Devopswith Singh, and let’s keep moving forward! 🚀
#DevOpsJourney #LinuxTools #Systemctl #DockerAutomation #HashnodeTech #90DaysOfDevOps#Trainwithshubam
Subscribe to my newsletter
Read articles from Kanav Preet Singh directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by