Understanding package manager and systemctl
๐ฆ๐ง What is a package manager in Linux?
In simpler words, a package manager is a tool that allows users to install, remove, upgrade, configure and manage software packages on an operating system. The package manager can be a graphical application like a software center or a command line tool like apt-get or pacman. ๐ ๏ธ๐ป
Youโll often find me using the term โpackageโ in tutorials and articles, To understand package manager, you must understand what a package is. ๐๐ง
What is a package?
A package is usually referred to an application but it could be a GUI application, command line tool or a software library (required by other software programs). A package is essentially an archive file containing the binary executable, configuration file and sometimes information about the dependencies. ๐ฆ๐๐
Different kinds of package managers
Package Managers differ based on packaging system but same packaging system may have more than one package manager.
For example, RPM has Yum and DNF package managers. For DEB, you have apt-get, aptitude command line based package managers. ๐ฆ๐ง๐
๐ณ๐ Checking Docker Service Status:
Before we proceed, make sure you have completed the above tasks to ensure that Docker is installed on your system. If you haven't installed Docker yet, follow the previous steps, and then come back to this point. Docker is an essential tool for containerization, and it's crucial to have it set up correctly.
To check the status of the Docker service in your system, follow these steps:
Open a terminal or command prompt on your system.
Type the following command and press Enter:
sudo systemctl status docker ๐ Note: The "sudo" command is used to run the "systemctl" command with administrative privileges.
- The output will display the current status of the Docker service. You might see information like active, inactive, or any error messages if something went wrong during the installation or starting process.
๐ด๐ต Stopping Jenkins Service and Screenshots:
Now, let's proceed to stop the Jenkins service and take before and after screenshots.
- First, let's stop the Jenkins service using the following command:
sudo systemctl stop jenkins
Once the service is stopped, take a screenshot of the current state of your system. This will serve as the "before" screenshot, showing Jenkins running or any relevant details you wish to capture.
After taking the "before" screenshot, proceed to start the Jenkins service again with this command:
sudo systemctl start jenkins
- Once the service is started, take another screenshot of your system. This will be the "after" screenshot, showing Jenkins in a stopped state or any changes that occurred after stopping the service.
๐ธ It's a good practice to take screenshots before and after making changes to your system, as visual evidence can be valuable for future reference or troubleshooting.
๐ค Understanding systemctl vs. service:
Before we conclude, let's briefly discuss the difference between systemctl and service commands. Both commands are used to manage services in Linux systems, but they have some distinctions.
๐ธ systemctl: This is a more modern and powerful command used to control system services in newer Linux distributions that use systemd. It allows you to start, stop, restart, enable, disable, and get the status of services. For example:
sudo systemctl start serviceName
sudo systemctl stop serviceName
sudo systemctl restart serviceName
sudo systemctl enable serviceName
sudo systemctl disable serviceName
sudo systemctl status serviceName
๐ธ service: This is an older command used to control services in Linux distributions that use the traditional System V init system. While it can still work on newer systems thanks to compatibility layers, systemctl is recommended for systemd-based systems. Examples of using the service command:
sudo service serviceName start
sudo service serviceName stop
sudo service serviceName restart
๐ It's essential to know the difference between these commands, especially if you're working with different Linux distributions or managing services on various systems.
That's it for now! You've completed the tasks of checking the Docker service status, stopping Jenkins with screenshots, and learning about systemctl and service commands. Keep exploring and experimenting with these tools to enhance your Linux skills! Happy coding! ๐๐ง
Subscribe to my newsletter
Read articles from Saurabh Mathuria directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by