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)