How to Install Gitlab Runner in Linux Ubuntu 18.04 Bionic Beaver

Posted on

Introduction to Gitlab Runner

This is an article showing how to install Gitlab Runner in Linux Ubuntu 18.04 Bionic Beaver. Before going further to the installation process, the first step is know what Gitlab Runner is. According to the information in the official Gitlab Runner website in this link, GitLab Runner is the open source project that is used to run your jobs and send the results back to GitLab. So, what is Gitlab in this context ?. Referring to the official Gitlab website in this link, GitLab claims to be a single application for the entire DevOps lifecycle. So, GitLab is unique and it makes concurrent DevOps steps are possible. It enables any organization using Gitlab to remove the constraints of a pieced together toolchain. It is used in conjunction with Gitlab CI, the open-source continuous integration service included with GitLab that coordinates the jobs.

How does a Gitlab Runner works ?

Ideally, in GitLab CI that stands for Gitlab Continuous Integration, Gitlab Runners will have a specific Runners to perform specific tasks. These tasks is defined in a file code with the name of .gitlab-ci.yml. So, the Runners will run the file code. For further information about Gitlab Runners, feel free to read the official documentation in this link.

Gitlab Runner Installation Steps

There are several parts on the installation steps. Each parts consists of several steps. There are several parts in the installation process because a certain failure appears in it. So, to be able to understand all of the installation steps in a whole, those steps exist in the available list in separate parts.

 

Checking the availability of Gitlab Runner for further Installation

1. Check the availability of the tool or program. Below are steps for checking the availability :

user@hostname:~$ apt search ^gitlab-runner$
Sorting... Done
Full Text Search... Done
gitlab-runner/bionic,now 10.5.0+dfsg-2 amd64 [installed]
  GitLab Runner - runs continuous integration (CI) jobs
user@hostname:~$ apt-cache search ^gitlab-runner$
gitlab-runner - GitLab Runner - runs continuous integration (CI) jobs
user@hostname:~$ 

The output above indicates the tool or the program exists in the operating system. On the other hand, how about if the tool or program is not there ?. Just install it using the appropriate command.

2. Type the following command to install Gitlab Runner in Linux Ubuntu 18.04 Bionic Beaver

root@hostname:~# apt -y install gitlab-runner
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  cdebootstrap debian-archive-keyring libdebian-installer-extra4 libdebian-installer4
Suggested packages:
  qemu-user-static docker.io
The following NEW packages will be installed:
  cdebootstrap debian-archive-keyring gitlab-runner libdebian-installer-extra4 libdebian-installer4
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 7.675 kB of archives.
After this operation, 32,8 MB of additional disk space will be used.
Get:1 http://xxx.xxxxxxx.ubuntu.com/ubuntu bionic/main amd64 libdebian-installer4 amd64 0.110ubuntu2 [21,6 kB]
Get:2 http://xxx.xxxxxxx.ubuntu.com/ubuntu bionic/main amd64 libdebian-installer-extra4 amd64 0.110ubuntu2 [5.172 B]
Get:3 http://xxx.xxxxxxx.ubuntu.com/ubuntu bionic/universe amd64 debian-archive-keyring all 2017.7ubuntu1 [56,0 kB]                    
Get:4 http://xxx.xxxxxxx.ubuntu.com/ubuntu bionic/universe amd64 cdebootstrap amd64 0.7.7ubuntu2 [31,8 kB]                             
Err:5 http://xxx.xxxxxxx.ubuntu.com/ubuntu bionic/universe amd64 gitlab-runner amd64 10.5.0+dfsg-2                                     
  Connection failed [IP: xxx.xxx.xxx.xxx 80]
Fetched 115 kB in 1min 7s (1.715 B/s)
E: Failed to fetch http://xx.xxxxxxx.ubuntu.com/ubuntu/pool/universe/g/gitlab-ci-multi-runner/gitlab-runner_10.5.0+dfsg-2_amd64.deb  Connection failed [IP: xxx.xxx.xxx.xxx 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
root@hostname:~#

An error on the process of Gitlab Runner installation

1. Apparently, there is a failure to fetch the gitlab-runner package referring to the above output. To solve the problem, follow the advice to run ‘apt-get update as follows :

