[root@jenk yum.repos.d]# sudo yum install jenkins
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
File contains no section headers.
file: file:///etc/yum.repos.d/jenkins.repo, line: 1
‘–2024-03-03 08:50:02-- https://pkg.jenkins.io/redhat-stable/jenkins.repo\n’
I removed jenkins.repo and reconnected to the jenkins.repo
i used the below commands
// [root@jenk yum.repos.d]# sudo rm -r jenkins.repo (to remove jenkins.repo)
// [root@jenk yum.repos.d]# sudo systemctl stop jenkins (to stop jenkins service)
[root@jenk yum.repos.d]# ls
amzn2-core.repo amzn2-extras.repo
[root@jenk yum.repos.d]# sudo wget -O /etc/yum.repos.d/jenkins.repo \
> https://pkg.jenkins.io/redhat-stable/jenkins.repo
[root@jenk yum.repos.d]# sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
[root@jenk yum.repos.d]# ls
amzn2-core.repo amzn2-extras.repo jenkins.repo
[root@jenk yum.repos.d]# sudo yum upgrade
[root@jenk yum.repos.d]# yum install java -y
[root@jenk yum.repos.d]# sudo yum install jenkins.noarch
[root@jenk yum.repos.d]# sudo yum install jenkins.noarch
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Resolving Dependencies
→ Running transaction check
—> Package jenkins.noarch 0:2.440.1-1.1 will be installed
→ Finished Dependency Resolution
Dependencies Resolved
====================================================================================================================================================================================
Package Arch Version Repository Size
Installing:
jenkins noarch 2.440.1-1.1 jenkins 82 M
Transaction Summary
Install 1 Package
Total download size: 82 M
Installed size: 83 M
Is this ok [y/d/N]: y
Downloading packages:
jenkins-2.440.1-1.1.noarch.rpm | 82 MB 00:00:26
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : jenkins-2.440.1-1.1.noarch 1/1
Verifying : jenkins-2.440.1-1.1.noarch 1/1
Installed:
jenkins.noarch 0:2.440.1-1.1
Complete!
[root@jenk yum.repos.d]# sudo systemctl daemon-reload
[root@jenk yum.repos.d]# sudo systemctl enable jenkins.service
Created symlink from /etc/systemd/system/multi-user.target.wants/jenkins.service to /usr/lib/systemd/system/jenkins.service.
[root@jenk yum.repos.d]# sudo systemctl start jenkins