Install gitlab-ce 12.9.2 on Ubuntu 20.04 LTS - Version '12.9.2' for 'gitlab-ce' was not found

Hello together,

Because my old gitlab server is broken I’m trying to setup a new server. To be able to restore the backups I have to install version 12.9.2 first and then upgrade to the current version.

I executed the following commands on my server:

apt-get install -y curl openssh-server ca-certificates tzdata perl

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

apt-get update

EXTERNAL_URL=“https://gitlab.MYHOST.de” apt-get install gitlab-ce=12.9.2
EXTERNAL_URL=“https://gitlab.MYHOST.de” apt-get install gitlab-ce=12.9.2-ce.0

But I get always the following message:

Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Version ‘12.9.2’ for ‘gitlab-ce’ was not found

The content of /etc/apt/sources.list.d/gitlab_gitlab-ce.list (cat /etc/apt/sources.list.d/gitlab_gitlab-ce.list) is:

this file was generated by packages.gitlab.com for

the repository at gitlab/gitlab-ce - Packages · packages.gitlab.com

deb https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ focal main
deb-src https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ focal main

I planned to do the following update path by installing first version 12.9.2, restoring the backups and then running apt-get install gitlab-ce=[next_version]

12.9.2 → 12.10.14 → 13.0.14 → 13.1.11 → 13.8.8 → 13.12.10

Do you know what command I have to run to add the missing resources / packages / lists?
Is it basically possible to install version 12.9.2 on Ubuntu 20.04 LTS?

I’d be happy about every help. :slight_smile:

Thank you and best regards,

Alex

That’s probably because it doesn’t exist for Ubuntu 20.04:

best bet, edit /etc/apt/sources.list.d/gitlab_gitlab-ce.list and replace focal with bionic and then install 12.9.2 and continue with your upgrade process after that. Once you get to 13.2.x you can then edit the file again and change bionic back to focal.

Your other alternative, is install Ubuntu 18.04 and then install the package, then later upgrade to 20.04 once you’re able to install/update to a version that is available for 20.04 Focal - from this link: gitlab/gitlab-ce - Results for 'gitlab-ce' and focal in gitlab/gitlab-ce (Page 2) once you are at 13.2.x.

Hi Ian,
Thank you very much for your reply and sorry for my late answer!
I tried to edit the /etc/apt/sources.list.d/gitlab_gitlab-ce.list with the following command

sed -i ‘s/focal/bionic/g’ /etc/apt/sources.list.d/gitlab_gitlab-ce.list

and made apt-get update afterwards. Unfortunatelly this did not work our eighter :slight_smile:

But your answer helps me a lot. I’ll do the following:

  • Install Ubuntu 18.04
  • Install gitlab using the following commands:

apt-get install -y curl openssh-server ca-certificates tzdata perl

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

apt-get update

EXTERNAL_URL=“https://gitlab.MYHOST.de” apt-get install gitlab-ce=12.9.2-ce.0

  • Try to restore my backups
  • Upgrade to the newest version using apt-get install with the versions (following the version path)

Thank you very much and best regards,

Alex

Hi Ian and everyone,
Please find attached all commands I used to restore my gitlab instance:

# Install gitlab with same version for which backups have been made (here 12.9.2. on Ubuntu 18.04)

# install required packages
apt-get install -y curl openssh-server ca-certificates tzdata perl

# add repo url 
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

# install gitlab with specific version
EXTERNAL_URL="https://gitlab.MYDOMAIN.de" apt-get install gitlab-ce=12.9.2-ce.0

# Copy backups from backup server to gitlab server

# login to backup server
ssh user@backup.MYDOMAIN.de
# go to backup dir
cd /home/user/backups
# copy backup to new git server
scp [lastbackupfile] user@gitlab.MYDOMAIN.de:/home/user/

# restore backups

# login to new server
ssh user@gitlab.MYDOMAIN.de
su

# switch to directory of backups
cd /home/user/

# unpack backup
tar -xvzf ./20211016_gitlab_backup.tar.gz

# copy backup to default backup location
cp ./home/user/gitlab_backup/1634338897_2021_10_16_12.9.2_gitlab_backup.tar /var/opt/gitlab/backups/

# change user
chown git.git /var/opt/gitlab/backups/1634338897_2021_10_16_12.9.2_gitlab_backup.tar

# stop services 
gitlab-ctl stop puma
gitlab-ctl stop sidekiq

# check if services have been stopped
gitlab-ctl status

# restore backup
gitlab-backup restore BACKUP=1634338897_2021_10_16_12.9.2

# restore gitlab-secrets file
cp ./home/user/gitlab_backup/gitlab-secrets.json /etc/gitlab/gitlab-secrets.json

# reconfigure gitlab
gitlab-ctl reconfigure

# restart everything
gitlab-ctl restart

# check gitlab
gitlab-rake gitlab:check SANITIZE=true