タグ: Ubuntu

  • PHPのバージョンアップしたら、Nginxが起動しなくなった

    Ubuntu 18.04で、PHPをPHP7.2からPHP7.4にアップデートしたところ、作業後にOSを再起動したら、Nginxが起動しなくなった。原因を調べて対処したので、メモを残す。

    Nginxのステータスを確認したところ。

    ubuntu@ip-10-0-0-122:/etc/nginx$ sudo service nginx status
    ● nginx.service - A high performance web server and a reverse proxy server
       Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
       Active: failed (Result: exit-code) since Wed 2020-10-14 22:35:23 PDT; 5s ago
         Docs: man:nginx(8)
      Process: 1296 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
    Oct 14 22:35:23 ip-10-0-0-122 systemd[1]: Starting A high performance web server and a reverse proxy server...
    Oct 14 22:35:23 ip-10-0-0-122 nginx[1296]: nginx: [emerg] "try_files" directive is duplicate in /etc/nginx/sites-enabled
    Oct 14 22:35:23 ip-10-0-0-122 nginx[1296]: nginx: configuration file /etc/nginx/nginx.conf test failed
    Oct 14 22:35:23 ip-10-0-0-122 systemd[1]: nginx.service: Control process exited, code=exited status=1
    Oct 14 22:35:23 ip-10-0-0-122 systemd[1]: nginx.service: Failed with result 'exit-code'.
    Oct 14 22:35:23 ip-10-0-0-122 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
    ubuntu@ip-10-0-0-122:/etc/nginx$
    

    PHP7.4にアップデートしたタイミングで、Apacheがインストールされて、これが自動起動しており、Nginxと、ポート80の使用が競合して、Nginxが落ちていた。apache2の自動起動を停止する。

    sudo systemctl disable apache2
    

    それでも、まだ、Nginxの起動でエラーになる。ログを見ると、コンフィグの問題のようなので、configtestを実施し、見事にエラーになる。

    ubuntu@ip-10-0-0-122:/etc/nginx/sites-available$ sudo service nginx configtest
     * Testing nginx configuration                                                                                   [fail]
    ubuntu@ip-10-0-0-122:/etc/nginx/sites-available$
    

    Nginxのコンフィグのdefaultで、php7.2-fpmの部分を、php7.4-fpmのsockに書き換え。

    その後、Nginxの起動を試すが失敗。Nginxのコンフィグチェックを行って、エラーになっている行を特定。

    sudo nginx -t
    nginx: [emerg] "try_files" directive is duplicate in /etc/nginx/sites-enabled/default:77
    nginx: configuration file /etc/nginx/nginx.conf test failed
    

    “try_files” がダブっているというので、場所を確認して、変更した。なぜ、急にエラーになったのか、はあるが、とりあえず、スルー。修正後は、Nginxが無事に起動した。

    最初のStatusのログをみると、最初から”try_files ”が問題って書いてあった。おちついて、見る必要あり。

  • UbuntuのPHPを7.2から、7.4にしてみた

    Ubuntu 18.04のPHPをPHP7.2からPHP7.4に上げた。PHPを使っているのは、Wordpress。そのメモ。でも、途中が消えてる気がする、というか消えてる。

    ubuntu@ip-10-0-0-122:~$ php -v
    PHP 7.2.24-0ubuntu0.18.04.7 (cli) (built: Oct  7 2020 15:24:25) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.2.24-0ubuntu0.18.04.7, Copyright (c) 1999-2018, by Zend Technologies
    ubuntu@ip-10-0-0-122:~$
    ubuntu@ip-10-0-0-122:~$ sudo apt install software-properties-common
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    software-properties-common is already the newest version (0.96.24.32.14).
    software-properties-common set to manually installed.
    The following packages were automatically installed and are no longer required:
      libdumbnet1 libnginx-mod-http-geoip libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter libnginx-mod-mail
      libnginx-mod-stream linux-aws-5.3-headers-5.3.0-1017 linux-aws-5.3-headers-5.3.0-1019
      linux-aws-5.3-headers-5.3.0-1023 linux-aws-5.3-headers-5.3.0-1028 linux-aws-5.3-headers-5.3.0-1030
      linux-aws-5.3-headers-5.3.0-1032 linux-aws-5.3-headers-5.3.0-1033 linux-aws-5.3-headers-5.3.0-1034
      linux-aws-5.3-headers-5.3.0-1035 linux-aws-headers-4.15.0-1041 linux-aws-headers-4.15.0-1043
      linux-aws-headers-4.15.0-1044 linux-aws-headers-4.15.0-1045 linux-aws-headers-4.15.0-1047
      linux-aws-headers-4.15.0-1048 linux-aws-headers-4.15.0-1050 linux-aws-headers-4.15.0-1052
      linux-aws-headers-4.15.0-1054 linux-aws-headers-4.15.0-1056 linux-aws-headers-4.15.0-1057
      linux-aws-headers-4.15.0-1058 linux-aws-headers-4.15.0-1060 linux-aws-headers-4.15.0-1063
      linux-aws-headers-4.15.0-1065 linux-headers-5.3.0-1035-aws linux-image-5.3.0-1035-aws linux-modules-5.3.0-1035-aws
      nginx-common nginx-core
    Use 'sudo apt autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    ubuntu@ip-10-0-0-122:~$
    ubuntu@ip-10-0-0-122:~$
    ubuntu@ip-10-0-0-122:~$
    ubuntu@ip-10-0-0-122:~$ sudo add-apt-repository ppa:ondrej/php
     Co-installable PHP versions: PHP 5.6, PHP 7.x and most requested extensions are included. Only Supported Versions of PHP (http://php.net/supported-versions.php) for Supported Ubuntu Releases (https://wiki.ubuntu.com/Releases) are provided. Don't ask for end-of-life PHP versions or Ubuntu release, they won't be provided.
    Debian oldstable and stable packages are provided as well: https://deb.sury.org/#debian-dpa
    You can get more information about the packages at https://deb.sury.org
    IMPORTANT: The -backports is now required on older Ubuntu releases.
    BUGS&FEATURES: This PPA now has a issue tracker:
    https://deb.sury.org/#bug-reporting
    CAVEATS:
    1. If you are using php-gearman, you need to add ppa:ondrej/pkg-gearman
    2. If you are using apache2, you are advised to add ppa:ondrej/apache2
    3. If you are using nginx, you are advised to add ppa:ondrej/nginx-mainline
       or ppa:ondrej/nginx
    PLEASE READ: If you like my work and want to give me a little motivation, please consider donating regularly: https://donate.sury.org/
    WARNING: add-apt-repository is broken with non-UTF-8 locales, see
    https://github.com/oerdnj/deb.sury.org/issues/56 for workaround:
    # LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
     More info: https://launchpad.net/~ondrej/+archive/ubuntu/php
    Press [ENTER] to continue or Ctrl-c to cancel adding it.
    Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu bionic InRelease
    Get:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
    Get:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
    Get:4 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease [20.8 kB]
    Get:5 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
    Get:6 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main amd64 Packages [71.9 kB]
    Get:7 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main Translation-en [29.5 kB]
    Fetched 374 kB in 1s (398 kB/s)
    Reading package lists... Done
    ubuntu@ip-10-0-0-122:~$
    ubuntu@ip-10-0-0-122:~$
    ubuntu@ip-10-0-0-122:~$ sudo apt update
    Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu bionic InRelease
    Get:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
    Get:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
    Hit:4 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease
    Hit:5 http://security.ubuntu.com/ubuntu bionic-security InRelease
    Fetched 163 kB in 0s (399 kB/s)
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    20 packages can be upgraded. Run 'apt list --upgradable' to see them.
    ubuntu@ip-10-0-0-122:~$
    ubuntu@ip-10-0-0-122:~$ php -v
    PHP 7.4.11 (cli) (built: Oct 10 2020 19:44:50) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
        with Zend OPcache v7.4.11, Copyright (c), by Zend Technologies
    ubuntu@ip-10-0-0-122:~$
    

    このあと、Nginxのコンフィグで、php7.2-fpmからphp7.4-fpmに指定を変更して、Nginxを再起動。

    WordPressにアクセスしたら、php7.4-mysqlが入っていないと言われ、使えず。aptでインストールする。

    sudo apt install php7.4-mysql

    そのあと、Wordpressのヘルスチェックを確認。gdもないというので、aptでインストール。

    sudo apt install php7.4-gd

    これでバージョンアップは終わり。

  • apt autoremoveしたら

    aptで、個別にパッケージをdeleteしていたら、autoremoveしろと表示されたので、実行した。

    sudo apt autoremove
    

    その結果、概ね、不必要なパッケージは削除されたが、実際にサービスとして使っているパッケージも削除された。急に使えなくなったので、コマンドを調べたら存在せず。結局、もう一度、apt install した。こういうこともあるので、apt autoremove したら、機能確認はしよう。

  • LinuxでわざとCPU負荷をかける方法

    Linuxで、CPU監視などのテストで、わざとCPU負荷をかける方法。ターミナルで、下記のコマンドを実行する。

    yes > /dev/null

    これで1コア分のCPUを無駄に100%使用する。複数のコアがある場合には、その数だけ、実行することで負荷のテストができる。止めるときは、Ctrl+Cで。

    なお、同じコマンドでMac OS Xでも、負荷をかけることができる。

  • GitLabをaptでアップグレードしたところエラーになった

    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
    
  • CANVAS LMSで、メール送信設定を変更したら、エラーでサイトが表示されなくなった

    Bitnami のCANVAS LMSで、メール送信のためのSMTP設定を変更して、再起動したところ、ウェブ画面で下記のエラーが表示された。

    Error ID:
    079f6a97
    Details:
    Web application could not be started by the Phusion Passenger application server.
    
    Please read the Passenger log file (search for the Error ID) to find the details of the error.
    
    You can also get a detailed report to appear directly on this page, but for security reasons it is only provided if Phusion Passenger is run with environment set to development and/or with the friendly error pages option set to on.
    
    For more information about configuring environment and friendly error pages, see:
    

    ログファイル: ApacheのErrorログファイル

    App 1947 output:     /opt/canvaslms-2020.06.17.20-0/ruby/lib/ruby/gems/2.4.0/gems/passenger-5.3.7/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:380:in `run_block_and_record_step_progress'
    App 1947 output:     /opt/canvaslms-2020.06.17.20-0/ruby/lib/ruby/gems/2.4.0/gems/passenger-5.3.7/src/helper-scripts/rack-preloader.rb:188:in `'
    App 1947 output:     /opt/canvaslms-2020.06.17.20-0/ruby/lib/ruby/gems/2.4.0/gems/passenger-5.3.7/src/helper-scripts/rack-preloader.rb:30:in `'
    App 1947 output:     /opt/canvaslms-2020.06.17.20-0/ruby/lib/ruby/gems/2.4.0/gems/passenger-5.3.7/src/helper-scripts/rack-preloader.rb:29:in `
    ' [ E 2020-07-02 05:39:09.0597 1396/Tq age/Cor/App/Implementation.cpp:221 ]: Could not spawn process for application /opt/canvaslms-2020.06.17.20-0/apps/canvaslms/htdocs/: The application encountered the following error: Permission denied @ rb_sysopen - /opt/canvaslms-2020.06.17.20-0/apps/canvaslms/htdocs/config/outgoing_mail.yml (Errno::EACCES) Error ID: 079f6a97 Error details saved to: /tmp/passenger-error-eo0uMM.html [ E 2020-07-02 05:39:09.0624 1396/T8 age/Cor/Con/CheckoutSession.cpp:276 ]: [Client 1-4] Cannot checkout session because a spawning error occurred. The identifier of the error is 079f6a97. Please see earlier logs for details about the error. [ E 2020-07-02 05:39:09.0631 1396/T8 age/Cor/Con/CheckoutSession.cpp:276 ]: [Client 1-5] Cannot checkout session because a spawning error occurred. The identifier of the error is 079f6a97. Please see earlier logs for details about the error.

    原因と対応としては、編集のために、設定ファイルのコピーして編集したことによるグループの変更およびパーミッションだった。

    他の設定ファイルと同様のグループおよびファイルオーナーに、chown、chgrpで変更。そして、パーミッションがもともと、440だったので、440で再設定した。その後、再起動したところ、正常に表示できるようになった。また、YAMLの設定ファイルの内容で失敗しても、画面上は同じ感じのエラーが表示されるので、注意。

  • Bitnami Canvas LMS Stack をインストール

    Ubuntu Server 20.04に、Bitnami Canvas LMS Stackをインストールしてみた。Canvas LMSの使い勝手や設定を見たかっただけなので、お手軽にインストールできる環境で、構築。

    手順

    1. Bitnamiのサイトからダウンロードする
    https://bitnami.com/stack/canvaslms/installer

    2. ダウンロードしたファイルを、セットアップするサーバにアップロードする

    3. パーミッションをかえて、実行できるようにする

    chmod 755 bitnami-canvaslms-2020.06.17.20-0-linux-x64-installer.run
    

    4. インストーラーを実行する

    sudo ./bitnami-canvaslms-2020.06.17.20-0-linux-x64-installer.run
    

    5. CLIのウィザード形式で、いろいろと聞かれるので、答えていく。

    6. ウィザードの質問に答え終わると、インストールが始まる。CPUを1つにしたためか、とても長い。30分くらいかった。

    7. Canvas LMSのディレクトリに移動

    cd /opt/canvaslms-2020.06.17.20-0
    

    8. Canvas LMSを起動する

    sudo ./ctlscript.sh start
    

    9. サイトにアクセスする
    ユーザIDとパスワードは、ウィザードで入力したメールアドレスとパスワード。

    ページ: 1 2

  • Moodleのgitリポジトリをクローンしたところ、拒否された

    Moodleをインストールするために、Gitリポジトリをクローンしようとしたしたところ、「git.moodle.org[0: 34.210.133.53]: errno=接続を拒否されました」と表示された。

    sudo git clone git://git.moodle.org/moodle.git
    Cloning into 'moodle'...
    fatal: unable to connect to git.moodle.org:
    git.moodle.org[0: 34.210.133.53]: errno=接続を拒否されました
    

    で、対処としては、github上のリポジトリから取得するようにした。これで、接続拒否のエラーは解消。

    sudo git clone https://github.com/moodle/moodle.git

    下記は、作業時のログ。

    zen@moodle:/opt$ sudo git clone git://git.moodle.org/moodle.git
    Cloning into 'moodle'...
    fatal: unable to connect to git.moodle.org:
    git.moodle.org[0: 34.210.133.53]: errno=接続を拒否されました
    
    zen@moodle:/opt$
    zen@moodle:/opt$
    zen@moodle:/opt$
    zen@moodle:/opt$
    zen@moodle:/opt$ ls
    zen@moodle:/opt$
    zen@moodle:/opt$
    zen@moodle:/opt$ git clone https://github.com/moodle/moodle.git
    fatal: could not create work tree dir 'moodle': 許可がありません
    zen@moodle:/opt$ sudo git clone https://github.com/moodle/moodle.git
    Cloning into 'moodle'...
    remote: Enumerating objects: 7, done.
    remote: Counting objects: 100% (7/7), done.
    remote: Compressing objects: 100% (7/7), done.
    remote: Total 1163958 (delta 0), reused 0 (delta 0), pack-reused 1163951
    Receiving objects: 100% (1163958/1163958), 536.89 MiB | 22.33 MiB/s, done.
    Resolving deltas: 100% (812431/812431), done.
    Updating files: 100% (21140/21140), done.
    zen@moodle:/opt$ ls
    moodle
    zen@moodle:/opt$
    
    
    zen@moodle:/opt/moodle$ sudo git branch -a
    * master
      remotes/origin/HEAD -> origin/master
      remotes/origin/MOODLE_13_STABLE
      remotes/origin/MOODLE_14_STABLE
      remotes/origin/MOODLE_15_STABLE
      remotes/origin/MOODLE_16_STABLE
      remotes/origin/MOODLE_17_STABLE
      remotes/origin/MOODLE_18_STABLE
      remotes/origin/MOODLE_19_STABLE
      remotes/origin/MOODLE_20_STABLE
      remotes/origin/MOODLE_21_STABLE
      remotes/origin/MOODLE_22_STABLE
      remotes/origin/MOODLE_23_STABLE
      remotes/origin/MOODLE_24_STABLE
      remotes/origin/MOODLE_25_STABLE
      remotes/origin/MOODLE_26_STABLE
      remotes/origin/MOODLE_27_STABLE
      remotes/origin/MOODLE_28_STABLE
      remotes/origin/MOODLE_29_STABLE
      remotes/origin/MOODLE_30_STABLE
      remotes/origin/MOODLE_31_STABLE
      remotes/origin/MOODLE_32_STABLE
      remotes/origin/MOODLE_33_STABLE
      remotes/origin/MOODLE_34_STABLE
      remotes/origin/MOODLE_35_STABLE
      remotes/origin/MOODLE_36_STABLE
      remotes/origin/MOODLE_37_STABLE
      remotes/origin/MOODLE_38_STABLE
      remotes/origin/master
    zen@moodle:/opt/moodle$
    zen@moodle:/opt/moodle$
    zen@moodle:/opt/moodle$ sudo git branch --track MOODLE_38_STABLE origin/MOODLE_38_STABLE
    Branch 'MOODLE_38_STABLE' set up to track remote branch 'MOODLE_38_STABLE' from 'origin'.
    zen@moodle:/opt/moodle$
    zen@moodle:/opt/moodle$
    zen@moodle:/opt/moodle$
    zen@moodle:/opt/moodle$ sudo git checkout MOODLE_38_STABLE
    Switched to branch 'MOODLE_38_STABLE'
    Your branch is up to date with 'origin/MOODLE_38_STABLE'.
    zen@moodle:/opt/moodle$
    

  • WSLをWSL2に更新する

    WSLをWSL2に更新したので、そのときの作業メモ。

    1. 下記のURLにアクセスする
    https://docs.microsoft.com/ja-jp/windows/wsl/wsl2-kernel

    2. 「最新の WSL2 Linux カーネル更新プログラム パッケージをダウンロード」のリンクをクリックする。(wsl_update_x64.msiがダウンロードされた)

    3. ダウンロードしたMSIファイルを実行する

    4. 特権ユーザの確認が求められるので、許可する。

    5. 「Finish」をクリックする

    6. Powershellで以下のコマンドを実行し、デフォルトのバージョンをWSL2に切り替える(新しくディストリビューションをインストールするとき用の設定)

     wsl --set-default-version 2
    

    7. 既存のWSLのディストリビューションをWSL2に変換するコマンドを実行する(Ubuntuがインストールされているので、変換する)

    wsl --set-version Ubuntu 2
    

    書式

    wsl --set-version ディストリビューション バージョン

    8. WSLのバージョンを確認する、Powershellで以下のコマンドを実行する

    wsl -l -v

    これで、VERSIONの部分が2になっていれば、WSL2への移行が終わり。

    ■実行したところ

    PS C:\Users\zen> wsl --set-default-version 2
    WSL 2 との主な違いについては、https://aka.ms/wsl2 を参照してください
    PS C:\Users\zen>
    PS C:\Users\zen> wsl -l -v
      NAME      STATE           VERSION
    * Ubuntu    Running         1
    PS C:\Users\zen>
    PS C:\Users\zen>
    PS C:\Users\zen> wsl --set-version Ubuntu 2
    変換中です。この処理には数分かかることがあります...
    WSL 2 との主な違いについては、https://aka.ms/wsl2 を参照してください
    変換が完了しました。
    PS C:\Users\zen>
    PS C:\Users\zen> wsl -l -v
      NAME      STATE           VERSION
    * Ubuntu    Running         2
    PS C:\Users\zen>
    
  • apt updateでGitLabの公開鍵がエラーになり更新できなかった

    Ubuntu Serverで、apt updateを行ったところ、GitLabの公開鍵がエラーになった。

    エラー:7 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu bionic InRelease
      公開鍵を利用できないため、以下の署名は検証できませんでした: NO_PUBKEY 3F01618A51312F3F
    

    “apt-key list” で公開鍵を確認してみると、「2020-04-15」で期限切れになっていた。

    zen@Lab:~$ apt-key list
    /etc/apt/trusted.gpg
    --------------------
    pub   dsa1024 2005-05-24 [SC]
          3B59 3C7B E6DB 6A89 FB7C  BFFD 058A 05E9 0C4E CFEC
    uid           [  不明  ] Ubuntu-ja Archive Automatic Signing Key 
    sub   elg2048 2005-05-24 [E]
    
    pub   rsa1024 2009-04-05 [SC]
          5967 6CBC F5DF D8C1 CEFE  375B 68B5 F60D CDC1 D865
    uid           [  不明  ] Launchpad PPA for Ubuntu Japanese Team
    
    pub   rsa4096 2015-04-17 [SC] [期限切れ: 2020-04-15]
          1A4C 919D B987 D435 9396  38B9 1421 9A96 E15E 78F4
    uid           [期限切れ] GitLab B.V. (package repository signing key) 
    
    /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-archive.gpg
    ------------------------------------------------------
    pub   rsa4096 2012-05-11 [SC]
          790B C727 7767 219C 42C8  6F93 3B4F E6AC C0B2 1F32
    uid           [  不明  ] Ubuntu Archive Automatic Signing Key (2012) 
    
    /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg
    ------------------------------------------------------
    pub   rsa4096 2012-05-11 [SC]
          8439 38DF 228D 22F7 B374  2BC0 D94A A3F0 EFE2 1092
    uid           [  不明  ] Ubuntu CD Image Automatic Signing Key (2012) 
    
    /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg
    ------------------------------------------------------
    pub   rsa4096 2018-09-17 [SC]
          F6EC B376 2474 EDA9 D21B  7022 8719 20D1 991B C93C
    uid           [  不明  ] Ubuntu Archive Automatic Signing Key (2018) 
    
    zen@Lab:~$
    

    GitLabのページをみたところ、公開鍵(GPG)の更新手順が乗っていたので、実行する。手順は、キーをダウンロードする。次に、GPGキーを追加する。

    curl https://packages.gitlab.com/gpg.key -o /tmp/omnibus_gitlab_gpg.key
    sudo apt-key add /tmp/omnibus_gitlab_gpg.key
    

    これで、完了。あとは、もう一度apt updateして、sudo apt upgradeを行う。GitLabも、ちゃんと更新された。

    実際に実行すると、下記のような感じ。

    zen@Lab:~$ curl https://packages.gitlab.com/gpg.key -o /tmp/omnibus_gitlab_gpg.key
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  3191  100  3191    0     0   6675      0 --:--:-- --:--:-- --:--:--  6689
    zen@Lab:~$
    zen@Lab:~$
    zen@Lab:~$ sudo apt-key add /tmp/omnibus_gitlab_gpg.key
    OK
    zen@Lab:~$
    

    ■参考 
    https://docs.gitlab.com/omnibus/update/package_signatures#package-repository-metadata-signing-keys