22

I tried to update my gitlab-CE from 10.3.2 to the latest one (currently the 11.4). And it gives me this honestly safe error.

[...]
gitlab preinstall: It seems you are upgrading from 10.x version series
gitlab preinstall: to 11.x series. It is recommended to upgrade
gitlab preinstall: to the last minor version in a major version series first before
gitlab preinstall: jumping to the next major version.
gitlab preinstall: Please follow the upgrade documentation at https://docs.gitlab.com/ee/policy/maintenance.html#upgrade-recommendations
gitlab preinstall: and upgrade to 10.8 first.
dpkg: error processing archive /var/cache/apt/archives/gitlab-ce_11.2.3-ce.0_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/gitlab-ce_11.2.3-ce.0_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

root@this-vm# apt-cache policy gitlab-ce | grep Installed
  Installed: 10.3.2-ce.0

But how to install to the latest minor version ? The documentation they are referring to, doesn't say how to do it. Do you guys encounter any problem like this ?

salvob
  • 1,300
  • 3
  • 21
  • 41

6 Answers6

45

Try to update to the latest minor version as suggested here:

apt-get update
apt-get install gitlab-ce=<YOUR-LATEST-MINOR-VERSION>-ce.0
gitlab-ctl reconfigure
gitlab-ctl restart

In your case latest minor is: 10.8.6 [as of today].

You can check the release list. Remember to check the changes between your initial and target versions.

ggagliano
  • 1,004
  • 1
  • 11
  • 27
  • In my case no need to run gitlab-ctl reconfigure because the install does it automatically "Reconfiguring GitLab to apply migrations" – ReaperSoon Dec 07 '19 at 02:02
  • 1
    You can also see the different release and find which one you want using $ apt update && apt show gitlab-ce -a. – Tic Dec 16 '19 at 14:17
6

For CentOS/RHEL reference:

To install minor version on (CentOS/RHEL). Follow below steps.

To update minor version on 11.xx to latest version of 11.11.5:

sudo yum install gitlab-ce-11.11.5-ce.0.el6.x86_64

Similarly for all other version, You can find the specific version/install command you need to use at https://packages.gitlab.com/gitlab/gitlab-ce. Search for a version string such as gitlab-ce-11. Click on the RPM or Deb package for your OS version, then you will see all version of gitlab where you can findout latest version name and install it as stated above but just replace it with your minor version name i,e. gitlab-ce-11.11.5-ce.0.el6.x86_64

Upgrading from one version to another version should be followed as per the recommendation below or official page here.

12.7.5 -> 12.10.5
11.3.4 -> 11.11.1
10.6.6 -> 10.8.3
11.3.4 -> 11.11.8
10.6.6 -> 10.8.7
9.2.3 -> 9.5.5
8.9.4 -> 8.12.3 

Always recommended that first upgrade to the latest available minor version within your major version and then upgrade it next stable version.

Mohamed Ayas
  • 71
  • 1
  • 4
1

I was trying to update our existing gitlab-ce version 11.2.1 to latest gitlab-ce 12.2.0. After installing the 12.2.0 using yum update when I tried gitlab-ctl reconfigure. I got the error saying you need to install gitlab 11.0.0 first.

So, I removed the gitlab 12.2.0 and installed the 11.0.0 version using

yum remove gitlab-ce-12.2.0-ce.0.el7.x86_64.rpm
wget https://ftp.sjtu.edu.cn/sites/gitlab-ce/yum/el7/gitlab-ce-11.11.0-ce.0.el7.x86_64.rpm
rpm -Uvh gitlab-ce-11.11.0-ce.0.el7.x86_64.rpm
gitlab-ctl reconfigure
sudo gitlab-ctl restart

The process was successful, My old data was there and I could login with my old credentials. The version in front-end was showing 11.0.0. Now to get to latest version I did

gitlab-ctl stop
yum remove gitlab-ce-11.11.0-ce.0.el7.x86_64.rpm
wget https://ftp.sjtu.edu.cn/sites/gitlab-ce/yum/el7/gitlab-ce-12.2.0-ce.0.el7.x86_64.rpm
rpm -Uvh gitlab-ce-12.2.0-ce.0.el7.x86_64.rpm
gitlab-ctl reconfigure
gitlab-ctl restart

I got on version 12 but then I got another error the alermanager service was not starting so I added the following block to /etc/gitlab/gitlab.rb

alertmanager['flags'] = {
  'cluster.advertise-address' => "127.0.0.1:9093",
}

I restarted the gitlab and everything was running.

gitlab-ctl restart
Dr. Mian
  • 3,334
  • 10
  • 45
  • 69
0
`enter code here`Check the latest version
1.sudo gitlab-rake gitlab:env:info:If it is above 13.12.0 then proceed with step 3.If its below please follow serially.
2."sudo apt upgrade gitlab-ee=13.12.5-ee.0": Update to any version of 13.12.x.
3.sudo apt-get update
4.sudo apt-get install gitlab-ee
0

Improving this answer, if you need to install/update manually, all you have to do is:

  1. Download the required package here https://packages.gitlab.com/gitlab/gitlab-ee/
  2. Run rpm -Uvh packageName.rpm
  3. gitlab-ctl reconfigure
  4. gitlab-ctl restart
  5. You are good to go.
barmyman
  • 63
  • 7
0

A useful tool now exists that a allows you to set the current and desired version. The tool then tells you the intervening versions you need to install in order to upgrade (please note that you Must apply the versions in a specific order as some updates make database changes later updates rely upon)

Link to Gitlab upgrade path