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! π₯
Top comments (0)