When I tried to install jenkins on ubuntu, the following error message appeared, but what to do about it.
error contents
# sudo apt-get install jenkins
Loading the package list...Done
Creating a dependency tree
Reading status information...Done
Some packages could not be installed. Probably possible
Did you request no situation?(I'm using an unstable distribution
If)Required packages have not been created yet or moved from Incoming
It is possible that it has not been moved.
The following information may help resolve this issue:
The following packages have unmet dependencies:
jenkins :Dependence: default-jre-headless (>= 2:1.8)But 2:1.7-51 is about to be installed or
java8-runtime-headless but can't install
E:Unable to solve the problem. I have a broken change-protected package.
java is 1.8 or earlier (1.7 etc.) ← Especially this </ b> Ubuntu OS version is 14 jenkins version 2.60.1-1 0 or later (As of November 5, 2017, if you install without specifying the version, the latest version 2.73.2 0 will be selected)
There are the following two. ① Install java 1.8 (2) Set the OS version of Ubuntu to 16 or higher
In this article, (1) the solution in java 1.8 is described.
Install java 1.8. This time we will install Open JDK 8.
$ sudo apt-add-repository ppa:openjdk-r/ppa
$ sudo apt-get update
$ sudo apt-get install openjdk-8-jdk
http://note.kurodigi.com/ubuntu1404-openjava8/
If you have a version other than java 1.8, change the default java below. Both java and javac.
# update-alternatives --config java
alternative java (/usr/bin/Provide java)Has two choices.
Choice Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java 1071 automatic mode
1 /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java 1071 manual mode
2 /usr/lib/jvm/java-8-openjdk-i386/jre/bin/java 1069 manual mode
Current choice[*]Press Enter to hold, otherwise press the key of the choice number: 2
update-alternatives: /usr/bin/java (java)In manual mode to provide/usr/lib/jvm/java-8-openjdk-i386/jre/bin/use java
# update-alternatives --config javac
alternative javac (/usr/bin/Provide javac)Has two choices.
Choice Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-7-openjdk-i386/bin/javac 1071 automatic mode
1 /usr/lib/jvm/java-7-openjdk-i386/bin/javac 1071 manual mode
2 /usr/lib/jvm/java-8-openjdk-i386/bin/javac 1069 manual mode
Current choice[*]Press Enter to hold, otherwise press the key of the choice number: 2
update-alternatives: /usr/bin/javac (javac)In manual mode to provide/usr/lib/jvm/java-8-openjdk-i386/bin/use javac
https://www.linuxmania.jp/apt-install-java.html
Change the environment variable $ JAVA_HOME to java 1.8. Since there are many methods, I will only give an example, but in my case I changed the export JAVA_HOME part described in / etc / profile, and then rebooted and applied it.
Before changing / etc / profile
(Omitted)
JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-i386
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME
After changing / etc / profile
(Omitted)
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-i386
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME
The path of # JAVA_HOME is the one described in the command result of the corrective action ①-2.
Check with java -version and echo $ JAVA_HOME.
$ java -version
openjdk version "1.8.0_141"
OpenJDK Runtime Environment (build 1.8.0_141-8u141-b15-3~14.04-b15)
OpenJDK Server VM (build 25.141-b15, mixed mode)
$echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk-i386
All you have to do is rerun the Jenkins install command.
This is the end of the action. After that, proceed with the installation according to the guide on the GUI screen.
There were various sites that wrote about installation methods and preparations, but the Japanese version of the Jenkins document site (https://wiki.jenkins.io/display/JA/Jenkins) said, "This is probably the most reliable." It was a mistake to believe the following content.
You need to have a JDK and JRE installed. openjdk-7-jre and openjdk-7-jdk are suggested. https://wiki.jenkins.io/display/JENKINS/Installing+Jenkins+on+Ubuntu
I installed Java 1.7 according to the instructions on the site. I installed Jenkins. Then the error at the top of the article will not disappear. why.
Install attack by specifying the version from the install command.
Reference for package version for Ubuntu: https://pkg.jenkins.io/debian-stable/
sudo apt-get install jenkins=2.73.2 0 ⇒ Cannot be installed
sudo apt-get install jenkins=2.73.1 0 ⇒ Cannot be installed
sudo apt-get install jenkins=2.60.3 0 ⇒ Cannot be installed
sudo apt-get install jenkins=2.60.2 0 ⇒ Cannot be installed
sudo apt-get install jenkins=2.60.1-1 0 ⇒ Cannot be installed
sudo apt-get install jenkins=2.60.1 0 ⇒ Can be installed
sudo apt-get install jenkins=2.46.2 0 ⇒ Installable
"2.60 is so old ..." "But officially, java 1.7 is all right to write it down ..." "Why ..." "Where's the problem ..." "Google teacher ..."
https://issues.jenkins-ci.org/browse/JENKINS-44502
Because of this dependency Jenkins 2.46.3 cannot be installed on Ubuntu 14.04 as it lacks an official Java8 package. "Ubuntu 14.0 doesn't have the official version of Java 8, so I'm afraid to give up."
https://issues.jenkins-ci.org/browse/JENKINS-43629
Oddly enough, one of our staging environments is running Ubuntu 16.04 LTS, where the upgrade worked normally. "If you want to get the latest Jenkins, start over on Ubuntu 16"
←わし
https://jenkins.io/doc/pipeline/tour/getting-started/
Prerequisites For this tour, you will require:
A machine with: 256 MB of RAM, although more than 512MB is recommended 10 GB of drive space (for Jenkins and your Docker image) The following software installed: Java 8 (either a JRE or Java Development Kit (JDK) is fine) Docker (navigate to Get Docker at the top of the website to access the Docker download that’s suitable for your platform)
oh... Did you have Java 1.8?
Don't run the wiki with people who can't maintain information!
Jenkins Official (English) https://jenkins.io/
Getting Started with the Guided Tour (Official Jenkins installation requirements) https://jenkins.io/doc/pipeline/tour/getting-started/
Package version for Jenkins Ubuntu https://pkg.jenkins.io/debian-stable/
Introducing Open JDK 8 on Ubuntu 14.04 http://note.kurodigi.com/ubuntu1404-openjava8/
How to install and manage multiple Javas on Ubuntu https://www.linuxmania.jp/apt-install-java.html
Unable to upgrade Jenkins on Ubuntu 14.04 LTS using 'apt-get upgrade' - The following packages have been kept back https://issues.jenkins-ci.org/browse/JENKINS-43629
Jenkins 2.46.3 LTS apt (Debian/Ubuntu) package incorrectly has Java 8 as dependency https://issues.jenkins-ci.org/browse/JENKINS-44502
(Reference not recommended) Installing Jenkins on Ubuntu https://wiki.jenkins.io/display/JENKINS/Installing+Jenkins+on+Ubuntu
Recommended Posts