Installation of jenkins 2.60.1-1 0 or later fails on Ubuntu 14.04 (with grudges)

Overview

When I tried to install jenkins on ubuntu, the following error message appeared, but what to do about it.

error contents image.png

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

Cause

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)

Coping

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.

Corrective action ①-1 java 1.8 installation

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/

Corrective action ①-2 Defaultization of java 1.8

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

Remedy ①-3 Edit $ JAVA_HOME

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.

Remedy ①-4 java installation confirmation

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

Remedy ①-5 Jenkins installation confirmation

All you have to do is rerun the Jenkins install command. image.png

Jenkin installation completed.

image.png

Jenkins has started for the first time!

This is the end of the action. After that, proceed with the installation according to the guide on the GUI screen.

Below is a grudge until I find a solution

In the first place

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

Okay, if you put Java 1.7 in, it's okay! The biggest miscalculation

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.

Check the Jenkins version at random, "Is it compatible with the OS?"

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

Learn to rely on English documentation from here and there

"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"

jenkins-angry.png ←わし

Big favorite English version Jenkins document

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?

So

Don't run the wiki with people who can't maintain information!

reference

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) Japanese documentation of Jenkins documentation https://wiki.jenkins.io/display/JA/Jenkins

(Reference not recommended) Installing Jenkins on Ubuntu https://wiki.jenkins.io/display/JENKINS/Installing+Jenkins+on+Ubuntu

Recommended Posts

Installation of jenkins 2.60.1-1 0 or later fails on Ubuntu 14.04 (with grudges)
Fastest installation of Visual Studio Code on Ubuntu
Install the latest version of Jenkins on Ubuntu 16
Continuous integration on Alibaba Cloud ECS Ubuntu instance with Jenkins
Ruby installation on WSL2 + Ubuntu 20.04
Results of trying to use NVENC (CUDA) with Ubuntu 18.04 on WSL2
Elmer / Ice installation (Ubuntu on WSL)
Install ruby on Ubuntu 20.04 with rbenv
Headless install of Ubuntu 20.10 on Raspberry Pi
DNS over HTTPS with Cloudflared on Ubuntu
Build OpenCV with Java Wrapper on Ubuntu 18.04
Run Ubuntu + ROS with Docker on Mac