This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
debian:upgradepathtemplate [2025/04/28 06:19] 37.187.226.31 old revision restored (2022/06/10 17:53) |
debian:upgradepathtemplate [2025/10/28 09:54] (current) 110.238.111.180 old revision restored (2024/03/06 07:26) |
||
|---|---|---|---|
| Line 5: | Line 5: | ||
| 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. | 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. Preparing for the upgrade | + | Debian Release |
| - | 1.1. Back up any data or configuration information | + | Jessie -> Buster -> Bullseye |
| - | 1.2. Inform users in advance | + | Stretch -> Buster -> Bullseye |
| - | 1.3. Prepare for downtime on services | + | Buster -> Bullseye |
| - | Set maintainance window for upgrade with buffer | + | |
| - | 1.4. Prepare for recovery | + | ===== 1. Preparing for the upgrade ===== |
| - | Verify the recoverability of system from backup image | + | |
| - | 1.5. Prepare a safe environment for the upgrade | + | |
| - | Local terminal or SSH access | + | ==== 1.1. Back up any data or configuration information |
| + | |||
| + | | ||
| + | ==== 1.2. Inform users in advance | ||
| + | |||
| + | === 1.2.1 - Who and How should be informed === | ||
| + | |||
| + | | ||
| + | |||
| + | === 1.2.2 - Notify 1 Day prior to planned upgrade === | ||
| + | |||
| + | === 1.2.3 - Notify 2 Hours prior to beginn of upgrade === | ||
| + | ==== 1.3. Prepare for downtime on services | ||
| + | |||
| + | Set maintainance window for upgrade with buffer | ||
| + | |||
| + | ==== 1.4. Prepare for recovery | ||
| + | |||
| + | | ||
| + | |||
| + | This is the perfect time to assess the Backup solution of the Company, when not previously done, if you are hired to ensure the reliability of the infrastructure. | ||
| + | ==== 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 23: | Line 55: | ||
| # apt-forktracer | sort | # apt-forktracer | sort | ||
| - | 2.1. Review actions pending in package manager | + | ==== 2.1. Review actions pending in package manager |
| - | # aptitude | + | |
| - | Select GO and review | + | |
| - | 2.2. Disabling APT pinning | + | Select GO and review |
| - | check / | + | |
| - | 2.3. Checking packages status | + | ==== 2.2. Disabling APT pinning |
| - | # dpkg --audit | + | |
| - | # aptitude search " | + | check / |
| - | # dpkg --get-selections | grep ' | + | |
| + | ==== 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 | ||
| + | |||
| + | ==== 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 ==== | ||
| + | |||
| + | This is where you notify everyone from Section 1.2 above prior to executing the command below. | ||
| + | |||
| + | # 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 ' | ||
| + | # 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 ===== | ||
| + | |||
| + | |||
| + | | ||
| + | |||
| + | # mount -o remount,rw / | ||
| + | |||
| + | ==== 5.1. Recording the session ==== | ||
| + | |||
| + | # script -t 2> | ||
| + | |||
| + | To replay session use scriptreplay | ||
| + | # scriptreplay ~/ | ||
| + | |||
| + | ==== 5.2. Updating the package list ==== | ||
| + | |||
| + | # apt-get update | ||
| + | |||
| + | ==== 5.3. Make sure you have sufficient space for the upgrade ==== | ||
| + | |||
| + | # apt-get -o APT:: | ||
| + | |||
| + | ==== 5.4. Minimal system upgrade ==== | ||
| + | |||
| + | # apt-get upgrade | ||
| + | |||
| + | ==== 5.5. Check functionality ==== | ||
| + | |||
| + | See 3.3 above | ||
| + | |||
| + | ==== 5.6. Upgrading the system ==== | ||
| + | |||
| + | # apt-get dist-upgrade | ||
| + | |||
| + | ==== 5.7. Check functionality ==== | ||
| + | |||
| + | See 3.3 above | ||
| + | |||
| + | ===== 6. Possible issues during upgrade ===== | ||
| + | |||
| + | |||
| + | ==== 6.1. Dist-upgrade fails with “Could not perform immediate configuration” ==== | ||
| + | |||
| + | # apt-get dist-upgrade -o APT:: | ||
| + | |||
| + | ==== 6.2. Expected removals ==== | ||
| + | |||
| + | ==== 6.3. Conflicts or Pre-Depends loops ==== | ||
| + | |||
| + | use -o APT:: | ||
| + | or | ||
| + | # dpkg --remove package_name | ||
| + | or | ||
| + | # apt-get -f install | ||
| + | # dpkg --configure --pending | ||
| + | or | ||
| + | # dpkg --install / | ||
| + | |||
| + | ==== 6.4. File conflicts ==== | ||
| + | |||
| + | # dpkg -r --force-depends package_name | ||
| + | |||
| + | ==== 6.5. Configuration changes ==== | ||
| + | |||
| + | | ||
| + | |||
| + | ==== 6.6. Change of session to console ==== | ||
| + | |||
| + | | ||
| + | |||
| + | ===== 7. Upgrading kernel and related packages ===== | ||
| + | |||
| + | |||
| + | ==== 7.1. Install any needed kernel metapackage ==== | ||
| + | |||
| + | Check for meta package | ||
| + | |||
| + | # dpkg -l " | ||
| + | |||
| + | if none are installed check which ones are available | ||
| + | |||
| + | # apt-cache search linux-image- | grep -i meta | grep -v transition | ||
| - | To remove a hold on a package: echo package_name install | dpkg --set-selections | + | |
| - | 2.4. Remove proposed-updates section if present in / | + | |
| - | 2.5. Verify Unofficial sources are available for target Debian version | + | |
| - | 3. Upgrading current version | + | # apt-cache show linux-image-amd64 |
| - | 3.1. Update current installation | + | ===== 8. Preparing for the next release ===== |
| - | # 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 | ||
| - | 4.1. Adding APT Internet sources | + | ==== 8.1. Purging removed packages ==== |
| - | # sudo sed -i ' | + | |
| - | # 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 | + | |
| - | Ensure all partition mountpoints are mounted read-write | + | get list of removed packages |
| - | # mount -o remount,rw /mountpoint | + | |
| - | 5.1. Recording the session | + | |
| - | | + | |
| - | To replay session use scriptreplay | + | |
| - | # scriptreplay ~/ | + | |
| - | 5.2. Updating the package list | + | |
| - | # apt-get update | + | |
| - | 5.3. Make sure you have sufficient space for the upgrade | + | |
| - | # apt-get -o APT:: | + | |
| - | 5.4. Minimal system upgrade | + | |
| - | # apt-get upgrade | + | |
| - | 5.5. Check functionality | + | |
| - | See 3.3 above | + | |
| - | 5.6. Upgrading the system | + | |
| - | # apt-get dist-upgrade | + | |
| - | 5.7. Check functionality | + | |
| - | See 3.3 above | + | |
| - | 6. Possible issues during upgrade | + | |
| - | 6.1. Dist-upgrade fails with “Could not perform immediate configuration” | + | |
| - | | + | |
| - | 6.2. Expected removals | + | |
| - | 6.3. Conflicts or Pre-Depends loops | + | |
| - | use -o APT:: | + | |
| - | or | + | |
| - | # dpkg --remove package_name | + | |
| - | or | + | |
| - | # apt-get -f install | + | |
| - | # dpkg --configure --pending | + | |
| - | or | + | |
| - | # dpkg --install | + | |
| - | 6.4. File conflicts | + | |
| - | # dpkg -r --force-depends package_name | + | |
| - | 6.5. Configuration changes | + | |
| - | Usually answer " | + | |
| - | 6.6. Change of session to console | + | |
| - | Ctrl+Alt+F1 should recover the terminal window | + | |
| - | 7. Upgrading kernel and related packages | + | or use |
| - | 7.1. Install any needed kernel metapackage | + | |
| - | Check for meta package | + | # aptitude purge ' |
| - | | + | |
| - | if none are installed check which ones are available | + | |
| - | # apt-cache | + | |
| - | select correct one based on value returned by running "uname -r" eg. kernel “2.6.32-5-amd64” | + | |
| - | # apt-cache show linux-image-amd64 | + | |
| - | 8. Preparing for the next release | + | ===== 9. Obsolete packages ===== |
| - | 8.1. Purging removed packages | ||
| - | Remove redundant or obsolete packages. see 5.3 above | ||
| - | get list of removed packages | ||
| - | # dpkg -l | awk '/^rc/ { print $2 }' | ||
| - | remove using | ||
| - | # apt-get purge $(dpkg -l | awk '/^rc/ { print $2 }') | ||
| - | or use | ||
| - | # aptitude search ' | ||
| - | # aptitude purge ' | ||
| - | 9. Obsolete | + | ==== 9.1. Dummy packages |
| - | 9.1. Dummy packages | ||