Cannot add GitLab public key during installation

Hi all, I’ve spent over an hour trying to solve this so I figured it was time to ask for help.

Just to give some background in case it matters, I have a PC running Windows 10 and installed GitLab so I could host a blog. I had no issues at all with that.

About a month ago, I wanted to try out Ubuntu so installed it as a dual-boot option and so far am loving it. In fact, I found myself rarely booting into Windows any more so I wanted to install GitLab on Ubuntu and use it for working on my blog. Again, not sure if it matters, but I already have Github installed for work and use SSH.

I’ve followed the installation guide but when I get to the part where I need to run the following command:

sudo apt install gitlab-ee

I get the following output:

Reading package lists... Done
Building dependency tree    
Reading state information... Done
E: Unable to locate package gitlab-ee

I thought that the repository needed to be updated so ran sudo apt update but received the following:

Get:8 https://packages.gitlab.com/gitlab/gitlab-ee/ubuntu focal InRelease [23.3 kB]
Err:8 https://packages.gitlab.com/gitlab/gitlab-ee/ubuntu focal InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3F01618A51312F3F
Reading package lists... Done
W: GPG error: https://packages.gitlab.com/gitlab/gitlab-ee/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3F01618A51312F3F
E: The repository 'https://packages.gitlab.com/gitlab/gitlab-ee/ubuntu focal InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

I did some research and it appears that I just need to add the public key but I’ve tried a variety of approaches and the output I always get is as follows:

Executing: /tmp/apt-key-gpghome.9BBxce7cwo/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 3F01618A51312F3F
gpg: key 3F01618A51312F3F: public key "GitLab B.V. (package repository signing key) <packages@gitlab.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: invalid key resource URL '/etc/apt/trusted.gpg.d/home:ungoogled_chromium.gpg'
gpg: keyblock resource '(null)': General error
gpg: key 02456C79B2FD48BF: 1 signature not checked due to a missing key
gpg: key 3B4FE6ACC0B21F32: 3 signatures not checked due to missing keys
gpg: key D94AA3F0EFE21092: 3 signatures not checked due to missing keys
gpg: key 871920D1991BC93C: 1 signature not checked due to a missing key
gpg: Total number processed: 8
gpg:       skipped new keys: 8

Anyone happen to have any ideas how to fix this? Does this maybe have something to do with the fact that I have Github installed already?

Any advice/suggestions would be greatly appreciated.

Try this command from the install docs as it should do all that for you:

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash

Hi @iwalker,

Thanks for the info.

I have same issue that need to solve, gone through your suggestion But still i am not able add the repository with curl. Any alternative troubleshoot steps to perform to success?

@vamzekr25 seems to have 0 bytes for download, is there a local firewall on the server, or in between your server and internet that is filtering connections? The fact that the time columns are also blank hints that a connection hasn’t even been made to the server to be even able to download anything.

You will need to check your network configuration, DNS etc, to make sure everything is working properly for a start. Try this also:

[ian@elise ~]$ telnet packages.gitlab.com 443
Trying 104.18.26.123...
Connected to packages.gitlab.com.
Escape character is '^]'.
^]

if you get connected, then the outgoing connection has been made, and curl should work to download the file.