root@hostname:~# apt-get update
Hit:1 http://ppa.launchpad.net/inkscape.dev/stable/ubuntu bionic InRelease                                                            
Ign:2 http://pkg.jenkins.io/debian-stable binary/ InRelease                                                                           
Hit:3 http://xxx.xxxxxxx.ubuntu.com/ubuntu bionic InRelease                                                                            
Hit:4 http://pkg.jenkins.io/debian-stable binary/ Release                                                                             
Get:6 http://security.ubuntu.com/ubuntu bionic-security InRelease [83,2 kB]                                                           
Ign:7 http://dl.google.com/linux/chrome/deb stable InRelease                                                                          
Get:8 http://xxx.xxxxxxx.ubuntu.com/ubuntu bionic-updates InRelease [88,7 kB]                                           
Get:9 http://dl.google.com/linux/chrome/deb stable Release [943 B]                                                                    
Get:10 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages [164 kB]                                                  
Hit:11 http://ppa.launchpad.net/libreoffice/ppa/ubuntu bionic InRelease                                                               
Get:12 http://dl.google.com/linux/chrome/deb stable Release.gpg [819 B]                                                               
Get:13 http://xxx.xxxxxxx.ubuntu.com/ubuntu bionic-backports InRelease [74,6 kB]                                                       
Get:15 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1.127 B]                                                     
Get:16 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [205 kB]                                                 
Hit:14 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu bionic InRelease                                                           
Get:17 http://security.ubuntu.com/ubuntu bionic-security/main Translation-en [80,9 kB]                                                
Get:18 http://security.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [204 B]                                           
Get:19 http://security.ubuntu.com/ubuntu bionic-security/universe i386 Packages [96,5 kB]                                             
Get:20 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [96,6 kB]                                            
Get:21 http://security.ubuntu.com/ubuntu bionic-security/universe Translation-en [54,6 kB]                                            
Get:22 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [9.384 B]                                     
Get:23 http://security.ubuntu.com/ubuntu bionic-security/universe DEP-11 48x48 Icons [9.088 B]                                        
Get:24 http://security.ubuntu.com/ubuntu bionic-security/universe DEP-11 64x64 Icons [16,3 kB]                                        
Get:25 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [1.448 B]                                          
Get:26 http://security.ubuntu.com/ubuntu bionic-security/multiverse i386 Packages [1.604 B]                                           
...                               
Get:41 http://xxx.xxxxxxx.ubuntu.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2.468 B]                                  
Get:42 http://xxx.xxxxxxx.ubuntu.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [5.096 B]                                  
Fetched 4.301 kB in 1min 16s (56,6 kB/s)                                                                                              
Reading package lists... Done
root@hostname:/var/www/html# 

2. The next step, after executing the command above, just retry to install the gitlab-runner package again as follows :

root@hostname:/var/www/html#apt -y install gitlab-runner
....
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  cdebootstrap debian-archive-keyring libdebian-installer-extra4 libdebian-installer4
Suggested packages:
  qemu-user-static docker.io
The following NEW packages will be installed:
  cdebootstrap debian-archive-keyring gitlab-runner libdebian-installer-extra4 libdebian-installer4
0 upgraded, 5 newly installed, 0 to remove and 32 not upgraded.
Need to get 7.561 kB/7.675 kB of archives.
After this operation, 32,8 MB of additional disk space will be used.
Err:1 http://root@hostname:/var/www/html#.ubuntu.com/ubuntu bionic/universe amd64 gitlab-runner amd64 10.5.0+dfsg-2                                     
  Connection failed [IP: xxx.xxx.xxx.xxx 80]
E: Failed to fetch http://xxx.xxxxxxx.ubuntu.com/ubuntu/pool/universe/g/gitlab-ci-multi-runner/gitlab-runner_10.5.0+dfsg-2_amd64.deb  Connection failed [IP: xxx.xxx.xxx.xxx 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
root@hostname:~#

3. Unfortunately, it is still not working. Following the advice to executing the command again with the alternative solution in the above output :

root@hostname:/var/www/html# apt -y install gitlab-runner --fix-missing
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  cdebootstrap debian-archive-keyring libdebian-installer-extra4 libdebian-installer4
Suggested packages:
  qemu-user-static docker.io
The following NEW packages will be installed:
  cdebootstrap debian-archive-keyring gitlab-runner libdebian-installer-extra4 libdebian-installer4
