I’m trying to install Jenkins on an Azure VM with Ubuntu 20.04 following the next command lines:
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ >
/etc/apt/sources.list.d/jenkins.list'
sudo apt-get update -y
sudo apt-get install jenkins -y
But when I try to install Jenkins with the last command, this happens:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
jenkins
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 91.4 MB of archives.
After this operation, 95.0 MB of additional disk space will be used.
Err:1 https://pkg.jenkins.io/debian-stable binary/ jenkins 2.332.3
Redirection from https to 'http://mirrors.jenkins.io/debian-stable/jenkins_2.332.3_all.deb' is forbidden [IP: 146.75.30.133 443]
E: Failed to fetch https://pkg.jenkins.io/debian-stable/binary/jenkins_2.332.3_all.deb Redirection from https to 'http://mirrors.jenkins.io/debian-stable/jenkins_2.332.3_all.deb' is forbidden [IP: 146.75.30.133 443]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
How can I solve this issue?
5
Answers
I actually solved the problem, I don't know why with the actuall Jenkins installation guide it doesn't work but i solved it with these 2 command lines:
I've been trying with some versions till I found the one that worked, and now Jenkins is working.
https://deb.pkgs.org/packages/jenkins/jenkins_2.332.3_all.deb.html
You can install Jenkins with docker via docker-compose.
Before installation ->
sudo apt install docker.io docker-compose -y
(Ubuntu 22.04)
I have installed "net-tools" manually and just after that "Jenkins" has started to install.
Accordingly, I’ve changed my Ansible yaml
it was solved for me,
i’m running ubuntu 20.04 in AWS EC2 NEW instance
first command that im used in it
sudo su – (to enter the root user)
Update the repository
apt update
Install net-tools
apt install net-tools
Install JAVA, ’cause the jenkins can be running with JAVA
apt -y install openjdk-11-jdk
Edit the Java’s path
find /usr/lib/jvm/java-1.11* (copy the output of that command)
Add JAVA PATH
nano /etc/environment (Open the file)
JAVA_HOME="/usr/lib/jvm/java-1.11.0-openjdk-amd64" (add this command)
CTRL + X and Y and ENTER (for save that file)
Reload the file
source /etc/environment
And check the PATH
echo $JAVA_HOME (the output will be pretty same like step number 6)
Those were the requirement before you install the Jenkins
Download the jenkins file
wget https://pkg.jenkins.io/debian-stable/binary/jenkins_2.332.3_all.deb
And then install it
dpkg -i jenkins_2.332.3_all.deb
The installation will be success, now you can see your jenkins in EC2
[your-ip-public]:8080 (’cause the jenkins is run with 8080 port, we need add new rule of securtiy group in our EC2 instance)
I hope this helps
Before installing Jenkins, you need to do,
Then install,