Oracle Cloud上のUbuntuインスタンスにはOracle Cloud Agentがsnapパッケージでインストールされている。
ただ、ドキュメントにはインストール手法は解説があるが、アップデート手法について記載がない。
まずは、snapでインストールされているパッケージ一覧を出してみる
ubuntu@ubuntu:~$ snap list
Name Version Rev Tracking Publisher Notes
core18 20211215 2289 latest/stable canonical? base
core20 20220114 1332 latest/stable canonical? base
lxd 4.0.8 21843 4.0/stable/… canonical? -
oracle-cloud-agent 1.19.0-1130 31 latest/stable/… oci.osi classic
snapd 2.54.2 14553 latest/stable canonical? snapd
ubuntu@ubuntu:~$
次に「oracle-cloud-agent」について個別情報を取得
ubuntu@ubuntu:~$ snap info oracle-cloud-agent
name: oracle-cloud-agent
summary: Oracle Cloud Agent
publisher: Oracle Cloud Infrastructure (oci.osi)
store-url: https://snapcraft.io/oracle-cloud-agent
license: unset
description: |
Oracle Cloud Infrastructure agent for compute instance management and
monitoring.
services:
oracle-cloud-agent: simple, enabled, active
oracle-cloud-agent.oracle-cloud-agent-updater: simple, enabled, active
snap-id: ltx4XjES2e2ujitNIuO5GxPYDM6lp6ry
tracking: latest/stable/ubuntu-20.04
refresh-date: 2022-02-15
channels:
latest/stable: 1.22.0-2 2022-04-25 (37) 18MB classic
latest/candidate: 1.22.0-2 2022-04-08 (37) 18MB classic
latest/beta: 1.22.0-2 2022-04-08 (37) 18MB classic
latest/edge: ↑
installed: 1.19.0-1130 (31) 21MB classic
ubuntu@ubuntu:~$
installedが1.19.0-1130で、最新(latest)が1.22.0-2とアップデートが出ていることが分かる。
snapの更新は「sudo snap refresh」で行う。
ubuntu@ubuntu:~$ snap refresh
error: access denied (try with sudo)
ubuntu@ubuntu:~$ sudo snap refresh
Handling re-refresh of "core18", "core20", "lxd", "oracle-cloud-agent", "snapd" Handling re-refresh of "core18", "core20", "lxd", "oracle-cloud-agent", "snapd" Handling re-refresh of "core18", "core20", "lxd", "oracle-cloud-agent", "snapd" 2022-05-06T07:14:40Z INFO Waiting for automatic snapd restart...
oracle-cloud-agent (stable/ubuntu-20.04) 1.22.0-2 from Oracle Cloud Infrastructure (oci.osi) refreshed
snapd 2.55.3 from Canonical? refreshed
core18 20220309 from Canonical? refreshed
core20 20220329 from Canonical? refreshed
lxd (4.0/stable) 4.0.9-8e2046b from Canonical? refreshed
ubuntu@ubuntu:~$
そして、パッケージ情報を取得し、更新されたことを確認する。
ubuntu@ubuntu:~$ snap list
Name Version Rev Tracking Publisher Notes
core18 20220309 2349 latest/stable canonical? base
core20 20220329 1437 latest/stable canonical? base
lxd 4.0.9-8e2046b 22761 4.0/stable/… canonical? -
oracle-cloud-agent 1.22.0-2 37 latest/stable/… oci.osi classic
snapd 2.55.3 15541 latest/stable canonical? snapd
ubuntu@ubuntu:~$ snap info oracle-cloud-agent
name: oracle-cloud-agent
summary: Oracle Cloud Agent
publisher: Oracle Cloud Infrastructure (oci.osi)
store-url: https://snapcraft.io/oracle-cloud-agent
contact: oci_osi_grp@oracle.com
license: unset
description: |
Oracle Cloud Infrastructure agent for compute instance management and
monitoring.
services:
oracle-cloud-agent: simple, enabled, active
oracle-cloud-agent.oracle-cloud-agent-updater: simple, enabled, active
snap-id: ltx4XjES2e2ujitNIuO5GxPYDM6lp6ry
tracking: latest/stable/ubuntu-20.04
refresh-date: today at 07:14 UTC
channels:
latest/stable: 1.22.0-2 2022-04-25 (37) 18MB classic
latest/candidate: 1.22.0-2 2022-04-08 (37) 18MB classic
latest/beta: 1.22.0-2 2022-04-08 (37) 18MB classic
latest/edge: ↑
installed: 1.22.0-2 (37) 18MB classic
ubuntu@ubuntu:~$