ubuntuのインプレースアップデートの手順書


Ubuntu をインプレースアップデートした

バージョンが 18 のUbuntuで動作している社内サーバーが残っていたのアップデートしました。

どうせなら 22 にしたいのですが、18 → 22 のようなバージョンをとばしたアップデートはできません。

18 → 2020 → 22と1段階ずつアップデートしていきます。

現在のバージョンの確認

cat /etc/os-release

アップグレード可能なバージョンの確認

sudo do-release-upgrade -c

インストール済みのaptパッケージの更新と不要なパッケージ、キャッシュのされているdepファイルの削除。エラーがでた場合は個別にコマンドを実行します

sudo apt update -y && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt autoclean -y

アップデートが残っていて、適用されたならば一度再起動しておきます

sudo reboot

Ubuntu をアップグレードするコマンドを実行

sudo do-release-upgrade

以下はアップグレード時の質問事項

ssh接続の追加ポートとして1022ポートを使用しできるようにするか?という質問はyes
アップデート中のトラブル時に再接続のために使用できる。
その後に表示されるコマンドはメモしておく。

If you continue, an additional ssh daemon will be started at port
'1022'.
Do you want to continue?

Continue [yN]

ubuntuにパッケージリポジトリに含まれていないサードパーティ製のアプリの無効化の通知。
これは通知のみなのでenter

Third party sources disabled

OSのバージョンに合わせてパッケージをアップグレードを実行してよいか?
パッケージの詳細を確認したい場合はd、進めるにはyes

Do you want to start the upgrade?

〜更新されるパッケージの一覧の表示〜

Installing the upgrade can take several hours. Once the download has
finished, the process cannot be canceled.

 Continue [yN]  Details [d]

再起動する必要があるパッケージがインストール、更新された際に自動で再起動してよいか?
基本はOK

There are services installed on your system which need to be restarted when certain libraries, such as libpam, libc, and
libssl, are upgraded. Since these restarts may cause interruptions of service for the system, you will normally be prompted
on each upgrade for the list of services you wish to restart.  You can choose this option to avoid being prompted; instead,
all necessary restarts will be done for you automatically so you can avoid being asked questions on each library upgrade.

Restart services during package upgrades without asking?

LXDをアップグレードするか? yes
必要がない場合はLXDに関する質問は聞かれない

Upgrade to the LXD snap

Starting with LXD 3.1, all new releases of LXD are only available to Ubuntu users through the snap package.

This package update will transition your system over to the snap by installing it and then running an automated migration
tool.

As part of this upgrade, all containers will briefly be shutdown and brought back up. Before continuing, make sure that you
are ready for this downtime.

LXDのバージョンをどうするか?
基本は新しいバージョンで。今回の場合は4.0 を選択

The LXD project puts out monthly feature releases which while backward compatible at an API and CLI level, will contain
some behavior change and potentially require manual intervention during an upgrade.

In addition to those, every 2 years a LTS release is made which comes with 5 years of support through frequent bugfix-only
releases.

The LXD team recommends you pick "4.0" for production environments and use "latest" if you're interested in getting the
latest LXD features.

構成ファイル sshd_config をどうするか?
現在の設定をそのまま使用するのでkeep the local version currently installed を選択

A new version (/tmp/file4mEdmb) of configuration file /etc/ssh/sshd_config is available, but the version installed
currently has been locally modified.

What do you want to do about modified configuration file sshd_config?

アップグレード開始 終了後に古いパッケージの削除をするか?
古いパッケージは不要なのでyes

Reading package lists... Done
Building dependency tree
Reading state information... Done

Searching for obsolete software
Reading state information... Done

Remove obsolete packages?

アップデートの完了
再起動するか?はもちろんyes

System upgrade is complete.

Restart required

To finish the upgrade, a restart is required.
If you select 'y' the system will be restarted.

Continue [yN]

再起動後にサーバーに接続して現在のバージョンを確認する

cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"

バージョンが上がっていることを確認。
一通り操作して動作することを確認。
必要なパッケージがあれば追加でインストールしてアップデートは完了。
今回は18 → 22に上げたのでもう一度同じ操作を行なっています。

注意ポイントその1

ubuntu 22 にfuseをインストール、更新するとシステムが壊れる可能性があるのでインストールしない。Nを選択。

Configuration file '/etc/fuse.conf'
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ?  Your options are:
Y or I  : install the package maintainer's version
N or O  : keep your currently-installed version
D     : show the differences between the versions
Z     : start a shell to examine the situation
The default action is to keep your current version.
*** fuse.conf (Y/I/N/O/D/Z) [default=N] ?

参照ページ FUSE

https://github.com/AppImage/AppImageKit/wiki/FUSE

22に最新版をインストールすると壊れますとか物騒すぎる。

Warning: While libfuse2 is OK, do not install the fuse package as of 22.04 or you may break your system

注意ポイントその2

メール認証の設定。
現在の設定をキープする。Nを選択。

Configuration file '/etc/default/saslauthd'
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ?  Your options are:
Y or I  : install the package maintainer's version
N or O  : keep your currently-installed version
D     : show the differences between the versions
Z     : start a shell to examine the situation
The default action is to keep your current version.
*** saslauthd (Y/I/N/O/D/Z) [default=N] ?

現在未評価

コメント

コメントを投稿
コメントするには TORICO-ID にログインしてください。
ログイン コメント利用規約