How to install glab CLI for GitLab on Ubuntu using apt?
Step 1: Add the GitLab package repository GPG key
The first step is to add the GitLab package repository GPG key to your system's trusted keys. This can be done using the following command:
curl -L https://packages.gitlab.com/glab/glab/gpgkey | sudo apt-key add -
Step 2: Add the GitLab package repository to your system's package sources list
The next step is to add the GitLab package repository to your system's package sources list. You can do this by running the following command:
sudo curl -o /etc/apt/sources.list.d/glab.list https://packages.gitlab.com/glab/glab/ubuntu/$(lsb_release -cs)/glab.list
Step 3: Update your package list
Once you've added the GitLab package repository to your system's package sources list, you'll need to update your package list to include the newly added repository. You can do this using the following command:
sudo apt update
Step 4: Install the glab CLI package
With the package repository added and the package list updated, you can now install the glab CLI package using apt. To do this, run the following command:
sudo apt install glab
Step 5: Verify the installation
Finally, you can verify that the glab CLI was installed successfully by running the following command:
glab version
This should display the version number of the glab CLI that you just installed.
Single code block:
curl -L https://packages.gitlab.com/glab/glab/gpgkey | sudo apt-key add -
sudo curl -o /etc/apt/sources.list.d/glab.list https://packages.gitlab.com/glab/glab/ubuntu/$(lsb_release -cs)/glab.list
sudo apt update
sudo apt install -y glab
glab version
Top comments (2)
hi I have issue with step 1 and step 2:
Please see the commands and their results below
Can you advise please?
I'm also seeing the same problem. Just running
curl -L https://packages.gitlab.com/glab/glab/gpgkey
gives meIncorrect username or API token
, so it doesn't seem the package source can be used this way.