[Blog] [Docs] [Code] [Slides] [About]

Debian发行版更新指南阅读笔记

2020-09-14 18:00 CST

2020-09-14 20:25 CST

4.2 Checking APT configuration status

Pure Debian stable system:

  • APT does not have sources besides current release
  • No software from other release or thrid party installed
  • Source-list files are consistent

Direct upgrade from across more than one release is not supported.

Need to upgrade to latest current release before upgrading to next major release.

Prevent conflicts in advance:

  • Remove proposed-update section in source-list
  • Check non-Debian and unofficial packages
  • Disable APT pinning of packages

Use dpkg -l to check all packages is in upgradable state, and no essential package is on hold. However, changed and compiled packages should still be hold and not upgrade them.

4.3 Preparing APT source-list files

Reconfigure source-list files:

  • APT will install package with highest version number, giving priority to first entry in files.
  • List sources in order of local drive, CD-ROMs, remote mirrors.
  • Add sources of latest release and remove sources for last release.

4.4 Upgrading packages

  • Use apt to upgrade release (for interactive use).
  • Don’t use apt in scripts, use apt-get instead.

Record the upgrade session for future investigation:

$ script -t 2>~/upgrade-buster-$step.time -a ~/upgrade-buster-$step.script
  • apt will log changed package states in /var/log/apt/history.log and terminal output in /var/log/apt/term.log
  • dpkg will log all package state changes in /var/log/dpkg.log

Now update all available packages to be fetched by apt update.

Estimate disk space needed for the installation and make sure there is enough space to download packages in /var/cache/apt/archives:

$ apt -o APT::Get::Trivial-Only=true full-upgrade

After the download, you will probably need more space in other file system partitions in order to both install upgraded packages (which might contain bigger binaries or more data) and new packages that will be pulled in for the upgrade. If your system does not have sufficient space you might end up with an incomplete upgrade that is difficult to recover from.

If there is no space:

  • Remove packages downloaded for installation
  • Remove forgotten packages (automatically installed and no longer used)
  • Find redundant packages, manually review and remove them
  • Remove translations and localization files
  • Remove or move system log files to other systems
  • Use a temporary /var/cache/apt/archives (mount --bind)
  • Do a minimal system upgrade

The upgrade is recommend in a two-part process:

  • Do a minimal system upgrade: apt upgrade
    • Upgrade packages without removing or installing other packages
    • Useful if system is tight on space or cannot run full upgrade
  • Upgrade the system: apt full-upgrade
    • Perform a complete upgrade of the system
    • Resolves all dependency changes between packages in different releases
    • Install new packages and remove conflicting obsoleted packages
<EOF>

Loading Comments By Disqus