Question

E: Unable to locate package gitlab-ce using Ubuntu 22

I am trying to install and setup gitlab on my digital ocean server Ubuntu 22. source added in gitlab_gitlab-ce.list. when I use command:

apt install gitlab-ce -y

it showing error : E: Unable to locate package gitlab-ce using Ubuntu 22 Please help me, I tried 10 times but giving same error.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
October 8, 2024

Hey! 👋

It looks like the GitLab repository might not be properly configured or there could be an issue with the source list for GitLab.

As per the official documentation here you need a few prerequisites and you should also not manually add the repository list.

  1. First, install necessary dependencies:

    sudo apt update
    sudo apt install -y curl openssh-server ca-certificates tzdata perl
    
  2. Next, download and install the GitLab repository package using the official script instead of manually adding the repository:

    curl -fsSL https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
    
  3. Now, try to install GitLab again:

    sudo apt install gitlab-ce
    

For further guidance, you can also refer to the official GitLab installation docs here:

GitLab Official Installation Guide

Let me know if this works or if you still run into any issues!

- Bobby

KFSys
Site Moderator
Site Moderator badge
October 10, 2024
  • Remove any previously added GitLab repositories: If you’ve manually added repositories or encountered issues before, it’s good to start fresh by removing any old repository configurations:
sudo rm /etc/apt/sources.list.d/gitlab_gitlab-ce.list
  • Update the package index: Before adding the repository again, make sure your package index is up to date:
sudo apt update
  • Add the GitLab repository: Follow these steps to ensure you’re adding the correct repository for GitLab:

    • Install the required dependencies:
sudo apt-get install -y curl openssh-server ca-certificates tzdata perl
-   Add the GitLab repository using the official GitLab installation method:
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
This will automatically configure the `gitlab-ce` repository and add the correct entries to your sources list for Ubuntu 22.
  • Install GitLab CE: Once the repository is correctly added, you can install GitLab CE by running:
sudo apt install gitlab-ce -y
  • Troubleshooting Repository Issues:

    • If you still encounter issues, check whether the repository is correctly listed in your sources list:
cat /etc/apt/sources.list.d/gitlab_gitlab-ce.list
-   Make sure that the correct distribution (e.g., `focal` for Ubuntu 20.04 or `jammy` for Ubuntu 22.04) is being referenced. If it’s incorrectly configured, you might need to adjust the distribution manually.
  • Check if the package is available: If you still get the error, try searching for the package:
apt-cache search gitlab-ce
This command will list all available GitLab packages, and if `gitlab-ce` is missing, there might be a repository misconfiguration.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.