【Ubuntu】Ubuntuを19.04にアップグレードしてみた

なんとまあ・・・、久しぶりの更新でございます。すいません...スプラトゥーン2にハマっておりました...。 で、本日は・・・最近ずっと放置していたUSBメモリ上のUbuntu18.04LTS。。。気がつくとUbuntu 19.04がリリースされていたので、今日はそのUbuntuをアップグレードしてみたいと思います。今日も何が起きても知らん!!! ぐらいな気持ちでやってみようと思います。いつもの如く、真似される方は自己責任でお願い致します。
ちなみに前回の17.10→18.04のアップグレードの記事はこちらになります。
USBメモリへのインストール方法はこちらでございます。



ウデマエ? いつまでたっても上がりません・・・

現バージョン確認

まずは、前回同様インストールされているUbuntuのバージョンを確認します。

$ cat /etc/lsb-release
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

はい。今回も間違いなく18.04が入ってますね。
以下のコマンドでも確認出来るみたいですね。

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.2 LTS
Release:    18.04
Codename:   bionic

パッケージのアップデート

前回はやらなかったのですが、サードパーティー製のリポジトリを無効化したほうが良いみたいですね。やった記憶がないので自動でそれっぽくしてくれてるようにも見えますが・・・ (これ不要でしたね。下の方で自動でやってくれるみたいです)

