DEV Community

Kanavsingh
Kanavsingh

Posted on

๐Ÿง‘โ€๐Ÿ’ป Day 7: Master Linux Package Managers & Systemctl in Your DevOps Journey

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

Top comments (0)