Day 7 Task: Understanding package manager and systemctl
Tasks
1. You have to install docker and Jenkins in your system from your terminal using package managers
2. Write a small blog or article to install these tools using package managers on Ubuntu and CentOS
Just follow the commands given below and you get it installed on your machine.
Install Docker
$ sudo apt-get update
$ sudo apt-get install docker.io
$ sudo usermod -aG docker $USER
$ sudo reboot
$ sudo docker run hello-world
$ docker ps
Install Jenkins
Jenkins requires Java to run, so first install Java -->
$ sudo apt-get update
$ sudo apt install openjdk-11-jre
$ java -version
Long-Term Support release of Jenkins---->
$ curl -fsSL
https://pkg.jenkins.io/debian-stable/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-stable
binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null
$ sudo apt-get update
$ sudo apt-get install jenkins
$ jenkins --version
Tasks
1. check the status of the docker service in your system (make sure you completed the above tasks, else docker won't be installed)
$ systemctl status docker
$ systemctl start jenkins
$ systemctl status jenkins
2. stop the service jenkins and post before and after screenshots
$ systemctl stop jenkins
$ systemctl status jenkins
3. read about the commands systemctl vs service
Both systemctl and service are command-line utilities in Linux that are used to manage system services.
service is an older utility that is still used in some Linux distributions. It provides a simple interface for starting, stopping, and restarting system services. It works by calling scripts in the /etc/init.d directory that are responsible for managing the service.
systemctl, on the other hand, is a newer and more powerful utility that is used in modern Linux distributions that use the systemd init system. systemctl provides a more advanced interface for managing services, allowing you to control and monitor the state of services, and perform more fine-grained operations like enabling or disabling services at boot time, reloading configuration files, and more.
Day07 task is completed!
90DaysOfDevOps Tasks👇