🧑💻 Day 7: Master Linux Package Managers & Systemctl in Your DevOps Journey
Kanavsingh
Posted on October 16, 2024
Hey Dev.to Community! 👋
Day 7 of my #90DaysOfDevOps challenge is all about leveling up your Linux game with package managers and systemctl! Here’s how you can make your life easier by managing software installations and controlling services like a pro. 🤖
📦 What’s a Package Manager?
A package manager simplifies your life by handling software installs, updates, and removals. With just a couple of commands, you can install Docker 🐳 and Jenkins 🛠️ on your Linux machine. Let’s see how:
Install Docker & Jenkins on Ubuntu:
sudo apt update
sudo apt install docker.io jenkins -y
On CentOS:
sudo yum install docker jenkins -y
🚀 Systemctl – Your Linux Service Manager
If you want to start or stop services, systemctl is your tool. It’s super handy to check if Docker is running:
sudo systemctl status docker
Stopping Jenkins is just as easy:
sudo systemctl stop jenkins
💡 Automating Service Control
Automation is king in DevOps! Here’s a quick script to manage Docker and Jenkins services effortlessly:
!/bin/bash
sudo systemctl start docker
sudo systemctl start jenkins
echo "Docker and Jenkins services started!"
🛠️ Systemctl vs. Service Command
Have you ever wondered what’s the difference between systemctl and service?
Systemctl is the new, powerful, and preferred way to manage services in modern Linux. Service is older but still works on legacy systems.
🔍 Analyzing Docker Logs with Journalctl
Finish up by checking your Docker logs:
sudo journalctl -u docker
It’s that easy! Keep automating and mastering these tools! 🔥
DevOps #LinuxAutomation #Systemctl #Docker #Jenkins #90DaysOfDevOps
Posted on October 16, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 29, 2024