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.
What are the 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.
Tasks
- You have to install docker and jenkins in your system from your terminal using
package managers.
First we need to update the Ubuntu os with below command so that all the package list will get refreshed.
$ sudo apt update
Then second step is to install docker package using below command.
$ sudo apt-get install docker.io
Check the status of the installed package using systemctl command
$ systemctl status docker
If in case service is not running enable it using below mentioned set of commands.
Check for the docker version, Hence Docker Package is successfully installed.
To install Jenkins again refresh the package manager.
$ sudo apt update
To install Jenkins on the system we need to have java installed.
Install java using below command and check its version.
Now to install Jenkins type below command wget and copy Jenkins installation path from the internet
Check the status of Jenkins service.
Also Edit port settings as below for Jenkins page to be accessible.
Browse to http://localhost:8080
(or whichever port you configured for Jenkins when installing it) and wait until the Unlock Jenkins page appears.
systemctl and systemd
systemctl is used to examine and control the state of “systemd” system and service manager. systemd is system and service manager for Unix like operating systems(most of the distributions, not all).
The systemctl command interacts with the SystemD service manager to manage the services. Contrary to service command, it manages the services by interacting with the SystemD process instead of running the init script
Tasks
- Check the status of docker service in your system (make sure you completed above tasks, else docker won't be installed)
- Stop the service jenkins and post before and after screenshots
3.Difference between systemctl and service
The systemctl command interacts with the SystemD service manager to manage the services. In Service command, it manages the services by interacting with the SystemD process instead of running the init script.
To start, stop, and restart the service, we can run the respective commands with systemctl:
1. To start jenkins service Syntax : systemctl start jenkins
2. To stop jenkins service Syntax: systemctl stop jenkins
3. To check jenkins status Syntax: systemctl status jenkins
4. To enable jenkins service Syntax: systemctl enable jenkins
To start, stop, and restart the service, we can run the respective commands with service:
1. To start jenkins service Syntax : service jenkins start
2. To stop jenkins service Syntax: service jenkins stop
3. To check jenkins status Syntax: service jenkins status
4. To enable jenkins service Syntax: service jenkins enable