How to install Jenkins 2.150.1 on Ubuntu 14.04

0. sudo -s
— How to Install Oracle Java 8 on Ubuntu 14.04 LTS —
1. sudo apt-add-repository ppa:webupd8team/java
2. sudo apt-get update
3. sudo apt-get install oracle-java8-installer

— Check the installed Java —-
sudo update-alternatives –config java
sudo update-alternatives –config javac
update-java-alternatives -l
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
echo “$JAVA_HOME”

— How to install Jenkins on Ubuntu 14.04–

1.

 sudo curl -O http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key
apt-key add jenkins-ci.org.key

wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update && apt-get upgrade -y
sudo apt-get install jenkins

—— Jenkins start on port 8080 ——
—-> nano /etc/default/jenkins
HTTP_PORT=8081
5. sudo service jenkins restart
6. copy the password from cat /var/lib/jenkins/secrets/initialAdminPassword

7. Install Plugins in Jenkins
–> Login to Jenkins dashboard and navigate to Manage Jenkins >> Manage Plugins >> Available Tab and select the plugins to install

troubleshooting
$ sudo netstat -peanut | grep ":8000"
$ lsof -i :8000
sudo mount -o bind /var/tmp /tmp