DEV Community

Kanav Gathe
Kanav Gathe

Posted on

Day 7/90: Package Manager and Systemctl in Linux 📦 #90DaysOfDevOps

Day 7: Package Manager and Systemctl 🚀

Hello DevOps enthusiasts! 👋 Welcome to Day 7 of the #90DaysOfDevOps challenge. Today, we're exploring package management and service control using systemctl.

Task Solutions 💻

1. Docker Installation

# Ubuntu
sudo apt update
sudo apt install docker.io

# CentOS
sudo yum install docker

# Verify installation
docker --version
systemctl status docker
Enter fullscreen mode Exit fullscreen mode

2. Jenkins Installation

# Ubuntu
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt update
sudo apt install jenkins

# Verify installation
jenkins --version
systemctl status jenkins
Enter fullscreen mode Exit fullscreen mode

3. Service Management

# Check Docker status
sudo systemctl status docker

# Stop Jenkins
sudo systemctl stop jenkins

# Enable services
sudo systemctl enable docker
sudo systemctl disable jenkins

# Check logs
sudo journalctl -u docker
sudo journalctl -u jenkins
Enter fullscreen mode Exit fullscreen mode

Package Management Commands 🔧

APT (Ubuntu/Debian)

sudo apt update          # Update package list
sudo apt install pkg     # Install package
sudo apt remove pkg      # Remove package
sudo apt upgrade         # Upgrade packages
Enter fullscreen mode Exit fullscreen mode

YUM (CentOS/RHEL)

sudo yum update         # Update package list
sudo yum install pkg    # Install package
sudo yum remove pkg     # Remove package
sudo yum upgrade        # Upgrade packages
Enter fullscreen mode Exit fullscreen mode

Systemctl Commands 🛠️

systemctl start service    # Start service
systemctl stop service     # Stop service
systemctl restart service  # Restart service
systemctl enable service   # Start on boot
systemctl disable service  # Don't start on boot
systemctl status service   # Check status
Enter fullscreen mode Exit fullscreen mode

Key Takeaways 💡

  • Package managers simplify software installation
  • Systemctl manages system services
  • Service logs help in troubleshooting
  • Boot-time service management is crucial

Linux #DevOps #Docker #Jenkins #90DaysOfDevOps


This is Day 7 of my #90DaysOfDevOps journey. Keep learning and managing services!

Top comments (0)