This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
debian:upgradepathtemplate [2024/04/17 22:13] 51.174.65.41 old revision restored (2024/04/14 18:29) |
debian:upgradepathtemplate [2024/04/30 16:41] 135.181.212.177 old revision restored (2022/11/15 12:43) |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Template for Debian System Release Upgrade ====== | ====== Template for Debian System Release Upgrade ====== | ||
- | 1. Preparing | + | This template is meant to serve as a general upgrade path for any Debian release. This is my standard path and will be adjusted based on the " |
- | 1.1. Back up any data or configuration information | + | I will normally create a complete system clone and use this template to work out the entire correct and functional path for the production system in question. |
- | 1.2. Inform users in advance | + | |
- | 1.3. Prepare for downtime on services | + | Debian Release upgrade paths: |
- | Set maintainance window for upgrade with buffer | + | |
- | 1.4. Prepare for recovery | + | Jessie -> Buster -> Bullseye |
- | Verify the recoverability of system from backup image | + | Stretch -> Buster -> Bullseye |
- | 1.5. Prepare a safe environment for the upgrade | + | Buster -> Bullseye |
- | Local terminal or SSH access | + | |
+ | ===== 1. Preparing for the upgrade ===== | ||
+ | |||
+ | |||
+ | ==== 1.1. Back up any data or configuration information | ||
+ | |||
+ | ==== 1.2. Inform users in advance | ||
+ | |||
+ | ==== 1.3. Prepare for downtime on services | ||
+ | |||
+ | Set maintainance window for upgrade with buffer | ||
+ | |||
+ | ==== 1.4. Prepare for recovery | ||
+ | |||
+ | | ||
+ | |||
+ | ==== 1.5. Prepare a safe environment for the upgrade | ||
+ | |||
+ | Local terminal or SSH access | ||
+ | |||
+ | ==== 1.6. Develop tests for section 3.3 that will ensure correct execution of needed tasks ==== | ||
+ | |||
+ | | ||
+ | a. Web server delivers correctly | ||
+ | b. php scripts execute correctly | ||
+ | c. DB runs correctly | ||
+ | d. mail works | ||
+ | |||
+ | ===== 2. Checking system status ===== | ||
- | 2. Checking system status | ||
find NON-Pure Debian packages | find NON-Pure Debian packages | ||
Line 19: | Line 46: | ||
# apt-forktracer | sort | # apt-forktracer | sort | ||
- | | + | ==== 2.1. Review actions pending in package manager |
- | # aptitude | + | |
- | Select GO and review | + | |
- | 2.2. Disabling APT pinning | + | |
- | check / | + | |
- | 2.3. Checking packages status | + | |
- | # dpkg --audit | + | |
- | # aptitude search " | + | |
- | # dpkg --get-selections | grep ' | + | |
- | To remove a hold on a package: echo package_name install | dpkg --set-selections | + | # aptitude |
- | 2.4. Remove proposed-updates section if present in / | + | |
- | 2.5. Verify Unofficial sources are available for target Debian version | + | |
- | 3. Upgrading current version | + | ==== 2.2. Disabling APT pinning ==== |
- | 3.1. Update current installation | + | check /etc/apt/ |
- | # sudo apt update | + | |
- | 3.2. Upgrade current installation | + | |
- | # sudo apt upgrade | + | |
- | 3.3. Check functionality | + | |
- | Verify all services required of current host is functioning correctly | + | |
- | 3.4. Upgrade current distribution | + | |
- | # sudo apt dist-upgrade | + | |
- | 3.5. Check functionality | + | |
- | see 3.3 above | + | |
- | 4. Preparing sources for APT | + | ==== 2.3. Checking packages status ==== |
- | | + | # dpkg --audit |
- | # sudo sed -i ' | + | # aptitude search " |
- | # sudo sed -i ' | + | # dpkg --get-selections | grep ' |
- | 4.2. Adding APT sources for a local mirror | + | |
- | Only required for special in-house software | + | To remove a hold on a package: |
- | 4.3. Adding APT sources from optical media | + | echo package_name install | dpkg --set-selections |
- | Only required for special 3rd party delivered software | + | |
+ | ==== 2.4. Remove proposed-updates section if present in / | ||
+ | |||
+ | ==== 2.5. Verify Unofficial sources are available for target Debian version ==== | ||
+ | |||
+ | |||
+ | ===== 3. Upgrading current version ===== | ||
+ | |||
+ | |||
+ | 3.1. Update current installation | ||
+ | # sudo apt update | ||
+ | 3.2. Upgrade current installation | ||
+ | # sudo apt upgrade | ||
+ | 3.3. Check functionality | ||
+ | | ||
+ | 3.4. Upgrade current distribution | ||
+ | # sudo apt dist-upgrade | ||
+ | 3.5. Check functionality | ||
+ | see 3.3 above | ||
+ | |||
+ | ===== 4. Preparing sources for APT ===== | ||
+ | |||
+ | |||
+ | 4.1. Adding APT Internet sources | ||
+ | |||
+ | | ||
+ | # sudo sed -i ' | ||
+ | |||
+ | 4.2. Adding APT sources for a local mirror | ||
+ | |||
+ | Only required for special in-house software | ||
+ | |||
+ | 4.3. Adding APT sources from optical media | ||
+ | |||
+ | Only required for special 3rd party delivered software | ||
+ | |||
+ | ===== 5. Upgrading packages ===== | ||
- | 5. Upgrading packages | ||
Ensure all partition mountpoints are mounted read-write | Ensure all partition mountpoints are mounted read-write | ||
# mount -o remount,rw /mountpoint | # mount -o remount,rw /mountpoint | ||
- | | + | 5.1. Recording the session |
# script -t 2> | # script -t 2> | ||
To replay session use scriptreplay | To replay session use scriptreplay | ||
# scriptreplay ~/ | # scriptreplay ~/ | ||
- | | + | 5.2. Updating the package list |
# apt-get update | # apt-get update | ||
- | | + | 5.3. Make sure you have sufficient space for the upgrade |
# apt-get -o APT:: | # apt-get -o APT:: | ||
- | | + | 5.4. Minimal system upgrade |
# apt-get upgrade | # apt-get upgrade | ||
- | | + | 5.5. Check functionality |
See 3.3 above | See 3.3 above | ||
- | | + | 5.6. Upgrading the system |
# apt-get dist-upgrade | # apt-get dist-upgrade | ||
- | | + | 5.7. Check functionality |
See 3.3 above | See 3.3 above | ||
- | 6. Possible issues during upgrade | + | ===== 6. Possible issues during upgrade |
- | | + | |
+ | 6.1. Dist-upgrade fails with “Could not perform immediate configuration” | ||
# apt-get dist-upgrade -o APT:: | # apt-get dist-upgrade -o APT:: | ||
- | | + | 6.2. Expected removals |
- | 6.3. Conflicts or Pre-Depends loops | + | 6.3. Conflicts or Pre-Depends loops |
use -o APT:: | use -o APT:: | ||
or | or | ||
Line 92: | Line 137: | ||
or | or | ||
# dpkg --install / | # dpkg --install / | ||
- | | + | 6.4. File conflicts |
# dpkg -r --force-depends package_name | # dpkg -r --force-depends package_name | ||
- | | + | 6.5. Configuration changes |
Usually answer " | Usually answer " | ||
- | | + | 6.6. Change of session to console |
Ctrl+Alt+F1 should recover the terminal window | Ctrl+Alt+F1 should recover the terminal window | ||
- | 7. Upgrading kernel and related packages | + | ===== 7. Upgrading kernel and related packages |
- | | + | |
+ | 7.1. Install any needed kernel metapackage | ||
Check for meta package | Check for meta package | ||
# dpkg -l " | # dpkg -l " | ||
Line 109: | Line 155: | ||
# apt-cache show linux-image-amd64 | # apt-cache show linux-image-amd64 | ||
- | 8. Preparing for the next release | + | ===== 8. Preparing for the next release |
- | | + | |
+ | 8.1. Purging removed packages | ||
Remove redundant or obsolete packages. see 5.3 above | Remove redundant or obsolete packages. see 5.3 above | ||
get list of removed packages | get list of removed packages | ||
Line 121: | Line 168: | ||
# aptitude purge ' | # aptitude purge ' | ||
- | 9. Obsolete packages | + | ===== 9. Obsolete packages |
- | | + | 9.1. Dummy packages |