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)