Installing Jenkins


 

Use-Case


Documenting steps needed to install Jenkins on an Ubuntu Virtual Machine and then integrating this to vRealize Automation to trigger some pipelines


 

Procedure

  • Deploy a Ubuntu virtual machine ( either on-prem or cloud )

  • Update the Debian apt repositories, install OpenJDK 11



root@jenkins:~# sudo apt update
Hit:1 http://in.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:5 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1,793 kB]
Get:6 http://in.archive.ubuntu.com/ubuntu focal-updates/main Translation-en [330 kB]
Get:7 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [15.2 kB]
Get:8 http://in.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [976 kB]
Get:9 http://in.archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [139 kB]
Get:10 http://in.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 c-n-f Metadata [520 B]
Get:11 http://in.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [924 kB]
Get:12 http://in.archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [207 kB]
Get:13 http://in.archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [20.7 kB]
Get:14 http://in.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [24.4 kB]
Get:15 http://in.archive.ubuntu.com/ubuntu focal-updates/multiverse Translation-en [7,336 B]
Get:16 http://in.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [596 B]
Get:17 http://in.archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [68.1 kB]
Get:18 http://in.archive.ubuntu.com/ubuntu focal-backports/main Translation-en [10.9 kB]
Get:19 http://in.archive.ubuntu.com/ubuntu focal-backports/main amd64 c-n-f Metadata [980 B]
Get:20 http://in.archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [26.8 kB]
Get:21 http://in.archive.ubuntu.com/ubuntu focal-backports/universe Translation-en [15.9 kB]
Get:22 http://in.archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [860 B]
Get:23 http://in.archive.ubuntu.com/ubuntu focal-security/main amd64 Packages [1,453 kB]
Get:24 http://in.archive.ubuntu.com/ubuntu focal-security/main Translation-en [250 kB]
Get:25 http://in.archive.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [10.2 kB]
Get:26 http://in.archive.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [914 kB]
Get:27 http://in.archive.ubuntu.com/ubuntu focal-security/restricted Translation-en [130 kB]
Get:28 http://in.archive.ubuntu.com/ubuntu focal-security/restricted amd64 c-n-f Metadata [520 B]
Get:29 http://in.archive.ubuntu.com/ubuntu focal-security/universe amd64 Packages [703 kB]
Get:30 http://in.archive.ubuntu.com/ubuntu focal-security/universe Translation-en [125 kB]
Get:31 http://in.archive.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [14.4 kB]
Get:32 http://in.archive.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [22.2 kB]
Get:33 http://in.archive.ubuntu.com/ubuntu focal-security/multiverse Translation-en [5,376 B]
Get:34 http://in.archive.ubuntu.com/ubuntu focal-security/multiverse amd64 c-n-f Metadata [512 B]
Fetched 8,527 kB in 2s (3,810 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
150 packages can be upgraded. Run 'apt list --upgradable' to see them.






root@jenkins:~# sudo apt install openjdk-11-jre
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  at-spi2-core ca-certificates-java fontconfig-config fonts-dejavu-core fonts-dejavu-extra java-common libatk-bridge2.0-0 libatk-wrapper-java libatk-wrapper-java-jni libatk1.0-0 libatk1.0-data libatspi2.0-0 libavahi-client3
  libavahi-common-data libavahi-common3 libcups2 libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libfontconfig1 libfontenc1 libgif7 libgl1 libgl1-mesa-dri libglapi-mesa libglvnd0 libglx-mesa0 libglx0 libgraphite2-3
  libharfbuzz0b libice6 libjpeg-turbo8 libjpeg8 liblcms2-2 libllvm12 libpciaccess0 libpcsclite1 libsensors-config libsensors5 libsm6 libvulkan1 libwayland-client0 libx11-xcb1 libxaw7 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0
  libxcb-present0 libxcb-randr0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-xfixes0 libxcomposite1 libxfixes3 libxft2 libxi6 libxinerama1 libxkbfile1 libxmu6 libxpm4 libxrandr2 libxrender1 libxshmfence1 libxt6 libxtst6 libxv1
  libxxf86dga1 libxxf86vm1 mesa-vulkan-drivers openjdk-11-jre-headless x11-common x11-utils
Suggested packages:
  default-jre cups-common liblcms2-utils pcscd lm-sensors libnss-mdns fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei | fonts-wqy-zenhei fonts-indic mesa-utils
The following NEW packages will be installed:
  at-spi2-core ca-certificates-java fontconfig-config fonts-dejavu-core fonts-dejavu-extra java-common libatk-bridge2.0-0 libatk-wrapper-java libatk-wrapper-java-jni libatk1.0-0 libatk1.0-data libatspi2.0-0 libavahi-client3
  libavahi-common-data libavahi-common3 libcups2 libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libfontconfig1 libfontenc1 libgif7 libgl1 libgl1-mesa-dri libglapi-mesa libglvnd0 libglx-mesa0 libglx0 libgraphite2-3
  libharfbuzz0b libice6 libjpeg-turbo8 libjpeg8 liblcms2-2 libllvm12 libpciaccess0 libpcsclite1 libsensors-config libsensors5 libsm6 libvulkan1 libwayland-client0 libx11-xcb1 libxaw7 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0
  libxcb-present0 libxcb-randr0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-xfixes0 libxcomposite1 libxfixes3 libxft2 libxi6 libxinerama1 libxkbfile1 libxmu6 libxpm4 libxrandr2 libxrender1 libxshmfence1 libxt6 libxtst6 libxv1
  libxxf86dga1 libxxf86vm1 mesa-vulkan-drivers openjdk-11-jre openjdk-11-jre-headless x11-common x11-utils
0 upgraded, 75 newly installed, 0 to remove and 150 not upgraded.
Need to get 79.3 MB of archives.
After this operation, 715 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://in.archive.ubuntu.com/ubuntu focal/main amd64 libatspi2.0-0 amd64 2.36.0-2 [64.2 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu focal/main amd64 x11-common all 1:7.7+19ubuntu14 [22.3 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu focal/main amd64 libxtst6 amd64 2:1.2.3-1 [12.8 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu focal/main amd64 at-spi2-core amd64 2.36.0-2 [48.7 kB]
Get:5 http://in.archive.ubuntu.com/ubuntu focal/main amd64 java-common all 0.72 [6,816 B]
Get:6 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libavahi-common-data amd64 0.7-4ubuntu7.1 [21.4 kB]
Get:7 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libavahi-common3 amd64 0.7-4ubuntu7.1 [21.7 kB]
Get:8 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libavahi-client3 amd64 0.7-4ubuntu7.1 [25.5 kB]
Get:9 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libcups2 amd64 2.3.1-9ubuntu1.1 [233 kB]
Get:10 http://in.archive.ubuntu.com/ubuntu focal/main amd64 liblcms2-2 amd64 2.9-4 [140 kB]
Get:11 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libjpeg-turbo8 amd64 2.0.3-0ubuntu1.20.04.1 [117 kB]
Get:12 http://in.archive.ubuntu.com/ubuntu focal/main amd64 libjpeg8 amd64 8c-2ubuntu8 [2,194 B]
Get:13 http://in.archive.ubuntu.com/ubuntu focal/main amd64 fonts-dejavu-core all 2.37-1 [1,041 kB]
Get:14 http://in.archive.ubuntu.com/ubuntu focal/main amd64 fontconfig-config all 2.13.1-2ubuntu3 [28.8 kB]
Get:15 http://in.archive.ubuntu.com/ubuntu focal/main amd64 libfontconfig1 amd64 2.13.1-2ubuntu3 [114 kB]
Get:16 http://in.archive.ubuntu.com/ubuntu focal/main amd64 libgraphite2-3 amd64 1.3.13-11build1 [73.5 kB]
Get:17 http://in.archive.ubuntu.com/ubuntu focal/main amd64 libharfbuzz0b amd64 2.6.4-1ubuntu4 [391 kB]
Get:18 http://in.archive.ubuntu
*
*
Get:74 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 mesa-vulkan-drivers amd64 21.2.6-0ubuntu0.1~20.04.2 [5,788 kB]
Get:75 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 openjdk-11-jre amd64 11.0.15+10-0ubuntu0.20.04.1 [175 kB]
Fetched 79.3 MB in 4s (19.1 MB/s)
Extracting templates from packages: 100%
Selecting previously unselected package libatspi2.0-0:amd64.
(Reading database ... 71625 files and directories currently installed.)
Preparing to unpack .../00-libatspi2.0-0_2.36.0-2_amd64.deb ...
Unpacking libatspi2.0-0:amd64 (2.36.0-2) ...
*
*
*
Unpacking mesa-vulkan-drivers:amd64 (21.2.6-0ubuntu0.1~20.04.2) ...
Selecting previously unselected package openjdk-11-jre:amd64.
Preparing to unpack .../74-openjdk-11-jre_11.0.15+10-0ubuntu0.20.04.1_amd64.deb ...
Unpacking openjdk-11-jre:amd64 (11.0.15+10-0ubuntu0.20.04.1) ...
Setting up libgraphite2-3:amd64 (1.3.13-11build1) ...
Setting up libxcb-dri3-0:amd64 (1.14-2) ...
Setting up liblcms2-2:amd64 (2.9-4) ...
Setting up libx11-xcb1:amd64 (2:1.6.9-2ubuntu1.2) ...
Setting up libpciaccess0:amd64 (0.16-0ubuntu1) ...
Setting up libdrm-nouveau2:amd64 (2.4.107-8ubuntu1~20.04.2) ...
Setting up libxcb-xfixes0:amd64 (1.14-2) ...
Setting up libxpm4:amd64 (1:3.5.12-1) ...
Setting up libxi6:amd64 (2:1.7.10-0ubuntu1) ...
Setting up java-common (0.72) ...
*
*
*
Setting up libxaw7:amd64 (2:1.0.13-1) ...
Setting up x11-utils (7.7+5) ...
Setting up libatk-wrapper-java (0.37.1-1) ...
Setting up libatk-wrapper-java-jni:amd64 (0.37.1-1) ...
Setting up openjdk-11-jre-headless:amd64 (11.0.15+10-0ubuntu0.20.04.1) ...
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/java to provide /usr/bin/java (java) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/jjs to provide /usr/bin/jjs (jjs) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/keytool to provide /usr/bin/keytool (keytool) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/rmid to provide /usr/bin/rmid (rmid) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/rmiregistry to provide /usr/bin/rmiregistry (rmiregistry) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/pack200 to provide /usr/bin/pack200 (pack200) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/unpack200 to provide /usr/bin/unpack200 (unpack200) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/lib/jexec to provide /usr/bin/jexec (jexec) in auto mode
Setting up openjdk-11-jre:amd64 (11.0.15+10-0ubuntu0.20.04.1) ...
Setting up ca-certificates-java (20190405ubuntu1) ...
head: cannot open '/etc/ssl/certs/java/cacerts' for reading: No such file or directory
Adding debian:QuoVadis_Root_CA_3_G3.pem
Adding debian:Buypass_Class_2_Root_CA.pem
Adding debian:Amazon_Root_CA_2.pem
Adding debian:Sonera_Class_2_Root_CA.pem
Adding debian:Atos_TrustedRoot_2011.pem
Adding debian:Certigna_Root_CA.pem
*
*
*
Adding debian:Staat_der_Nederlanden_Root_CA_-_G3.pem
Adding debian:ISRG_Root_X1.pem
Adding debian:OISTE_WISeKey_Global_Root_GB_CA.pem
Adding debian:e-Szigno_Root_CA_2017.pem
Adding debian:UCA_Global_G2_Root.pem
Adding debian:IdenTrust_Commercial_Root_CA_1.pem
Adding debian:GlobalSign_ECC_Root_CA_-_R5.pem
Adding debian:XRamp_Global_CA_Root.pem
Adding debian:IdenTrust_Public_Sector_Root_CA_1.pem
Adding debian:Hellenic_Academic_and_Research_Institutions_RootCA_2011.pem
Adding debian:GlobalSign_Root_CA_-_R3.pem
Adding debian:emSign_Root_CA_-_C1.pem
Adding debian:certSIGN_Root_CA_G2.pem
Adding debian:Amazon_Root_CA_4.pem
done.
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for systemd (245.4-4ubuntu3.15) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for ca-certificates (20210119~20.04.2) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...

done.
done.
root@jenkins:~#


  • Set Repository


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

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



  • Update Repository again


sudo apt-get update


  • Install Jenkins




root@jenkins:~# sudo apt-get install jenkins
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  libfwupdplugin1
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  net-tools
The following NEW packages will be installed:
  jenkins net-tools
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 87.9 MB of archives.
After this operation, 92.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://in.archive.ubuntu.com/ubuntu focal/main amd64 net-tools amd64 1.60+git20180626.aebd88e-1ubuntu1 [196 kB]
Get:2 https://pkg.jenkins.io/debian-stable binary/ jenkins 2.346.1 [87.7 MB]
Fetched 87.9 MB in 44s (1,978 kB/s)
Selecting previously unselected package net-tools.
(Reading database ... 109455 files and directories currently installed.)
Preparing to unpack .../net-tools_1.60+git20180626.aebd88e-1ubuntu1_amd64.deb ...
Unpacking net-tools (1.60+git20180626.aebd88e-1ubuntu1) ...
Selecting previously unselected package jenkins.
Preparing to unpack .../jenkins_2.346.1_all.deb ...
Unpacking jenkins (2.346.1) ...
Setting up net-tools (1.60+git20180626.aebd88e-1ubuntu1) ...
Setting up jenkins (2.346.1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/jenkins.service → /lib/systemd/system/jenkins.service.
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.17) ...
root@jenkins:~#




  • Jenkins is now successfully installed

  • To access Jenkins , I will now go ahead and enter this url on the browser

http://jenkins:8080


  • Get the password as suggested

cat /var/lib/jenkins/secrets/initialAdminPassword

  • Copy the password and enter in the section on the browser



  • Once we click on continue after entering password , you would be presented with a pane where you can install plugins



  • Click on "Install suggested plugins" to start installation



  • Once all of the plugins are installed , it would then prompt to create a user



  • Once we enter the first admin user information , then when you click on save and continue , it would present you with the url needed for you to login into Jenkins. Now click on Save and Finish




  • Jenkins is now ready



  • Now , when we click on start using jenkins you will bv



 



24 views0 comments

Recent Posts

See All