馬鹿の一つ覚え: Fedoraをアップグレード

### Fedora 31をFedora 32にアップグレード
```shell-session
$ cat /etc/redhat-release
Fedora release 31 (Thirty One)
$ uname -s -r
Linux 5.6.16-200.fc31.x86_64
$ sudo dnf -y update
$ sudo dnf -y --refresh upgrade
$ sudo sync
$ sudo shutdown -r now
```
```shell-session
$ uname -s -r
Linux 5.6.16-200.fc31.x86_64
$ sudo dnf -y install dnf-plugin-system-upgrade
$ sudo dnf -y --refresh --releasever=32 system-upgrade download
$ sudo dnf system-upgrade reboot
```
```shell-session
$ cat /etc/redhat-release
Fedora release 32 (Thirty Two)
$ uname -s -r
Linux 5.6.18-300.fc32.x86_64
```

### Fedora 30をFedora 31にアップグレード
```shell-session
$ cat /etc/redhat-release
Fedora release 30 (Thirty)
$ uname -s -r
Linux 5.4.19-100.fc30.x86_64
$ sudo dnf -y update
$ sudo dnf -y --refresh upgrade
$ sudo sync
$ sudo shutdown -r now
```
```shell-session
$ uname -s -r
Linux 5.6.13-100.fc30.x86_64
$ sudo dnf -y install dnf-plugin-system-upgrade
$ sudo dnf -y --refresh --releasever=31 system-upgrade download
$ sudo dnf system-upgrade reboot
```
```shell-session
$ cat /etc/redhat-release
Fedora release 31 (Thirty One)
$ uname -s -r
Linux 5.6.16-200.fc31.x86_64
```

### Fedora 29をFedora 30にアップグレード
```shell-session
$ cat /etc/redhat-release
Fedora release 29 (Twenty Nine)
$ sudo dnf -y update
$ sudo dnf --refresh upgrade
$ sudo dnf install dnf-plugin-system-upgrade
$ sudo dnf system-upgrade download -y --refresh --releasever=30    # 少し時間がかかる
$ sudo dnf system-upgrade reboot    # コマンド実行直後にssh接続が切れる
```
```shell-session
$ cat /etc/redhat-release    # 2時間ほどで接続できるようになる
Fedora release 30 (Thirty)
$ cat /etc/os-release
NAME=Fedora
VERSION="30 (Server Edition)"
ID=fedora
VERSION_ID=30
VERSION_CODENAME=""
PLATFORM_ID="platform:f30"
PRETTY_NAME="Fedora 30 (Server Edition)"
ANSI_COLOR="0;34"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:30"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f30/system-administrators-guide/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=30
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=30
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Server Edition"
VARIANT_ID=server
$ uname -a
Linux capybara 5.0.16-300.fc30.x86_64 #1 SMP Tue May 14 19:33:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
```

### Fedora 28をFedora 29にアップグレード
```shell-session
$ cat /etc/redhat-release 
Fedora release 28 (Twenty Eight)
$ uname -a
Linux capybara 4.20.14-100.fc28.x86_64 #1 SMP Tue Mar 5 19:45:42 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ sudo dnf -y update
$ sudo dnf upgrade --refresh
$ sudo dnf install dnf-plugin-system-upgrade
$ sudo dnf system-upgrade download -y --refresh --releasever=29
$ sudo dnf system-upgrade reboot    # コマンド実行直後にssh接続が切れる
```
```shell-session
$ cat /etc/redhat-release    # 2時間後にはssh接続可能
Fedora release 29 (Twenty Nine)
$ uname -a
Linux capybara 5.0.5-200.fc29.x86_64 #1 SMP Wed Mar 27 20:58:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ sudo dnf system-upgrade clean
$ sudo dnf clean packages
$ cat /proc/version
Linux version 5.0.5-200.fc29.x86_64 (mockbuild@bkernel04.phx2.fedoraproject.org) (gcc version 8.3.1 20190223 (Red Hat 8.3.1-2) (GCC)) #1 SMP Wed Mar 27 20:58:04 UTC 2019
$ cat /etc/os-release 
NAME=Fedora
VERSION="29 (Server Edition)"
ID=fedora
VERSION_ID=29
VERSION_CODENAME=""
PLATFORM_ID="platform:f29"
PRETTY_NAME="Fedora 29 (Server Edition)"
ANSI_COLOR="0;34"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:29"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f29/system-administrators-guide/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=29
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=29
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Server Edition"
VARIANT_ID=server
```

