Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Jenkins on Ubuntu

Tags:

java

jenkins

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
like image 948
suj Avatar asked Jul 14 '14 02:07

suj


3 Answers

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

like image 59
User123456 Avatar answered Oct 17 '22 13:10

User123456


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

like image 3
GTAWWEKID Avatar answered Oct 17 '22 13:10

GTAWWEKID


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/

like image 3
Shashikant Pandit Avatar answered Oct 17 '22 13:10

Shashikant Pandit