$ sudo sed -i 's/^/#/' /etc/apt/sources.list.d/*.list

リポジトリのアドレスが全部コメントアウトされます。後でまた追加するイメージでしょうかね。

インストールされているパッケージをアップデートしましょう。いつものやつですね。

$ sudo apt update
$ sudo apt upgrade

アップグレードできるパッケージが存在すると、’Do you want to continue? [Y/n]’と聞かれるので、’Y’と入力し、Enterキーをぶっ叩きましょう。
プロンプトが戻ってきたら完了です。

不要なパッケージが存在する場合は、以下を実行しましょう。

$ sudo apt autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-headers-4.15.0-45 linux-headers-4.15.0-45-generic linux-headers-4.15.0-46 linux-headers-4.15.0-46-generic linux-headers-4.15.0-48 linux-headers-4.15.0-48-generic
  linux-headers-4.15.0-50 linux-headers-4.15.0-50-generic linux-image-4.15.0-45-generic linux-image-4.15.0-46-generic linux-image-4.15.0-48-generic linux-image-4.15.0-50-generic
  linux-modules-4.15.0-45-generic linux-modules-4.15.0-46-generic linux-modules-4.15.0-48-generic linux-modules-4.15.0-50-generic linux-modules-extra-4.15.0-50-generic
0 upgraded, 0 newly installed, 17 to remove and 2 not upgraded.
After this operation, 823 MB disk space will be freed.
Do you want to continue? [Y/n] Y

こちらも不要なパッケージがあると、聞かれるので、’Y’で答えます。
プロンプトが戻ってきたら完了です。今回はなんか色々消されました。

次に、バージョンアップでの依存関係等のアップグレードをします。

$ sudo apt dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  gyp libjs-async libjs-inherits libjs-node-uuid libjs-underscore libuv1-dev node-abbrev node-ansi node-ansi-color-table node-archy node-async node-balanced-match node-block-stream
  node-brace-expansion node-builtin-modules node-combined-stream node-concat-map node-cookie-jar node-delayed-stream node-forever-agent node-form-data node-fs.realpath node-fstream
  node-fstream-ignore node-github-url-from-git node-glob node-graceful-fs node-hosted-git-info node-inflight node-inherits node-ini node-is-builtin-module node-isexe
  node-json-stringify-safe node-lockfile node-lru-cache node-mime node-minimatch node-mkdirp node-mute-stream node-node-uuid node-nopt node-normalize-package-data node-npmlog node-once
  node-osenv node-path-is-absolute node-pseudomap node-qs node-read node-read-package-json node-request node-retry node-rimraf node-semver node-sha node-slide node-spdx-correct
  node-spdx-expression-parse node-spdx-license-ids node-tar node-tunnel-agent node-underscore node-validate-npm-package-license node-which node-wrappy node-yallist
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  node-gyp nodejs-dev npm
The following packages will be upgraded:
  nodejs
1 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
Need to get 4,796 kB of archives.
After this operation, 12.2 MB disk space will be freed.
Do you want to continue? [Y/n] Y

こちらも同様だと思います。
こちらも今回は変更があったようです。不要なものもあったみたいで、autoremoveももう一度実行しました。

$ sudo apt autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  gyp libjs-async libjs-inherits libjs-node-uuid libjs-underscore libuv1-dev node-abbrev node-ansi node-ansi-color-table node-archy node-async node-balanced-match node-block-stream
  node-brace-expansion node-builtin-modules node-combined-stream node-concat-map node-cookie-jar node-delayed-stream node-forever-agent node-form-data node-fs.realpath node-fstream
  node-fstream-ignore node-github-url-from-git node-glob node-graceful-fs node-hosted-git-info node-inflight node-inherits node-ini node-is-builtin-module node-isexe
  node-json-stringify-safe node-lockfile node-lru-cache node-mime node-minimatch node-mkdirp node-mute-stream node-node-uuid node-nopt node-normalize-package-data node-npmlog node-once
  node-osenv node-path-is-absolute node-pseudomap node-qs node-read node-read-package-json node-request node-retry node-rimraf node-semver node-sha node-slide node-spdx-correct
  node-spdx-expression-parse node-spdx-license-ids node-tar node-tunnel-agent node-underscore node-validate-npm-package-license node-which node-wrappy node-yallist
0 upgraded, 0 newly installed, 67 to remove and 0 not upgraded.
After this operation, 4,182 kB disk space will be freed.
Do you want to continue? [Y/n] Y

前段(アップグレード1)

本題の19.04へのアップグレード前に、一旦18.10へアップグレードします。もともとの18.04はLTSです。LTSなので、それ以外のバージョンへは通常はアップグレード出来ないようになっているみたいです。ですので、以下のファイルに若干の編集を加えます。
/etc/update-manager/release-upgrades

$ sudo vim /etc/update-manager/release-upgrades

以下のような内容になっています。

# Default behavior for the release upgrader.

[DEFAULT]
# Default prompting behavior, valid options:
#
#  never  - Never check for, or allow upgrading to, a new release.
#  normal - Check to see if a new release is available.  If more than one new
#           release is found, the release upgrader will attempt to upgrade to
#           the supported release that immediately succeeds the
#           currently-running release.
#  lts    - Check to see if a new LTS release is available.  The upgrader
#           will attempt to upgrade to the first LTS release available after
#           the currently-running one.  Note that if this option is used and
#           the currently-running release is not itself an LTS release the
#           upgrader will assume prompt was meant to be normal.
Prompt=lts

最後の行を編集します。”Prompt=lts”の”lts”の部分を”normal”に書き換えます。

# Default behavior for the release upgrader.

[DEFAULT]
# Default prompting behavior, valid options:
#
#  never  - Never check for, or allow upgrading to, a new release.
#  normal - Check to see if a new release is available.  If more than one new
#           release is found, the release upgrader will attempt to upgrade to
#           the supported release that immediately succeeds the
#           currently-running release.
#  lts    - Check to see if a new LTS release is available.  The upgrader
#           will attempt to upgrade to the first LTS release available after
#           the currently-running one.  Note that if this option is used and
#           the currently-running release is not itself an LTS release the
#           upgrader will assume prompt was meant to be normal.
Prompt=normal

こんな感じです。

そしたら前回同様に以下のコマンドを実行します。

$ sudo do-release-upgrade

前回同様ですね。以下の様なメッセージが表示されます。

Checking for a new Ubuntu release
Get:1 Upgrade tool signature [819 B]                                                                                                                                                         
Get:2 Upgrade tool [1,242 kB]                                                                                                                                                                
Fetched 1,242 kB in 0s (0 B/s)                                                                                                                                                               
authenticate 'cosmic.tar.gz' against 'cosmic.tar.gz.gpg' 
extracting 'cosmic.tar.gz'

Reading cache

Checking package manager
Reading package lists... Done
Building dependency tree        
Reading state information... Done
Hit http://jp.archive.ubuntu.com/ubuntu bionic InRelease                                                                                                                                     
Get:1 http://jp.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]                                                                                                                 
Get:2 http://jp.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]                                                                                                               
Hit https://download.docker.com/linux/ubuntu bionic InRelease                                                                                                                                
Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]                                                                                                                  
Fetched 252 kB in 0s (0 B/s)                                                                                                                                                                 
Reading package lists... Done    
Building dependency tree          
Reading state information... Done

Updating repository information

Third party sources disabled 

Some third party entries in your sources.list were disabled. You can 
re-enable them after the upgrade with the 'software-properties' tool 
or your package manager. 

To continue please press [ENTER]

あ、ここでサードパーティ製のリポジトリは止められてしまうのですね。だからやった記憶がないのか・・・
続けるのでEnterキーを叩きます。

数分待ちますと・・・前回同様以下のメッセージが表示されます。

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

Calculating the changes

Calculating the changes

Do you want to start the upgrade? 


17 installed packages are no longer supported by Canonical. You can 
still get support from the community. 

3 packages are going to be removed. 83 new packages are going to be 
installed. 1330 packages are going to be upgraded. 

You have to download a total of 1,156 M. This download will take 
about 5 minutes with your connection. 

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

 Continue [yN]  Details [d]

ここが最後の砦だそうですが・・・行ってしまいましょう!!!
‘y’!!! そしてEnter!!!

なんと、ここで前回表示されなかったメッセージが・・・

Lock screen disabled 

Your lock screen has been disabled and will remain disabled until you 
reboot. 

To continue please press [ENTER]
Inhibiting until Ctrl+C is pressed...

スクリーンのロックは再起動するまで無効になるっぽいですね。
はい。Enter…ちょっと休憩です。

さてさて、1時間ぐらいはやってたでしょうか?
ようやくプロンプトが帰ってまいりました。

Configuration file '/etc/update-manager/release-upgrades'
 ==> 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.
*** release-upgrades (Y/I/N/O/D/Z) [default=N] ? 

“/etc/update-manager/release-upgrades'”がアップデートしてるけど入れちゃう? でしょうか?
oh yeah! 入れてしまいましょう。
‘Y’で。

さて、後少し・・・で、前段が終わります。

Searching for obsolete software
Reading state information... Done

Remove obsolete packages? 


53 packages are going to be removed. 

 Continue [yN]  Details [d]

時代遅れなパッケージ消しますよ宣言。。。
もちろん’y’で。

ようやく来ました。再起動宣言!!

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] 

よろしくお願いします。
‘y’で!!

さて再起動後のデスクトップ画面でございます。
18.10
何だこれ・・・イカか?

バージョンの確認を致します。

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.10
DISTRIB_CODENAME=cosmic
DISTRIB_DESCRIPTION="Ubuntu 18.10"

はい。ちゃんと上がってますね。
暫くこれで遊んでみても良いかもです。

本題(アップグレード2)

さあ、いよいよ本題の19.04へのアップグレードです。
先程実行したコマンドを再度実行します。

$ sudo do-release-upgrade

テキストも同様に流れていきます。

Checking for a new Ubuntu release
Get:1 Upgrade tool signature [1,554 B]                                                                                                                                                       
Get:2 Upgrade tool [1,210 kB]                                                                                                                                                                
Fetched 1,212 kB in 0s (0 B/s)                                                                                                                                                               
authenticate 'disco.tar.gz' against 'disco.tar.gz.gpg' 
extracting 'disco.tar.gz'

Reading cache

Checking package manager
Reading package lists... Done
Building dependency tree        
Reading state information... Done
Hit http://jp.archive.ubuntu.com/ubuntu cosmic InRelease   
Get:1 http://jp.archive.ubuntu.com/ubuntu cosmic-updates InRelease [88.7 kB]                                                                                                                 
・
・
・                                                                                           
Get:24 http://security.ubuntu.com/ubuntu cosmic-security/multiverse amd64 DEP-11 Metadata [2,464 B]                                                                                          
Fetched 3,452 kB in 0s (0 B/s)                                                                                                                                                               
Reading package lists... Done    
Building dependency tree          
Reading state information... Done

Updating repository information
Get:1 http://jp.archive.ubuntu.com/ubuntu disco InRelease [257 kB]                                                                                                                           
・
・
・
Get:84 http://jp.archive.ubuntu.com/ubuntu disco-backports/multiverse amd64 c-n-f Metadata [116 B]                                                                                           
Fetched 45.0 MB in 6s (2,611 kB/s)                                                                                                                                                           

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

Calculating the changes

Calculating the changes

Do you want to start the upgrade? 


28 installed packages are no longer supported by Canonical. You can 
still get support from the community. 

6 packages are going to be removed. 103 new packages are going to be 
installed. 1426 packages are going to be upgraded. 

You have to download a total of 1,152 M. This download will take 
about 6 minutes with your connection. 

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

 Continue [yN]  Details [d]

さて、2度目の関門でございます。どんどん行きましょう。
‘y’を打って、Enterを打ちましょう。
そしてしばしの休憩でしょうか・・・

と思ったらまたこれです。

Lock screen disabled 

Your lock screen has been disabled and will remain disabled until you 
reboot. 

To continue please press [ENTER]
Inhibiting until Ctrl+C is pressed...

スクリーンロックは大丈夫です。
Enterで。。。

いや〜長かったですね。最後の問いでしょうか・・・? いや・・・

・
・
・
Searching for obsolete software
Reading state information... Done

Remove obsolete packages? 


100 packages are going to be removed. 

 Continue [yN]  Details [d]

いらないものの削除です。
‘y’でEnterキーを・・・

そして伝説へ・・・これが最後ですね。再起動のお時間です。

・
・
・
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] 

‘y’を入力し、Enterキーで締めくくりましょう・・・
再起動が始まります。

再起動が完了しログインすると、デスクトップに以下のようなウィンドウが表示されていると思います。
19.04

新バージョン確認

最後にインストールされているUbuntuのバージョンを確認します。

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=19.04
DISTRIB_CODENAME=disco
DISTRIB_DESCRIPTION="Ubuntu 19.04"

よし。間違いなく19.04が入ってますね。
これで暫く遊んで行きたいと思います。

参考サイト

関連記事

【Swift4】「'characters' is deprecated」というワ...

【Swift4】Stringイニシャライズ時のエラー

【GraalVM】ちょっと弄ってみた

【Ubuntu】Ubuntu18.04LTSにアップグレードしてやったことメモ

【Xcode】ショートカット集

iPhoneのスクリーンサイズ一覧