LoginSignup
19
19

More than 1 year has passed since last update.

Ubuntu 22.04にUbuntu Proを適用する

Last updated at Posted at 2023-02-03

はじめに

最近、Ubuntu Proの一般提供が開始されました。個人用途は5台まで無料とのことなので、家で使用しているUbuntuに適用してみました。その手順を備忘として残します。

本記事に登場するUbuntuのバージョンは22.04になります。

手順

1. Ubuntu Oneのアカウント作成

Ubuntu Proのページから「Register」を選択し、Ubuntu Oneのアカウントを作成するか、作成済みのアカウントでログインします。
Screenshot from 2023-02-03 21-18-03.png
Screenshot from 2023-02-03 21-21-42.png

2. tokenの確認と登録

ログイン後の画面からPro登録用のtokenが確認できます。
Screenshot from 2023-02-02 22-33-29.png
この画面の下のほうにtokenが記載されています。
tokenをコピーしてターミナルから以下コマンドを実行することでサブスクリプションに登録できます。

$ sudo pro attach {your_token}
[sudo] {your_name} のパスワード: 
Enabling default service esm-apps
Updating package lists
Ubuntu Pro: ESM Apps enabled
Enabling default service esm-infra
Updating package lists
Ubuntu Pro: ESM Infra enabled
Enabling default service livepatch
Installing snapd
Updating package lists
Installing canonical-livepatch snap
Canonical livepatch enabled.
Unable to determine current instance-id
This machine is now attached to 'Ubuntu Pro - free personal subscription'

SERVICE          ENTITLED  STATUS    DESCRIPTION
esm-apps         yes       enabled   Expanded Security Maintenance for Applications
esm-infra        yes       enabled   Expanded Security Maintenance for Infrastructure
livepatch        yes       enabled   Canonical Livepatch service
realtime-kernel  yes       disabled  Ubuntu kernel with PREEMPT_RT patches integrated

NOTICES
Operation in progress: pro attach

Enable services with: pro enable <service>

     Account: {your_mail}
Subscription: Ubuntu Pro - free personal subscription

3. 管理ツールのインストールとPro適用の確認

登録自体は手順2で完了していますが、Proの管理ツールであるubuntu-advantage-toolsをインストールします。ついでにパッケージのアップグレードもしておきます。

$ sudo apt-get install ubuntu-advantage-tools
$ sudo apt update && sudo apt upgrade

Proが適用されたかを以下コマンドで確認します。

$ pro --version
27.13.2~22.04.1
$ pro status
pro status
SERVICE          ENTITLED  STATUS    DESCRIPTION
esm-apps         yes       enabled   Expanded Security Maintenance for Applications
esm-infra        yes       enabled   Expanded Security Maintenance for Infrastructure
livepatch        yes       enabled   Canonical Livepatch service
realtime-kernel  yes       disabled  Ubuntu kernel with PREEMPT_RT patches integrated

Enable services with: pro enable <service>

     Account: {your_mail}
Subscription: Ubuntu Pro - free personal subscription

Proでできることの一例

セキュリティ周り

  • インストールパッケージの種類と経路が確認できます。
$ pro security-status
2097 packages installed:
     1852 packages from Ubuntu Main/Restricted repository
     224 packages from Ubuntu Universe/Multiverse repository
     19 packages from third parties
     2 packages no longer available for download

To get more information about the packages, run
    pro security-status --help
for a list of available options.

This machine is attached to an Ubuntu Pro subscription.

Main/Restricted packages are receiving security updates from
Ubuntu Pro with 'esm-infra' enabled until 2032.

Universe/Multiverse packages are receiving security updates from
Ubuntu Pro with 'esm-apps' enabled until 2032. You have received 1 security
update.
  • CVE番号からマシンに影響があるか確認できます。
$ pro fix CVE-2021-3583
CVE-2021-3583: Ansible vulnerabilities
https://ubuntu.com/security/CVE-2021-3583
No affected source packages are installed.
✔ CVE-2021-3583 does not affect your system.
  • "Ubuntu Main repository"と"Ubuntu Universe repository"のパッケージ群が10年サポートとなります。

Kernel Livepatch

  • システム稼働中にカーネルパッチを適用できるようになります。サーバー用途で便利だと思われます。

おまけ: realtime-kernelを有効化する

statusを見ていると、簡単にPREEMPT_RTパッチを当てたカーネルに切り替えられそうなの試してみました。

現時点ではrealtime-kernelとlivepatchは共存できないため、livepatchを使いたい場合は注意してください。

The Real-time kernel is an Ubuntu kernel with PREEMPT_RT patches integrated.
It services latency-dependent use cases by providing deterministic response times.
The Real-time kernel meets stringent preemption specifications and is suitable for
telco applications and dedicated devices in industrial automation and robotics.
The Real-time kernel is currently incompatible with FIPS and Livepatch.

また、パッチ適用後に元のカーネルへ戻したい場合も手動で対応する必要があるため注意です。

This will change your kernel. To revert to your original kernel, you will need
to make the change manually.

以下コマンドで有効化したのち再起動するだけでrealtime-kernelを有効化できます。

$ sudo pro enable realtime-kernel 
$ pro status
SERVICE          ENTITLED  STATUS    DESCRIPTION
esm-apps         yes       enabled   Expanded Security Maintenance for Applications
esm-infra        yes       enabled   Expanded Security Maintenance for Infrastructure
realtime-kernel  yes       enabled   Ubuntu kernel with PREEMPT_RT patches integrated

参考

19
19
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
19