0 upgraded, 5 newly installed, 0 to remove and 32 not upgraded.
Need to get 7.561 kB/7.675 kB of archives.
After this operation, 32,8 MB of additional disk space will be used.
Err:1 http://xx.xxxxxxx.ubuntu.com/ubuntu bionic/universe amd64 gitlab-runner amd64 10.5.0+dfsg-2                                     
  Connection failed [IP: xxx.xxx.xxx.xxx 80]
Selecting previously unselected package libdebian-installer4:amd64.
(Reading database ... 273471 files and directories currently installed.)
Preparing to unpack .../libdebian-installer4_0.110ubuntu2_amd64.deb ...
Unpacking libdebian-installer4:amd64 (0.110ubuntu2) ...
Selecting previously unselected package libdebian-installer-extra4:amd64.
Preparing to unpack .../libdebian-installer-extra4_0.110ubuntu2_amd64.deb ...
Unpacking libdebian-installer-extra4:amd64 (0.110ubuntu2) ...
Selecting previously unselected package debian-archive-keyring.
Preparing to unpack .../debian-archive-keyring_2017.7ubuntu1_all.deb ...
Unpacking debian-archive-keyring (2017.7ubuntu1) ...
Selecting previously unselected package cdebootstrap.
Preparing to unpack .../cdebootstrap_0.7.7ubuntu2_amd64.deb ...
Unpacking cdebootstrap (0.7.7ubuntu2) ...
Setting up libdebian-installer4:amd64 (0.110ubuntu2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up debian-archive-keyring (2017.7ubuntu1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Setting up libdebian-installer-extra4:amd64 (0.110ubuntu2) ...
Setting up cdebootstrap (0.7.7ubuntu2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
E: Failed to fetch http://xxx.xxxxxxx.ubuntu.com/ubuntu/pool/universe/g/gitlab-ci-multi-runner/gitlab-runner_10.5.0+dfsg-2_amd64.deb  Connection failed [IP: xxx.xxx.xxx.xxx 80]
root@hostname:~ cd /root/

4. It is another failure. It is still not giving the correct result. To solve the problem, perform an alternative solution to download the package and install it manually :

root@hostname:~# wget http://xxx.xxxxxxx.ubuntu.com/ubuntu/pool/universe/g/gitlab-ci-multi-runner/gitlab-runner_10.5.0+dfsg-2_amd64.deb
--2018-11-14 09:59:25-- http://xxx.xxxxxxx.com/ubuntu/pool/universe/g/gitlab-ci-multi-runner/gitlab-runner_10.5.0+dfsg-2_amd64.deb
Resolving xxx.xxxxxxx.ubuntu.com (xxx.xxxxxxx.ubuntu.com)... xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx, ...
Connecting to xxx.xxxxxxx.ubuntu.com (xxx.xxxxxxx.ubuntu.com)|xxx.xxx.xxx.xxx|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7560632 (7,2M) [application/x-debian-package]
Saving to: ‘gitlab-runner_10.5.0+dfsg-2_amd64.deb’
gitlab-runner_10.5.0+dfsg-2_amd64 100%[============================================================>] 7,21M 355KB/s in 20s
2018-11-14 10:00:23 (372 KB/s) - ‘gitlab-runner_10.5.0+dfsg-2_amd64.deb’ saved [7560632/7560632]
root@hostname:~#

5. After successfully downloading the package, execute the package manually using the following command :

dpkg -i package_name.deb

Below is the command execution according to the above command pattern :

root@hostmame:~# dpkg -i gitlab-runner_10.5.0+dfsg-2_amd64.deb 
Selecting previously unselected package gitlab-runner.
(Reading database ... 273511 files and directories currently installed.)
Preparing to unpack gitlab-runner_10.5.0+dfsg-2_amd64.deb ...
Unpacking gitlab-runner (10.5.0+dfsg-2) ...
Setting up gitlab-runner (10.5.0+dfsg-2) ...
W: Docker is not available.
W: please run 'sudo /usr/lib/gitlab-runner/mk-prebuilt-images.sh' to generate Docker image.
Created symlink /etc/systemd/system/gitlab-ci-multi-runner.service → /lib/systemd/system/gitlab-runner.service.
Created symlink /etc/systemd/system/multi-user.target.wants/gitlab-runner.service → /lib/systemd/system/gitlab-runner.service.
Processing triggers for systemd (237-3ubuntu10.6) ...
Processing triggers for ureadahead (0.100.0-20) ...
root@hostname:~# sudo apt install apt-transport-https ca-certificates curl software-properties-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ca-certificates is already the newest version (20180409).
curl is already the newest version (7.58.0-2ubuntu3.5).
software-properties-common is already the newest version (0.96.24.32.5).
apt-transport-https is already the newest version (1.6.6).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
root@hostname:~#

Assuring all of the Gitlab Runner installation

Basically, this is just an additional part. If the gitlab-runner is running after the previous part then the execution of this part is unnecessary. In case the gitlab-runner is not working, this part may offer the correct solution.

1. Try to update the package again. Execute the command ‘apt-get update’ as follows :

root@hostname:~# apt-get update
Hit:1 http://ppa.launchpad.net/inkscape.dev/stable/ubuntu bionic InRelease
Ign:2 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:3 http://dl.google.com/linux/chrome/deb stable Release
Hit:5 http://ppa.launchpad.net/libreoffice/ppa/ubuntu bionic InRelease
Ign:6 http://pkg.jenkins.io/debian-stable binary/ InRelease
Hit:7 http://pkg.jenkins.io/debian-stable binary/ Release
Hit:8 http://xxx.xxxxxxx.ubuntu.com/ubuntu bionic InRelease
Hit:10 http://xxx.xxxxxxx.ubuntu.com/ubuntu bionic-updates InRelease
Hit:11 http://xxx.xxxxxxx.ubuntu.com/ubuntu bionic-backports InRelease
Hit:12 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:13 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu bionic InRelease
Reading package lists... Done
root@hostname:~#

2. Following the apt-get update process, execute the ‘apt-get upgrade’ as follows :

root@hostname:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
cdebootstrap debian-archive-keyring libdebian-installer-extra4 libdebian-installer4
Use 'apt autoremove' to remove them.
The following packages have been kept back:
linux-generic linux-headers-generic linux-image-generic
The following packages will be upgraded:
apport apport-gtk gettext gettext-base libgettextpo0 libglib2.0-0 libglib2.0-bin libglib2.0-data libnss-myhostname libnss-systemd
libpam-systemd libpython2.7 libpython2.7-dev libpython2.7-minimal libpython2.7-stdlib libsystemd0 libudev1 linux-libc-dev
linux-signed-generic python2.7 python2.7-dev python2.7-minimal python3-apport python3-problem-report shim-signed systemd
systemd-sysv ubuntu-drivers-common udev
29 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Need to get 41,8 MB of archives.
After this operation, 93,2 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://xxx.xxxxxxx.ubuntu.com/ubuntu bionic-updates/main amd64 libnss-systemd amd64 237-3ubuntu10.6 [105 kB]
....
Get:29 http://xxx.xxxxxxx.ubuntu.com/ubuntu bionic-updates/main amd64 shim-signed amd64 1.37~18.04.3+15+1533136590.3beb971-0ubuntu1 [344 kB]
Fetched 41,8 MB in 10min 27s (66,7 kB/s)
Preconfiguring packages ...
(Reading database ... 273511 files and directories currently installed.)
Preparing to unpack .../libnss-systemd_237-3ubuntu10.6_amd64.deb ...
Unpacking libnss-systemd:amd64 (237-3ubuntu10.6) over (237-3ubuntu10.4) ...
Preparing to unpack .../libsystemd0_237-3ubuntu10.6_amd64.deb ...
Unpacking libsystemd0:amd64 (237-3ubuntu10.6) over (237-3ubuntu10.4) ...
Setting up libsystemd0:amd64 (237-3ubuntu10.6) ...
(Reading database ... 273511 files and directories currently installed.)
Preparing to unpack .../libnss-myhostname_237-3ubuntu10.6_amd64.deb ...
Unpacking libnss-myhostname:amd64 (237-3ubuntu10.6) over (237-3ubuntu10.4) ...
Preparing to unpack .../libpam-systemd_237-3ubuntu10.6_amd64.deb ...
Unpacking libpam-systemd:amd64 (237-3ubuntu10.6) over (237-3ubuntu10.4) ...
Preparing to unpack .../systemd_237-3ubuntu10.6_amd64.deb ...
Unpacking systemd (237-3ubuntu10.6) over (237-3ubuntu10.4) ...
Preparing to unpack .../udev_237-3ubuntu10.6_amd64.deb ...
Unpacking udev (237-3ubuntu10.6) over (237-3ubuntu10.4) ...
Preparing to unpack .../libudev1_237-3ubuntu10.6_amd64.deb ...
Unpacking libudev1:amd64 (237-3ubuntu10.6) over (237-3ubuntu10.4) ...
Setting up libudev1:amd64 (237-3ubuntu10.6) ...
Setting up systemd (237-3ubuntu10.6) ...
(Reading database ... 273511 files and directories currently installed.)
Preparing to unpack .../00-systemd-sysv_237-3ubuntu10.6_amd64.deb ...
Unpacking systemd-sysv (237-3ubuntu10.6) over (237-3ubuntu10.4) ...
Preparing to unpack .../01-python2.7-dev_2.7.15~rc1-1ubuntu0.1_amd64.deb ...
Unpacking python2.7-dev (2.7.15~rc1-1ubuntu0.1) over (2.7.15~rc1-1) ...
Preparing to unpack .../02-libpython2.7-dev_2.7.15~rc1-1ubuntu0.1_amd64.deb ...
Unpacking libpython2.7-dev:amd64 (2.7.15~rc1-1ubuntu0.1) over (2.7.15~rc1-1) ...
Preparing to unpack .../03-libpython2.7_2.7.15~rc1-1ubuntu0.1_amd64.deb ...
Unpacking libpython2.7:amd64 (2.7.15~rc1-1ubuntu0.1) over (2.7.15~rc1-1) ...
Preparing to unpack .../04-python2.7_2.7.15~rc1-1ubuntu0.1_amd64.deb ...
Unpacking python2.7 (2.7.15~rc1-1ubuntu0.1) over (2.7.15~rc1-1) ...
Preparing to unpack .../05-libpython2.7-stdlib_2.7.15~rc1-1ubuntu0.1_amd64.deb ...
Unpacking libpython2.7-stdlib:amd64 (2.7.15~rc1-1ubuntu0.1) over (2.7.15~rc1-1) ...
Preparing to unpack .../06-python2.7-minimal_2.7.15~rc1-1ubuntu0.1_amd64.deb ...
Unpacking python2.7-minimal (2.7.15~rc1-1ubuntu0.1) over (2.7.15~rc1-1) ...
Preparing to unpack .../07-libpython2.7-minimal_2.7.15~rc1-1ubuntu0.1_amd64.deb ...
Unpacking libpython2.7-minimal:amd64 (2.7.15~rc1-1ubuntu0.1) over (2.7.15~rc1-1) ...
Preparing to unpack .../08-ubuntu-drivers-common_1%3a0.5.2.2_amd64.deb ...
Unpacking ubuntu-drivers-common (1:0.5.2.2) over (1:0.5.2.1) ...
Preparing to unpack .../09-libglib2.0-data_2.56.3-0ubuntu0.18.04.1_all.deb ...
Unpacking libglib2.0-data (2.56.3-0ubuntu0.18.04.1) over (2.56.2-0ubuntu0.18.04.2) ...
Preparing to unpack .../10-libglib2.0-bin_2.56.3-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libglib2.0-bin (2.56.3-0ubuntu0.18.04.1) over (2.56.2-0ubuntu0.18.04.2) ...
Preparing to unpack .../11-libglib2.0-0_2.56.3-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libglib2.0-0:amd64 (2.56.3-0ubuntu0.18.04.1) over (2.56.2-0ubuntu0.18.04.2) ...
Preparing to unpack .../12-gettext-base_0.19.8.1-6ubuntu0.1_amd64.deb ...
Unpacking gettext-base (0.19.8.1-6ubuntu0.1) over (0.19.8.1-6) ...
Preparing to unpack .../13-python3-problem-report_2.20.9-0ubuntu7.5_all.deb ...
Unpacking python3-problem-report (2.20.9-0ubuntu7.5) over (2.20.9-0ubuntu7.4) ...
Preparing to unpack .../14-python3-apport_2.20.9-0ubuntu7.5_all.deb ...
Unpacking python3-apport (2.20.9-0ubuntu7.5) over (2.20.9-0ubuntu7.4) ...
Preparing to unpack .../15-apport_2.20.9-0ubuntu7.5_all.deb ...
Unpacking apport (2.20.9-0ubuntu7.5) over (2.20.9-0ubuntu7.4) ...
Preparing to unpack .../16-apport-gtk_2.20.9-0ubuntu7.5_all.deb ...
Unpacking apport-gtk (2.20.9-0ubuntu7.5) over (2.20.9-0ubuntu7.4) ...
Preparing to unpack .../17-libgettextpo0_0.19.8.1-6ubuntu0.1_amd64.deb ...
Unpacking libgettextpo0:amd64 (0.19.8.1-6ubuntu0.1) over (0.19.8.1-6) ...
Preparing to unpack .../18-gettext_0.19.8.1-6ubuntu0.1_amd64.deb ...
Unpacking gettext (0.19.8.1-6ubuntu0.1) over (0.19.8.1-6) ...
Preparing to unpack .../19-linux-libc-dev_4.15.0-39.42_amd64.deb ...
Unpacking linux-libc-dev:amd64 (4.15.0-39.42) over (4.15.0-38.41) ...
Preparing to unpack .../20-linux-signed-generic_4.15.0.39.41_amd64.deb ...
Unpacking linux-signed-generic (4.15.0.39.41) over (4.15.0.38.40) ...
Preparing to unpack .../21-shim-signed_1.37~18.04.3+15+1533136590.3beb971-0ubuntu1_amd64.deb ...
Unpacking shim-signed (1.37~18.04.3+15+1533136590.3beb971-0ubuntu1) over (1.37~18.04.2+15+1533136590.3beb971-0ubuntu1) ...
Setting up libnss-systemd:amd64 (237-3ubuntu10.6) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for ureadahead (0.100.0-20) ...
Setting up libnss-myhostname:amd64 (237-3ubuntu10.6) ...
Setting up linux-signed-generic (4.15.0.39.41) ...
Processing triggers for install-info (6.5.0.dfsg.1-2) ...
Setting up systemd-sysv (237-3ubuntu10.6) ...
Setting up libglib2.0-0:amd64 (2.56.3-0ubuntu0.18.04.1) ...
Setting up linux-libc-dev:amd64 (4.15.0-39.42) ...
Setting up shim-signed (1.37~18.04.3+15+1533136590.3beb971-0ubuntu1) ...
Installing for x86_64-efi platform.
Installation finished. No error reported.
Setting up gettext-base (0.19.8.1-6ubuntu0.1) ...
Setting up python3-problem-report (2.20.9-0ubuntu7.5) ...
Setting up libgettextpo0:amd64 (0.19.8.1-6ubuntu0.1) ...
Setting up libglib2.0-data (2.56.3-0ubuntu0.18.04.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up udev (237-3ubuntu10.6) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for systemd (237-3ubuntu10.6) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for dbus (1.12.2-1ubuntu1) ...
Setting up libpython2.7-minimal:amd64 (2.7.15~rc1-1ubuntu0.1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Setting up libglib2.0-bin (2.56.3-0ubuntu0.18.04.1) ...
Setting up libpython2.7-stdlib:amd64 (2.7.15~rc1-1ubuntu0.1) ...
Setting up python2.7-minimal (2.7.15~rc1-1ubuntu0.1) ...
Setting up libpam-systemd:amd64 (237-3ubuntu10.6) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.1) ...
Setting up gettext (0.19.8.1-6ubuntu0.1) ...
Setting up python2.7 (2.7.15~rc1-1ubuntu0.1) ...
Setting up python3-apport (2.20.9-0ubuntu7.5) ...
Setting up ubuntu-drivers-common (1:0.5.2.2) ...
Setting up libpython2.7:amd64 (2.7.15~rc1-1ubuntu0.1) ...
Setting up apport (2.20.9-0ubuntu7.5) ...
apport-autoreport.service is a disabled or a static unit, not starting it.
Setting up libpython2.7-dev:amd64 (2.7.15~rc1-1ubuntu0.1) ...
Setting up python2.7-dev (2.7.15~rc1-1ubuntu0.1) ...
Setting up apport-gtk (2.20.9-0ubuntu7.5) ...
Processing triggers for initramfs-tools (0.130ubuntu3.5) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-38-generic
Processing triggers for libc-bin (2.27-3ubuntu1) ...
root@hostname:~#

3. After updating and upgrading all the package, just re-execute the installation process again as follows :

root@hostname:~# apt -y install gitlab-runner
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
docker.io
The following NEW packages will be installed:
gitlab-runner
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 7.561 kB of archives.
After this operation, 32,4 MB of additional disk space will be used.
Err:1 http://xxx.xxxxxxx.ubuntu.com/ubuntu bionic/universe amd64 gitlab-runner amd64 10.5.0+dfsg-2
Connection failed [IP: xxx.xxx.xxx.xxx 80]
E: Failed to fetch http://xxx.xxxxxxx.ubuntu.com/ubuntu/pool/universe/g/gitlab-ci-multi-runner/gitlab-runner_10.5.0+dfsg-2_amd64.deb Connection failed [IP: xxx.xxx.xxx.xxx 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
root@hostname~#
root@hostname~# dpkg -i gitlab-runner_10.5.0+dfsg-2_amd64.deb
Selecting previously unselected package gitlab-runner.
(Reading database ... 273511 files and directories currently installed.)
Preparing to unpack gitlab-runner_10.5.0+dfsg-2_amd64.deb ...
Unpacking gitlab-runner (10.5.0+dfsg-2) ...
Setting up gitlab-runner (10.5.0+dfsg-2) ...
W: Docker is not available.
W: please run 'sudo /usr/lib/gitlab-runner/mk-prebuilt-images.sh' to generate Docker image.
Created symlink /etc/systemd/system/gitlab-ci-multi-runner.service → /lib/systemd/system/gitlab-runner.service.
Created symlink /etc/systemd/system/multi-user.target.wants/gitlab-runner.service → /lib/systemd/system/gitlab-runner.service.
Processing triggers for systemd (237-3ubuntu10.6) ...
Processing triggers for ureadahead (0.100.0-20) ...
root@hostname:~#

4. Last but not least, start the gitlab-runner service and don’t forget to check the status of it :

root@hostname:~# systemctl start gitlab-runner
root@hostname:~# systemctl status gitlab-runner
● gitlab-runner.service - GitLab Runner
   Loaded: loaded (/lib/systemd/system/gitlab-runner.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-11-14 10:16:36 ; 1h 7min ago
 Main PID: 32583 (gitlab-runner)
    Tasks: 11 (limit: 4915)
   CGroup: /system.slice/gitlab-runner.service
           └─32583 /usr/bin/gitlab-runner run --working-directory /var/lib/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --syslog --user gitlab-runner
Nov 14 10:16:37 hostname gitlab-runner[32583]: time="2018-11-14T10:16:37+07:00" level=info msg="Starting multi-runner from /etc/gitlab-runner/config.toml ..." builds=0
Nov 14 10:16:37 hostname gitlab-runner[32583]: time="2018-11-14T10:16:37+07:00" level=info msg="Starting multi-runner from /etc/gitlab-runner/config.toml ..." builds=0
Nov 14 10:16:37 hostname gitlab-runner[32583]: time="2018-11-14T10:16:37+07:00" level=info msg="Running in system-mode."
Nov 14 10:16:37 hostname gitlab-runner[32583]: time="2018-11-14T10:16:37+07:00" level=info
Nov 14 10:16:37 hostname gitlab-runner[32583]: time="2018-11-14T10:16:37+07:00" level=info msg="Configuration loaded" builds=0
Nov 14 10:16:37 hostname gitlab-runner[32583]: time="2018-11-14T10:16:37+07:00" level=info msg="Metrics server disabled"
Nov 14 10:16:37 hostname gitlab-runner[32583]: time="2018-11-14T10:16:37+07:00" level=info msg="Running in system-mode."
Nov 14 10:16:37 hostname gitlab-runner[32583]: time="2018-11-14T10:16:37+07:00" level=info
Nov 14 10:16:37 hostname gitlab-runner[32583]: time="2018-11-14T10:16:37+07:00" level=info msg="Configuration loaded" builds=0
Nov 14 10:16:37 hostname gitlab-runner[32583]: time="2018-11-14T10:16:37+07:00" level=info msg="Metrics server disabled"
root@hostname:~# 

According to the output above, the installation of gitlab-runner is complete since the service is running.

Leave a Reply