### Fedora 27をFedora 28にアップグレード
```shell-session
$ cat /etc/redhat-release
Fedora release 27 (Twenty Seven)
$ uname -a
Linux capybara 4.16.9-200.fc27.x86_64 #1 SMP Thu May 17 04:54:30 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ sudo yum -y update
$ sudo dnf upgrade --refresh
$ sudo dnf install dnf-plugin-system-upgrade
$ sudo dnf system-upgrade download -y --refresh --releasever=28
$ sudo dnf system-upgrade reboot
```
```shell-session
$ cat /etc/redhat-release
Fedora release 28 (Twenty Eight)
$ uname -a
Linux capybara 4.16.9-300.fc28.x86_64 #1 SMP Thu May 17 06:39:18 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ sudo dnf system-upgrade clean
$ sudo dnf clean packages
$ cat /proc/version
Linux version 4.16.9-300.fc28.x86_64 (mockbuild@bkernel01.phx2.fedoraproject.org) (gcc version 8.1.1 20180502 (Red Hat 8.1.1-1) (GCC)) #1 SMP Thu May 17 06:39:18 UTC 2018
```

### Fedora 26をFedora 27にアップグレード
```shell-session
$ cat /etc/redhat-release
Fedora release 26 (Twenty Six)
$ uname -a
Linux capybara 4.15.17-200.fc26.x86_64 #1 SMP Thu Apr 12 18:28:26 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ sudo dnf -y update
$ sudo dnf upgrade --refresh
$ sudo dnf install dnf-plugin-system-upgrade
$ sudo dnf system-upgrade download -y --refresh --releasever=27
Error: 
 Problem: package openlmi-software-0.6.0-4.fc24.x86_64 requires librpm.so.7()(64bit), but none of the providers can be installed
  - rpm-libs-4.13.1-1.fc26.x86_64 does not belong to a distupgrade repository
  - problem with installed package openlmi-software-0.6.0-4.fc24.x86_64
$ sudo dnf remove openlmi-software -y    # remove the package that caused the error
$ sudo dnf system-upgrade download -y --refresh --releasever=27
$ sudo dnf system-upgrade reboot
```
```shell-session
$ cat /etc/redhat-release
Fedora release 27 (Twenty Seven)
$ uname -a
Linux capybara 4.16.9-200.fc27.x86_64 #1 SMP Thu May 17 04:54:30 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
```

### Fedora 25をFedora 26にアップグレード
```shell-session
$ cat /etc/redhat-release
Fedora release 25 (Twenty Five)
$ uname -a
Linux capybara 4.13.13-100.fc25.x86_64 #1 SMP Wed Nov 15 17:33:19 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ sudo dnf upgrade -y --refresh
$ sudo dnf -y install dnf-plugin-system-upgrade
$ sudo dnf system-upgrade download -y --releasever=26
$ sudo dnf system-upgrade reboot	# コマンド実行直後にssh接続が切れる
```
```shell-session
$ cat /etc/redhat-release	# 75分後に起動
Fedora release 26 (Twenty Six)
$ uname -a
Linux capybara 4.13.13-200.fc26.x86_64 #1 SMP Wed Nov 15 15:46:36 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
```

### Fedora 24をFedora 25にアップグレード
```shell-session
$ cat /etc/redhat-release
Fedora release 24 (Twenty Four)
$ sudo dnf -y update
$ sudo dnf -y upgrade
$ sudo dnf install dnf-plugin-system-upgrade
$ sudo dnf system-upgrade download --releasever 25
$ sudo dnf system-upgrade reboot
```
```shell-session
$ cat /etc/redhat-release
Fedora release 25 (Twenty Five)
```

### Fedora 23をFedora 24にアップグレード
```shell-session
$ cat /etc/redhat-release 
Fedora release 23 (Twenty Three)
$ uname -a
Linux capybara.ncchd.go.jp 4.5.7-202.fc23.x86_64 #1 SMP Tue Jun 28 18:22:51 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ sudo dnf -y update
$ sudo dnf -y upgrade
$ sudo dnf install dnf-plugin-system-upgrade
Last metadata expiration check: 0:12:07 ago on Tue Aug  9 11:31:23 2016.
Package dnf-plugin-system-upgrade-0.7.1-1.fc23.noarch is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
$ sudo dnf system-upgrade download --releasever 24
$ sudo date
Tue Aug  9 12:45:43 JST 2016
$ sudo dnf system-upgrade reboot
```

