Error solve | Jenkins installation in the new version 2023: follow the below steps

Error solve | Jenkins installation in the new version 2023: follow the below steps

step1: type command : sudo yum clean all && sudo yum update -y

step2: type: Ensure that your software packages are up to date on your instance by using the following command to perform a quick software update:

[ec2-user ~]$ sudo yum update –y

step3: Add the Jenkins repo using the following command:

[ec2-user ~]$ sudo wget -O /etc/yum.repos.d/jenkins.repo \
    https://pkg.jenkins.io/redhat-stable/jenkins.repo

step5: Import a key file from Jenkins-CI to enable installation from the package:

[ec2-user ~]$ sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
[ec2-user ~]$ sudo yum upgrade

step6:Install Java (Amazon Linux 2): if you get an error after the below steps, no worries just follow the next steps and run at the end Jenkins.

[ec2-user ~]$ sudo amazon-linux-extras install java-openjdk11 -y

step7:Install Java (Amazon Linux 2023):

[ec2-user ~]$ sudo dnf install java-11-amazon-corretto -y

step8: Install the Jenkins:

[ec2-user ~]$ sudo yum install jenkins -y

step9:Enable the Jenkins service to start at boot:

[ec2-user ~]$ sudo systemctl enable jenkins

step10:Start Jenkins as a service:

[ec2-user ~]$ sudo systemctl start jenkins

step11: You can check the status of the Jenkins service using the command:

[ec2-user ~]$ sudo systemctl status jenkins

Now, Run Jenkins in your browser.