ubuntugitlab-ce

could not Gitlab-CE upgradde from 16.2 to 16.4


I have to upgrade gitlab-ce version from 16.2 to 16.4 in ubuntu 22.04. but I received below error:

(Reading database ... 230526 files and directories currently installed.)
Preparing to unpack .../gitlab-ce_16.4.1-ce.0_amd64.deb ...
gitlab preinstall: It seems you are upgrading from 16.2 to 16.4.
gitlab preinstall: It is required to upgrade to the latest 16.3.x version first before proceeding.
gitlab preinstall: Please follow the upgrade documentation at https://docs.gitlab.com/ee/update/index.html#upgrade-paths
dpkg: error processing archive /var/cache/apt/archives/gitlab-ce_16.4.1-ce.0_amd64.deb (--unpack):
 new gitlab-ce package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/gitlab-ce_16.4.1-ce.0_amd64.deb
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

Solution

  • Edit /etc/gitlab/gitlab.rb (or appropriate path) Edit the grafana[enable] value to be false. On my config this was on line 1689, but I recommend you search for the string grafana to find it.

    grafana['enable'] = false

    Reconfigure GitLab by running gitlab-ctl reconfigure. Let this run and it should end with gitlab Reconfigured!

    You can now resume the apt update that failed due to having Grafana enabled.