### Fedora 22をFedora 23にアップグレード
```shell-session
$ cat /etc/redhat-release 
Fedora release 22 (Twenty Two)
$ uname -a
Linux capybara.ncchd.go.jp 4.4.10-200.fc22.x86_64 #1 SMP Fri May 13 17:38:17 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ sudo dnf update --refresh
$ sudo dnf remove open-vm-tools	# open-vm-tools と open-vm-tools-desktop が削除された
$ sudo dnf install dnf-plugin-system-upgrade
$ sudo localectl status
   System Locale: LANG=ja_JP.UTF-8
       VC Keymap: jp106
      X11 Layout: jp
$ sudo localectl set-locale LANG=en_US.UTF-8
$ sudo localectl status
   System Locale: LANG=en_US.UTF-8
       VC Keymap: jp106
      X11 Layout: jp
$ echo $LANG
C
$ date
Wed Jun  1 11:07:49 JST 2016
$ sudo dnf system-upgrade download --releasever 23
$ sudo dnf system-upgrade reboot
```
```shell-session
$ cat /etc/redhat-release 
Fedora release 23 (Twenty Three)
$ uname -a
Linux capybara.ncchd.go.jp 4.4.9-300.fc23.x86_64 #1 SMP Wed May 4 23:56:27 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ echo $BASH_VERSION
4.3.42(1)-release
capybara23 $ sudo dnf clean packages
1 file removed
$ last | head	# 65分ほどかかったらしい
$ sudo localectl status
   System Locale: LANG=en_US.UTF-8
       VC Keymap: jp106
      X11 Layout: jp
$ sudo localectl set-locale LANG=ja_JP.UTF-8
$ sudo localectl status
   System Locale: LANG=ja_JP.UTF-8
       VC Keymap: jp106
      X11 Layout: jp
$ sudo dnf -y update
Last metadata expiration check: 2:48:48 ago on Wed Jun  1 11:09:38 2016.
Dependencies resolved.
Nothing to do.
Complete!
```

### Fedora 21をFedora 22にアップグレード
```shell-session
$ cat /etc/redhat-release 
Fedora release 21 (Twenty One)
$ uname -a
Linux capybara.northernpika.jp 4.1.8-100.fc21.x86_64 #1 SMP Tue Sep 22 12:13:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ sudo yum --enablerepo=updates-testing install fedup
$ sudo yum update fedup fedora-release
$ sudo fedup --network 22
...
Finished. Reboot to start the upgrade, or 'fedup --resetbootloader' to abort.
$ sudo sync
$ sudo sync
$ sudo shutdown -r now
```
```shell-session
$ cat /etc/redhat-release 
Fedora release 22 (Twenty Two)
$ uname -a
Linux capybara.northernpika.jp 4.2.3-200.fc22.x86_64 #1 SMP Thu Oct 8 03:23:55 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
```

### Fedora 20をFedora 21にアップグレード
```shell-session
$ cat /etc/redhat-release
Fedora release 20 (Heisenbug)
$ sudo yum --enablerepo=updates-testing install fedup
$ sudo yum update fedup fedora-release
Loaded plugins: langpacks, refresh-packagekit
No packages marked for update
$ sudo fedup --network 21 --product=server
...
Finished. Reboot to start the upgrade, or 'fedup --resetbootloader' to abort.
$ sudo sync
$ sudo sync
$ sudo shutdown -r now
```

### Fedora 19をFedora 20にアップグレード
```shell-session
$ cat /etc/redhat-release
Fedora release 19 (Schrödinger’s Cat)
$ uname -a
Linux capybara.ncchd.go.jp 3.14.8-100.fc19.x86_64 #1 SMP Mon Jun 16 21:53:59 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
capybara19 $ sudo yum -y update
capybara19 $ sudo sync
capybara19 $ shutdown -r now
```
```shell-session
$ sudo yum --enablerepo=updates-testing install fedup
$ sudo yum update fedup fedora-release
Loaded plugins: langpacks, refresh-packagekit
No packages marked for update
$ sudo fedup --network 20
$ sudo sync
$ sudo shutdown -r now
```
```shell-session
$ cat /etc/redhat-release 
Fedora release 20 (Heisenbug)
$ uname -a
Linux capybara.ncchd.go.jp 3.14.9-200.fc20.x86_64 #1 SMP Thu Jun 26 21:40:51 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
```