ほとまるブログ

おっぱいアニメ愛好家のブログ (゚∀゚)o彡゜おっぱい!おっぱい!

Debian9(stretch)からDebian10(buster)にアップグレード

はじめに

僕はdebianをずっと使用している。
ずっとと言っても etch(4.0) の頃からだ。
Microsoftに嫌気が差して、Linuxに移行したいと考えて
いろいろなディストリビューションを試してみた。
僕がOSに求めることは、安定性と手間がかからないこと。
そして動画(mp4)をカクカクしないで再生できること。
ディストリビューションの比較は書き出すと長くなりそうなので、省略。
debian は、程よく枯れて僕の用途にマッチしていました。
Debian10(buster)がリリースされたので、盆休みを利用して9(stretch)からアップグレードしようかなと。
まぁ、そんな大げさな作業でも無いのですが・・・

レポジトリの変更

/etc/apt/sources.list を編集します。
stretch を buster に置換します。

$ sudo vi /etc/apt/sources.list 
deb http://deb.debian.org/debian/ buster main non-free contrib
deb http://deb.debian.org/debian/ buster-updates main contrib non-free
deb http://security.debian.org/ buster/updates main contrib non-free
deb http://security.debian.org/debian-security buster/updates main

で、更新

$ sudo apt update
Get:1 http://deb.debian.org/debian buster InRelease [118 kB]
Get:2 http://deb.debian.org/debian buster-updates InRelease [46.8 kB]                         
Get:3 http://security.debian.org buster/updates InRelease [39.1 kB]                                  
(省略)                                              
W: http://deb.debian.org/debian/dists/buster/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://deb.debian.org/debian/dists/buster-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://security.debian.org/dists/buster/updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://repository.spotify.com/dists/stable/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://security.debian.org/debian-security/dists/buster/updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh-cache > /dev/null; fi'
E: Sub-process returned an error code

エラーが発生
調べたらバグらしい。--fix-missing オプションを付けてもう一度トライ。

$ sudo apt-get update --fix-missing
(省略) 
W: http://deb.debian.org/debian/dists/buster/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://deb.debian.org/debian/dists/buster-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://security.debian.org/dists/buster/updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://repository.spotify.com/dists/stable/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://security.debian.org/debian-security/dists/buster/updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg are ignored as the file is not readable by user '_apt' executing apt-key.

警告だけになった。
調べたら /etc/apt/trusted.gpg が邪魔らしい。
消すのもアレなので、rename してもう一度トライ

$ sudo mv /etc/apt/trusted.gpg /etc/apt/trusted.gpg.orig
$ sudo apt-get update --fix-missing
Get:1 http://security.debian.org buster/updates InRelease [39.1 kB]
Hit:2 http://deb.debian.org/debian buster InRelease                                                       
Hit:3 http://deb.debian.org/debian buster-updates InRelease                                               
Get:4 http://security.debian.org/debian-security buster/updates InRelease [39.1 kB]
Fetched 78.2 kB in 0s (105 kB/s)
Reading package lists... Done

とりあえず、警告とエラーは出なくなった。

アップグレード

$ sudo apt-get 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:
(省略)
889 upgraded, 0 newly installed, 0 to remove and 715 not upgraded.
Need to get 312 MB of archives.
After this operation, 33.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
(y を入力して待つ)
(省略。確認入力待ちで停止してたりするので、時々チェック)
$ sudo apt-get dist-upgrade
(省略)
715 upgraded, 396 newly installed, 28 to remove and 0 not upgraded.
Need to get 1,097 MB of archives.
After this operation, 1,398 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
(y を入力して待つ)
$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
(省略)
0 upgraded, 0 newly installed, 223 to remove and 0 not upgraded.
After this operation, 1,485 MB disk space will be freed.
Do you want to continue? [Y/n] 
(y を入力して待つ)
$ sudo apt-get autoclean

ホスト名を debian9 にしてたので、debian10 に変更

$ sudo vi /etc/hostname
debian10
$ sudo vi /etc/hosts
127.0.0.1	debian10.localdomain	debian10

ハングしないことを「Debianの神さま」に祈りながら再起動する。

バージョン確認

問題なく再起動したし、バージョン表示も 10 なのでOK

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 10.0 (buster)
Release:	10.0
Codename:	buster

最後に

Debianは、枯れたPCには最適だと思います。
今回、アップグレードしたPCは、Intel Corei7-3770 で6年くらい昔のPCで、
おっぱいアニメのブログを書くには、十分過ぎる性能です。
少しレスポンスが速くなった気がするのは、
おそらく僕が変な設定をしていた部分が初期化されたからだろうw

その後(追記)

USキーボード配列から日本語かな配列に変更

homeディレクトリに日本語名のディレクトリが出来ると嫌なので、英語環境にしていたら
US配列に変更されてしまったようだ(詳しい原因は不明)
"Settings" -> "Region & Language" -> "Input Sources"
が、"English(US)" になってたので、
"Japanese" を追加して、"English(US)" を削除
まぁ、このくらいの不具合は仕方ないな