Understanding package manager and systemctl

#90daysdevops

#day07

What is a package manager?

A package manager is a group of software that helps to automate the installation process, upgrading process, configuration process, and removing process of the computer programs for an operating system.

Some of the package managers for Linux are APT (Advanced Package Tool) used by Debian and Ubuntu, RPM (Red Hat Package Manager) used by Red Hat, CentOS, and Fedora etc.

Here we are using Ubuntu so we will be using using the APT package manager.

when you use apt it makes sure to even download the required dependencies also unlike dpkg.

Install Docker

sudo apt-get install docker.io

This command will install the docker with all the required dependencies.

Check the version of Docker:

     docker --version
  • How to Install Jenkins?

    Before installing Jenkins it is necessary to have java in your system.

    Jenkins only supports Java 8 and Java 11 on Ubuntu.

  • First, update the default Ubuntu packages lists for upgrades with the following command:

      sudo apt-get update
    

    Step 1

  • Then, run the following command to install JDK 8:

      sudo apt-get install openjdk-8-jdk
    
  • To test if Java has been installed successfully, run this command:

      java --version
    

    It should look something like this:

Step 2:

Add Jenkins Repository:

curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee \
    /usr/share/keyrings/jenkins-keyring.asc > /dev/null

Add the Jenkins software repository to the source list and provide the authentication key:

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

Update the system repository one more time. Updating refreshes the cache and makes the system aware of the new Jenkins repository.

sudo apt update

Run Installing Jenkins:

sudo apt-get install jenkins

To check if Jenkins is installed and running, run the following command:

sudo systemctl status jenkins

Open a web browser and navigate to your server's IP address. Use the following syntax:

http://ip_address_or_domain:8080

Make sure to add inbound rule if the page mentioned above is not loaded

Once the web page opens it would look like this

here It will ask for a password to log in as path of the password is highlighted in red colour just copy it and paste into your browser:

Now Just Login into Jenkins:

Create your username and Password:

Tasks:

  • check the status of the docker service in your system
systemctl status docker

  • stop the service Jenkins and post before and after.

      systemctl stop jenkins
    

after stopping Jenkins

Thank you for reading!!

~Sujata Kumari

Great initiative by the #trainwithshubham community