Day-7: 90DaysofDevOpsChallange.

CONTENTS:

  • What is a package manager in Linux?

  • What is a package?

  • Different kinds of package managers:

  • Let's use Ubuntu's package managers to install Docker and Jenkins!.

    • Installing Docker

    • Installing Jenkins

    • How To Stop A Jenkins

  • What are Systemctl and Systemd?

  • systemctl vs. service - Understanding the Difference 🔧

    What is a package manager in Linux?

    A package manager is a handy tool used in Linux systems to install, manage, update, and remove software packages. It simplifies the process of handling software by automating the installation and resolving dependencies (additional software required for the package to work properly).

  • Example: Popular package manager in Linux is "apt" used in Debian and Ubuntu-based systems. To install a package using "apt," you can simply open a terminal and type.

  • sudo apt install <packageName>

  • What is a package?

    A package is like a gift box that contains various software or programs bundled together. It makes it easy to distribute and install software on your computer. Packages typically include the software's code, libraries, and other necessary files.

    Example: If you use a package manager like "apt" on Debian/Ubuntu or "dnf" on Fedora, you can use it to download and install packages like "vim" (a text editor) with a single command, taking care of all dependencies and setup automatically.

    🔰Beginner-Friendly Example: Imagine a "Photo Editing Package" that includes a photo editing program, filters, fonts, and tools to enhance your images.

Different kinds of package managers

Package Managers differ based on packaging systems, but the same packaging system may have more than one package manager.

For example, RPM has two popular package managers - Yum and DNF.

For DEB packages, you can use apt-get or aptitude as command-line-based package managers. These package managers act as your trusty companions, helping you find, install, and manage software efficiently on your Linux system.

Let's use Ubuntu's package managers to install Docker and Jenkins!

Installing Docker:

In this case, Docker can be installed by using the following command: sudo apt install docker.io in the terminal.

To install any package first you need to update using the command

sudo apt update -y

Install docker sudo apt install docker.io

  1. Start the Docker service:

    COPY

      sudo systemctl start docker
    
  2. Enable Docker to start on boot:

    COPY

      sudo systemctl enable docker
    
  3. Check the Docker status:

    COPY

      sudo systemctl status docker
    

When you run the docker status command, it will show you the following output, confirming that Docker is installed properly on your system.

output:

Installing Jenkins:

🔰Use the steps to install Jenkins on Ubuntu using the apt package manager.

install java on vms sudo apt install openjdk-11-jdk -y

open pkg.jenkins.io follow the docs and select which flavour you wants

select debian-stable version and use the commands.

  1. This is the Debian package repository of Jenkins to automate installation and upgrade. To use this repository, first add the key to your system.

  2.   curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
          /usr/share/keyrings/jenkins-keyring.asc > /dev/nulll
    
  3. Then add a Jenkins apt repository entry:

  4.     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
    
  5. Update your local package index, then finally install Jenkins:

  6. 
        sudo apt-get update
        #sudo apt-get install fontconfig openjdk-11-jre
        sudo apt-get install jenkins
    
  7. system manger commands

  8.   sudo systemctl start jenkins
      sudo systemctl enable jenkins
      sudo systemctl status jenkins
    
  9. output

  10. How To Stop A Jenkins

    As Previously we have used "sudo systemctl start jenkins" to start the jenkins similarly we will use the "sudo systemctl stop Jenkins" to stop the Jenkins

  11. What is Systemctl and Systemd ?🔧

    💫Systemctl is like the master control 🎛️ for managing services on your Linux system. It's a command-line tool that allows you to start, stop, restart, enable, disable, and monitor services effortlessly.

    💫Systemd, on the other hand, is the superhero 🦸 behind the scenes, a powerful system and service manager. It's responsible for initializing the system during boot 🚀 and managing all processes, making sure your Linux system runs smoothly. 😊💻

    🔧 systemctl vs. service - Understanding the Difference 🔧

    🧑‍💻Systemctl and service are both commands used to manage services on a Linux system, but they have some differences in usage and capabilities. 🐧🛠️

    🔹 Systemctl: systemctl is a more modern and advanced command that comes with the system init system, which is commonly used in newer Linux distributions. It provides extensive control and management over services and targets. Some common system commands include:

    • 🚀 systemctl start <service>: Start a service.

    • 🛑 systemctl stop <service>: Stop a service.

    • 🔁 systemctl restart <service>: Restart a service.

    • 📅 systemctl enable <service>: Enable a service to start on boot.

    • 🚫 systemctl disable <service>: Disable a service from starting on boot.

    • ℹ️ systemctl status <service>: Check the status of a service.

🔹 Service: Service is a command that was commonly used with traditional init systems like SysV init. It is simpler in syntax compared to systemctl. Though the service is still available in many distributions, systemctl has become the standard for managing services. Some common service commands include:

  • ▶️ service <service> start: Start a service.

  • ⏹️ service <service> stop: Stop a service.

  • 🔄 service <service> restart: Restart a service.

  • 📊 service <service> status: Check the status of a service.

In summary, while both systemctl and service can manage services, systemctl is more feature-rich and is recommended for use on systems that utilize Systemd as their init system. However, the service command is still available and can be used on systems that have not yet transitioned to Systemd.

I hope you enjoyed this thrilling adventure! Until next time! 👋😊

Hope you like my blog...!

If you like the content follow me on LinkedIn:

https://www.linkedin.com/in/chakradhar-tatikonda-303b491a6

Happy learning......!

0
Subscribe to my newsletter

Read articles from chakradhar thatikonda directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

chakradhar thatikonda
chakradhar thatikonda

DevOps Engineer | Automation and Infrastructure Experienced DevOps engineer actively seeking new opportunities and collaborations in the exciting world of DevOps. Skilled in implementing CI/CD pipelines, optimizing deployment processes, and leveraging cloud technologies for scalable and resilient systems. Passionate about driving innovation and continuous improvement. Let's connect and explore how we can revolutionize software delivery together!