Day 7 Task: Understanding package manager and systemctl

  • What is a package manager in Linux?

A package manager in Linux is a program that automates the installation, updating, and management of software packages in a Linux operating system. Common package managers include apt (Debian and Ubuntu), yum (Red Hat and CentOS), and dnf (Fedora). These package managers handle dependency resolution and make it easy to install and manage multiple software packages at once

  • 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.

Tasks: 1. You have to install docker and jenkins in your system from your terminal using package managers.

For Ubuntu - Install Docker?1. Open the terminal on Ubuntu. 2. Remove any?docker file?that are running in the system, using the following command:?sudo apt-get remove docker docker-engine docker.io

3. Check if the system is up-to-date using the following command:?sudo apt-get update

4. Install Docker using the following command:?sudo apt install docker.io

5. Install all the dependency packages using the following command:??sudo snap install docker

6. Before testing Docker, check the version installed using the following command:?docker --version


For Ubuntu: Install Jenkins

Step 1: Install Java

Jenkins requires the Java Runtime Environment (JRE).

1.?Check if you already have java?installed on your Ubuntu system:?java --version

2. Depending on which Java version you want to install, Java 8 or 11, run one of the following commands:

To install OpenJDK 8, run:?sudo apt install openjdk-8-jdk -y?To install OpenJDK 11, run:?sudo apt install openjdk-11-jdk -y

Step 2: Add Jenkins Repository

It is recommended to install Jenkins using the project-maintained repository, rather than from the default Ubuntu repository. The reason for that is because the Jenkins version in the default Ubuntu repository might not be the latest available version, which means it could lack the latest features and bug fixes.

1. Start by importing the GPG key. The GPG key verifies package integrity but there is no output. Run:

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

2. 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-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null

Step 3: Install Jenkins

1. Update the system repository

sudo apt update

2. Install Jenkins by running:

sudo apt install jenkins -y

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

sudo systemctl status jenkins?A bright green entry labelled?active (running)?should appear in the output, indicating that the service is running.

2. Stop the service jenkins and post before and after screenshots.

Before stop jenkins service:

No alt text provided for this image

After stop jenkins service :

No alt text provided for this image

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

Thank you for reading!!!

要查看或添加评论,请登录

Kashi Diggi的更多文章

  • Day 44: Relational Database Service in AWS

    Day 44: Relational Database Service in AWS

    Amazon Relational Database Service (Amazon RDS) is a collection of managed services that makes it simple to set up…

  • Day 43: S3 Programmatic access with AWS-CLI

    Day 43: S3 Programmatic access with AWS-CLI

    S3 Amazon Simple Storage Service (Amazon S3) is an object storage service that provides a secure and scalable way to…

  • IAM Programmatic access and AWS CLI

    IAM Programmatic access and AWS CLI

    IAM Programmatic access In order to access your AWS account from a terminal or system, you can use AWS Access keys and…

  • Setting up an Application Load Balancer with AWS EC2

    Setting up an Application Load Balancer with AWS EC2

    What is Load Balancing? Load balancing is the distribution of workloads across multiple servers to ensure consistent…

  • Day 40 AWS EC2 Automation

    Day 40 AWS EC2 Automation

    Automation in EC2: Amazon EC2 or Amazon Elastic Compute Cloud can give you secure, reliable, high-performance, and…

  • Day 39 AWS and IAM Basics

    Day 39 AWS and IAM Basics

    AWS: Amazon Web Services is one of the most popular Cloud Provider that has free tier too for students and Cloud…

  • Day 38 Getting Started with AWS Basics

    Day 38 Getting Started with AWS Basics

    AWS: Amazon Web Services (AWS) is a comprehensive cloud computing platform offered by Amazon that provides a wide range…

  • Day 34 Task: Working with Services in Kubernetes

    Day 34 Task: Working with Services in Kubernetes

    What are Services in K8s In Kubernetes, Services are objects that provide stable network identities to Pods and…

    1 条评论
  • Working with Namespaces and Services in Kubernetes

    Working with Namespaces and Services in Kubernetes

    What are Namespaces and Services in k8s? In Kubernetes, Namespaces are used to create isolated environments for…

  • Launching your Kubernetes Cluster with Deployment

    Launching your Kubernetes Cluster with Deployment

    What is Deployment in k8s A Deployment provides a configuration for updates for Pods and ReplicaSets. You describe a…

社区洞察

其他会员也浏览了