最初に現在のバージョンをチェック
# cat /etc/debian_version 10.10
アップグレードを繰り返していると古いパッケージが残る。これらを検索して削除。aptitude と apt-forktracer とで出力が違うことに注意。
# aptitude search '?narrow(?installed, ?not(?origin(Debian)))' id common-lisp-controller - Common Lisp source and compiler manager i A cpp-6 - GNU C preprocessor i A g++-6 - GNU C++ compiler i A gcc-6 - GNU C compiler i A gcc-6-base - GCC, the GNU Compiler Collection (base package) i A gfortran-6 - GNU Fortran compiler i host - Transitional package i A jadetex - transitional dummy package i A libasan3 - AddressSanitizer -- a fast memory error detector i A libgcc-6-dev - GCC support library (development files) i libgdbm3 - GNU dbm database routines (runtime version) i A libgfortran-6-dev - Runtime library for GNU Fortran applications (development files) i A libgfortran3 - Runtime library for GNU Fortran applications i A libisl15 - manipulating sets and relations of integer points bounded by linear constraints i A libmpfr4 - multiple precision floating-point computation i A libpoppler64 - PDF rendering library i A libruby2.3 - Libraries necessary to run Ruby 2.3 i A libssl1.0.2 - Secure Sockets Layer toolkit - shared libraries i A libstdc++-6-dev - GNU Standard C++ Library v3 (development files) i A lynx-cur - Text-mode WWW Browser (transitional package) i A openjdk-8-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless) i A perl-modules-5.24 - Core Perl modules i poppler-dbg - PDF rendering library -- debugging symbols id realpath - coreutils realpath transitional package i ruby2.3-dev - Header files for compiling extension modules for the Ruby 2.3 i ttf-marvosym - Symbol font for school and office # apt-forktracer | sort common-lisp-controller (7.10) cpp-6 (6.3.0-18+deb9u1) g++-6 (6.3.0-18+deb9u1) gcc-6 (6.3.0-18+deb9u1) gcc-6-base (6.3.0-18+deb9u1) gfortran-6 (6.3.0-18+deb9u1) host (1:9.10.3.dfsg.P4-12.3+deb9u5) jadetex (3.13-17) libasan3 (6.3.0-18+deb9u1) libgcc-6-dev (6.3.0-18+deb9u1) libgdbm3 (1.8.3-14) libgfortran3 (6.3.0-18+deb9u1) libgfortran-6-dev (6.3.0-18+deb9u1) libisl15 (0.18-1) libmpfr4 (3.1.5-1) libpoppler64 (0.48.0-2+deb9u2) libruby2.3 (2.3.3-1+deb9u6) libssl1.0.2 (1.0.2s-1~deb9u1) libstdc++-6-dev (6.3.0-18+deb9u1) lynx-cur (2.8.9dev11-1) openjdk-8-jre-headless (8u222-b10-1~deb9u1) perl-modules-5.24 (5.24.1-3+deb9u5) poppler-dbg (0.48.0-2+deb9u2) realpath (8.26-3) ruby2.3-dev (2.3.3-1+deb9u6) ttf-marvosym (0.1+dfsg-2) # apt-get purge $(aptitude --display-format '%p' --disable-columns search '?narrow(?installed, ?not(?origin(Debian)))')
apt souces list で参照されているリポジトリをチェックして、proposed-updates がないことを確認。
# grep --regexp='^deb' /etc/apt/sources.list /etc/apt/sources.list.d/* 2>1 /dev/null /etc/apt/sources.list:deb http://ftp.jp.debian.org/debian buster main /etc/apt/sources.list:deb-src http://ftp.jp.debian.org/debian buster main /etc/apt/sources.list:deb http://security.debian.org/ buster/updates main /etc/apt/sources.list:deb-src http://security.debian.org/ buster/updates main
apt souces list で参照されているリポジトリを buster のものに変更。
# grep --regexp='^deb' /etc/apt/sources.list /etc/apt/sources.list.d/* 2>1 /dev/null /etc/apt/sources.list:deb http://ftp.jp.debian.org/debian bullseye main /etc/apt/sources.list:deb-src http://ftp.jp.debian.org/debian bullseye main /etc/apt/sources.list:deb http://security.debian.org/debian-security bullseye-security main /etc/apt/sources.list:deb-src http://security.debian.org/debian-security bullseye-security main
パッケージリストを更新
# apt update Get:1 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB] Hit:2 http://ftp.jp.debian.org/debian bullseye InRelease Get:3 http://security.debian.org/debian-security bullseye-security/main Sources [13.6 kB] Get:4 http://security.debian.org/debian-security bullseye-security/main amd64 Packages [28.2 kB] Get:5 http://security.debian.org/debian-security bullseye-security/main Translation-en [15.0 kB] Fetched 101 kB in 1s (172 kB/s) Reading package lists... Done Building dependency tree Reading state information... Done 1151 packages can be upgraded. Run 'apt list --upgradable' to see them.
アップグレードに必要な領域があるか確認。スペース不足なので、いくつかパッケージを消した。
# apt -o APT::Get::Trivial-Only=true full-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: (snip) Use 'apt autoremove' to remove them. The following packages will be REMOVED: (snip) The following NEW packages will be installed: (snip) The following packages have been kept back: (snip) The following packages will be upgraded: (snip) 1145 upgraded, 166 newly installed, 50 to remove and 6 not upgraded. Need to get 2,290 MB of archives. After this operation, 1,318 MB of additional disk space will be used. E: Trivial Only specified but this is not a trivial operation.
二段階アップグレードの1段階目 upgrade を行う。
# apt upgrade --without-new-pkgs 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: (snip) Use 'apt autoremove' to remove them. The following packages have been kept back: (snip) The following packages will be upgraded: (snip) 689 upgraded, 0 newly installed, 0 to remove and 462 not upgraded. Need to get 315 MB of archives. After this operation, 28.5 MB of additional disk space will be used. Do you want to continue? [Y/n] Y (snip)
apt cleanしてキャッシュを削除した後、二段階アップグレードの2段階目 full-upgrade を行う。
# apt clean # apt-get full-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: (snip) Use 'apt autoremove' to remove them. The following packages will be REMOVED: (snip) The following NEW packages will be installed: (snip) The following packages have been kept back: (snip) The following packages will be upgraded: (snip) 456 upgraded, 166 newly installed, 50 to remove and 6 not upgraded. Need to get 1,975 MB of archives. After this operation, 1,290 MB of additional disk space will be used. Do you want to continue? [Y/n] Y (snip)
再起動
# shutdown -r
システムが degraded モードでないこと、エラーが出ないことを確認。アップデートによって設定ファイルが変わった場合などこれは、apt以外のパッケージシステム(pipとかcpanとか)に依存するデーモンを走らせている場合には必須
# systemctl status (snip) # systemctl (snip) # journalctl --boot --follow (snip)
いつもの通り、自作デーモンでエラーが出ていたので、perlのパッケージをupgrade
# yes '' | perl -MCPAN -e 'upgrade' (snip) # perl -e 'foreach(@INC){print "$_\n"};' /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl