Understanding package manager and systemctl

Table of contents

No heading

No headings in the article.

#90DaysofDevops #Day7

Installing Docker in Ubuntu

sudo apt-get update
sudo-apt  install docker.io

Installing Jenkins in Ubuntu

  curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee \
    /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
    https://pkg.jenkins.io/debian binary/ | sudo tee \
    /etc/apt/sources.list.d/jenkins.list > /dev/null

  sudo apt-get update
  sudo apt-get install fontconfig openjdk-11-jre
  sudo apt-get install jenkins

Checking the status of docker in Ubuntu

sudo systemctl status docker

Stop the service, Jenkins after it is running

sudo systemctl status jenkins
sudo systemctl stop  jenkins.service
sudo systemctl status jenkins

Both systemctl status docker and service docker status commands can be used to check the status of the Docker service on a system running a Linux-based operating system.

The systemctl command is the recommended way to manage services on systems that use systems as their init system. It provides a centralized way to manage and control services and allows for more fine-grained control over service management.

The systemctl status docker command will display detailed information about the Docker service, including whether it is currently running, any errors that have occurred, and other relevant information.

On the other hand, the service command is a legacy command used to manage services on older Linux systems that do not use systems as their init system. The service docker status command will display basic information about the Docker service, including whether it is currently running or stopped.

In general, it is recommended to use systemctl to manage services on modern Linux systems that use systemd as their init system, as it provides more advanced functionality and better integration with the system.

Installing docker in Centos

sudo yum check-update
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io
sudo systemctl start docker