OrangePi-PCを使ってみる

パッケージを更新する

パッケージの更新は今まで以下の手順で行っていました。
$ sudo apt-get update
$ sudo apt-get upgrade

最近のArmbianでは以下のコマンドが推奨されています。
$ sudo apt update
$ sudo apt upgrade

今まで、どちらも同じ動きをすると思っていましたが、実は違うことが分かりました。
こちらがapt-getの時の動作です。
パッケージは何も更新されません。
$ sudo apt-get update
Hit:1 http://ports.ubuntu.com xenial InRelease
Hit:2 http://ports.ubuntu.com xenial-security InRelease
Hit:3 http://apt.armbian.com xenial InRelease
Hit:4 http://ports.ubuntu.com xenial-updates InRelease
Hit:5 http://ports.ubuntu.com xenial-backports InRelease
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 have been kept back:
  armbian-config cups-filters cups-filters-core-drivers libegl1-mesa libgbm1
  libgl1-mesa-dri libjavascriptcoregtk-4.0-18 libwayland-egl1-mesa
  libwebkit2gtk-4.0-37
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.

こちらがaptの時の動作です。
上のコマンドでは更新されないライブラリなどが更新され、さらに不要になったパッケージが有ることも教えてくれます。
$ sudo apt update
Hit:1 http://apt.armbian.com xenial InRelease
Hit:2 http://ports.ubuntu.com xenial InRelease
Hit:3 http://ports.ubuntu.com xenial-security InRelease
Hit:4 http://ports.ubuntu.com xenial-updates InRelease
Hit:5 http://ports.ubuntu.com xenial-backports InRelease
Reading package lists... Done

$ sudo apt 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:
  libllvm5.0 libqpdf17
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  debconf-utils dirmngr html2text libksba8 libllvm6.0 libnpth0 libqpdf21
  libwebpdemux1
The following packages will be upgraded:
  armbian-config cups-filters cups-filters-core-drivers libegl1-mesa libgbm1
  libgl1-mesa-dri libjavascriptcoregtk-4.0-18 libwayland-egl1-mesa
  libwebkit2gtk-4.0-37
9 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 30.3 MB of archives.
After this operation, 48.9 MB of additional disk space will be used.
Do you want to continue? [Y/n]

apt-getはアップグレードのパッケージ選択規則が厳しく、現在のパッケージ構成を変えないようにするため、この様なことが起こるみたいで す。
apt、apt-get、aptitudeの違いは色々なサイトで公開されていますが、こちらが 良くまとまっています。
今後は apt-get ではなく apt を使います。

続く...