Installing Jenkins on Ubuntu
Asked Answered
E

8

8

I am trying to install Jenkins on ubuntu 11.04

I have installed Oracle Java

$:~$ java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) Server VM (build 25.5-b02, mixed mode)
$:~$ javac -version
javac 1.8.0_05
$:~$

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/jdk1.8.0_05/bin:/usr/lib/hadoop/hadoop-1.2.0/bin/:/usr/lib/pig/pig-0.12.0/bin:/usr/lib/hive/hive-0.11.0/bin:/usr/lib/hbase/hbase-0.94.8/bin
$:~$ echo $JAVA_HOME
/usr/lib/jvm/jdk1.8.0_05

When I try to install, I have some dependency issues..

$ sudo apt-get install jenkins
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 jenkins : Depends: daemon but it is not installable
           Depends: default-jre-headless but it is not installable or
                    java-runtime-headless but it is not installable
E: Broken packages
Elvyn answered 14/7, 2014 at 2:3 Comment(2)
Isn't Ubuntu 11.04 long out of support? That might have something to do about this...Rastus
how did you resolve daemon dependency?Floruit
A
5

to work install Jenkins they request Java versions greater than 1.8.0_1. I got hte same error and I updated java to below version

java -version
java version "1.8.0_121"

Now jenkins installing without errors Below link worked for 14.04 (hope it works for 11.04 too) Install Java version in ubuntu

Afternoons answered 19/4, 2017 at 7:36 Comment(0)
G
3

Try this:

sudo apt-get update
sudo apt-get remove default-jre default-jdk

sudo apt-get update
sudo apt-get install default-jre default-jdk

More about java on Ubuntu:
https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get

Galahad answered 14/7, 2014 at 2:15 Comment(3)
$ sudo apt-get remove default-jre default-jdk Reading package lists... Done Building dependency tree Reading state information... Done Virtual packages like 'default-jre' can't be removed E: Unable to locate package default-jdkElvyn
$ sudo apt-get install default-jre default-jdk Reading package lists... Done Building dependency tree Reading state information... Done Package default-jre is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'default-jre' has no installation candidate E: Unable to locate package default-jdkElvyn
try: "sudo apt-get install -f" It seems you are missing some dependencies. Also, update to the latest Ubuntu if possible.Galahad
H
3

Steps to install jenkins and view in browser with IP:-

  1. sudo apt update
  2. sudo apt search jdk --to search jdk
  3. sudo install openjdk-8-jre
  4. sudo install openjdk-8-jre-headless
  5. wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -

  6. add below line in the file /etc/apt/sources.list: sudo nano /etc/apt/sources.list OR sudo vi /etc/apt/sources.list

    Add this below link at the end of editing document.

    deb https://pkg.jenkins.io/debian binary/

  7. Update your local package index

    sudo apt-get update

  8. Install jenkins now

    sudo apt install jenkins

  9. start jenkins service

    sudo systemctl start jenkins

  10. Enable the jenkins service

    sudo systemctl enable jenkins

    Now jenkins installed in your system. If are following these steps you are good to go. heat localhost:8080 in the browser. because jenkins works on 8080 by default. you can change it's port to others.

    Now if are using google cloud then there is one more step.

  11. Firewall rule details (Add firewall rule to enable ip and tcp 8080 port) That's that now if you open in browser http://<your-ip>:8080 jenkins will open and ask you to view the password which give location on the ui.

For more detail please visit

https://www.jenkins.io/

Hertel answered 16/5, 2020 at 13:7 Comment(0)
R
1

Your installation of Java is likely the Oracle zip / tgz drop. By using it, the package manager (dpkg / apt in this case) is unaware it is installed.

Install the packaged java for the package manager to "know" that the right java is isntalled, or install the zip / tgz drop of jenkins.

In short, if you want managed Jenkins, use the managed Java, and if you don't want it to be managed (sometimes that's a good option if you don't want it to be upgraded), don't use the managed Jenkins or Java. (Keep in mind that unmanaged means you get none of the bug fixes until you manually update, but it also means you get no surprises until you manually update).

