GitLab(バージョンは、GitLab Community Edition 12.10.5)をaptでアップグレードしたところエラーになった。apt upgradeで発生したエラーは下記。
gitlab preinstall: It seems you are upgrading from major version 12 to major version 13. gitlab preinstall: It is required to upgrade to the latest 13.0.x version first before proceeding. gitlab preinstall: Please follow the upgrade documentation at https://docs.gitlab.com/ee/policy/maintenance.html#upgrade-recommendations dpkg: アーカイブ /var/cache/apt/archives/gitlab-ce_13.1.3-ce.0_amd64.deb の処理中にエラーが発生しました (--unpack): new gitlab-ce package pre-installation script subprocess returned error exit status 1 処理中にエラーが発生しました: /var/cache/apt/archives/gitlab-ce_13.1.3-ce.0_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
エラーの原因としては、メジャーバージョンアップがあり、段階的にバージョンアップをしないと、マイグレーションが行えないため、エラーになった。バージョンの12.10から13.1へのアップグレードには、間に13.0をはさんでから、アップグレードする必要があった。
アップグレードパスの参考:
https://docs.gitlab.com/ee/policy/maintenance.html#upgrade-recommendations
パッケージのバージョン情報:
https://packages.gitlab.com/gitlab/gitlab-ce
アップグレードパスを参考に、パッケージのバージョン情報をを調べて、upgradeのバージョンを指定する。そして、1段階ずつアップグレードしていく。
実行したコマンド
sudo apt update sudo apt upgrade gitlab-ce=13.0.9-ce.0 sudo apt upgrade gitlab-ce=13.1.3-ce.0 sudo gitlab-ctl restart