Redpencil answered 14/7, 2014 at 2:25 Comment(6)
Thanks Edwin. But I am afraid to say that I am not getting your point. Can you pls explain in a bit easy terms. Many Thanks...Elvyn
If you are installing Jenkins in an environment where it is ok for the server to be down so it can have the latest software, then using the packaged binaries is fine because it will be upgraded every time a new release is available. Some operations cannot tolerate Jenkins being down for an unexpected upgrade, so they prefer to miss out on the bug fixes until they can schedule an upgrade, at a later time. If you match that usage, unpackaged Jenkins with manual upgrades might be a better fit. It all depends on what you need, and how you will use it.Redpencil
Thanks Edwin. I got you this time. This installation is just for learning and trial purpose. Everything is just on one machine (server).. happy to ignore some bug fixes and manual updates.. This is my current requirement. I have Oracle Java 8 installed. Is there way to get rid of this dependency ?Elvyn
Download the unpackaged version of Jenkins then. It's here mirrors.jenkins-ci.org/war/latest/jenkins.warRedpencil
Thanks Edwin. But I need to figure out why I was successful last time but not this time(Jenkins debian pkg with Oracle Java). If no luck with that, I will get it done through war/tomcat... Thank You...Elvyn
@Elvyn Probably you were successful because even though you installed the Oracle Java, you weren't using it.Redpencil
C
1

Seems like you should run

sudo apt-get update
sudo apt-get upgrade

And try again.

Anyway, Jenkins users quite frecuently complain about the installer not working.

Your life will be easier if you do it manually. It is quite easy and you have complete instructions all around the web: http://clavadetscher.dyndns.org/wiki/en/Install_and_upgrade_Jenkins_CI_Server_on_Ubuntu_12.04_and_Tomcat6

note: tomcat7 (if you are tempted) has given me some headaches with Jenkins. I always end up installing tomcat6.

Cowfish answered 14/7, 2014 at 2:35 Comment(2)
Thanks Mikel.. I earlier installed jenkins in the same way using Oracle Java 7.. never faced this issue.. Now I am trying to install on another terminal by following same procedure but stuck with this dependency.. Not sure where I screwed up.. So I am after a solution to install Jenkins with Oracle Java...Elvyn
I suspect some missunderstanding. I said nothing about java versions. I only mentioned tomcat. Anyway, judging for the posts in their mailing lists, it seems like it isn't strange for the people mantaining the Jenkins deb packages to make some mistakes now and then. The manual way is the way to go; it never let me down (I'm still refering to Jenkins :P ).Cowfish
R
1

Ended up solving this by running the following command:

sudo add-apt-repository universe
Rhianna answered 5/7, 2019 at 20:33 Comment(0)
A
0

Pre-made script for install Jenkins and it will also print the access code to the console for the first login as well.

You should be able to copy and paste

cd ~/ 
git clone https://github.com/120GBSSD/jenkins-install-xenial.git 
chmod +x ~/jenkins-install-xenial/Ubuntu:16.04-Jenkins.sh 
./Ubuntu:16.04-Jenkins.sh
Ameliaamelie answered 5/11, 2017 at 14:33 Comment(0)
E
0

installation on ubuntu 24

Step 1: update the system

sudo apt update

Step 2: Install Java

sudo apt install openjdk-17-jdk

verify installation

java -version

Step 3:configure Jenkins Repository

Import the GPG key:

curl -fsSL https://pkg.jenkins.io/debian/jenkins.io.key | sudo tee \
/usr/share/keyrings/jenkins-keyring.asc > /dev/null

Add the Jenkins repository:

echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
https://pkg.jenkins.io/debian binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null

Step 4: Install Jenkins

sudo apt install jenkins

Step 5: Start and Enable Jenkins

sudo systemctl start jenkins
sudo systemctl enable jenkins

Step 7: Access Jenkins

Open a web browser and go to http://server_ip:8080
Excisable answered 23/8 at 17:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.