[Bug 1888916] Re: release upgrader can restore sources.list file from a previous release upgrade
Brian Murray
1888916 at bugs.launchpad.net
Tue Aug 25 20:58:31 UTC 2020
** Description changed:
- I've upgraded a server via `do-release-upgrade` from Ubuntu Bionic to
- Focal, with molly-guard installed on it - molly-guard configured to
- always ask for the hostname.
+ Impact
+ ------
+ The distribution upgrader creates a backup of your sources.list named sources.list.distUpgrade before upgrading your system. This file is not cleaned up after the upgrade and under the right set of circumstances (re-attaching to a screen session which starts the dist-upgrade again, or having a strange sources.list file) the sources.list.distUpgrade file will be restored which can result in a mismatch between what you are running and what is in sources.list.
+
+ Test Case
+ ---------
+ A simple test case is the following:
+ 1) Copy /etc/apt/sources.list to /etc/apt/sources.list.distUpgrade
+ 2) Modify /etc/apt/sources.list.distUpgrade to contain a previous release of Ubuntu e.g. 's/focal/eoan/'. (This simulates that you upgraded to your current release of Ubuntu.)
+ 3) Modify /etc/apt/sources.list to contain the release you want to which you want to upgrade (strange right‽)
+ 4) Run do-release-upgrade (with or w/o -d as necessary)
+ 5) When prompted about "No valid sources.list entry found" choose not to upgrade
+ 6) Observe that /etc/apt/sources.list has the same content as /etc/apt/sources.list.distUpgrade and that it doesn't match your current release.
+
+ With the version of the release upgrader in -proposed sources.list and
+ sources.list.distUpgrade will still have the same content but it will be
+ your current release.
+
+ A more involved test case would have one complete a release upgrade
+ choose not to reboot then reattach to the screen session (by pressing
+ r). After that they'd see the same thing as in Step 5 and Step 6 but
+ given that its the same code path it seems unnecessary.
+
+ Regression Potential
+ --------------------
+ The fix involves backing up your sources.list file before presenting the error dialog regarding "No valid sources.list entry found". So its literally moving the same two lines before the dialog but the copy and paste could have gone wrong so be observant for any Tracebacks.
+
+
+ Original Description
+ --------------------
+ I've upgraded a server via `do-release-upgrade` from Ubuntu Bionic to Focal, with molly-guard installed on it - molly-guard configured to always ask for the hostname.
After it has finished:
```
System upgrade is complete.
Restart required
- To finish the upgrade, a restart is required.
- If you select 'y' the system will be restarted.
+ To finish the upgrade, a restart is required.
+ If you select 'y' the system will be restarted.
Continue [yN] y
I: molly-guard: reboot is always molly-guarded on this system.
- Please type in hostname of the machine to reboot:
+ Please type in hostname of the machine to reboot:
Good thing I asked; I won't reboot bates ...
-
=== Command detached from window (Tue Jul 21 15:23:36 2020) ===
=== Command terminated normally (Tue Jul 21 15:23:46 2020) ===
```
- It doesn't alert you it was restoring original state of sources.list.
+ It doesn't alert you it was restoring original state of sources.list.
After rebooting the system and it came back up showing `Welcome to Ubuntu 20.04 LTS`, I've just noticed it was pointing out to bionic instead of focal installing a package.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ubuntu-release-upgrader in
Ubuntu.
https://bugs.launchpad.net/bugs/1888916
Title:
release upgrader can restore sources.list file from a previous release
upgrade
Status in ubuntu-release-upgrader package in Ubuntu:
Confirmed
Status in ubuntu-release-upgrader source package in Groovy:
Confirmed
Bug description:
Impact
------
The distribution upgrader creates a backup of your sources.list named sources.list.distUpgrade before upgrading your system. This file is not cleaned up after the upgrade and under the right set of circumstances (re-attaching to a screen session which starts the dist-upgrade again, or having a strange sources.list file) the sources.list.distUpgrade file will be restored which can result in a mismatch between what you are running and what is in sources.list.
Test Case
---------
A simple test case is the following:
1) Copy /etc/apt/sources.list to /etc/apt/sources.list.distUpgrade
2) Modify /etc/apt/sources.list.distUpgrade to contain a previous release of Ubuntu e.g. 's/focal/eoan/'. (This simulates that you upgraded to your current release of Ubuntu.)
3) Modify /etc/apt/sources.list to contain the release you want to which you want to upgrade (strange right‽)
4) Run do-release-upgrade (with or w/o -d as necessary)
5) When prompted about "No valid sources.list entry found" choose not to upgrade
6) Observe that /etc/apt/sources.list has the same content as /etc/apt/sources.list.distUpgrade and that it doesn't match your current release.
With the version of the release upgrader in -proposed sources.list and
sources.list.distUpgrade will still have the same content but it will
be your current release.
A more involved test case would have one complete a release upgrade
choose not to reboot then reattach to the screen session (by pressing
r). After that they'd see the same thing as in Step 5 and Step 6 but
given that its the same code path it seems unnecessary.
Regression Potential
--------------------
The fix involves backing up your sources.list file before presenting the error dialog regarding "No valid sources.list entry found". So its literally moving the same two lines before the dialog but the copy and paste could have gone wrong so be observant for any Tracebacks.
Original Description
--------------------
I've upgraded a server via `do-release-upgrade` from Ubuntu Bionic to Focal, with molly-guard installed on it - molly-guard configured to always ask for the hostname.
After it has finished:
```
System upgrade is complete.
Restart required
To finish the upgrade, a restart is required.
If you select 'y' the system will be restarted.
Continue [yN] y
I: molly-guard: reboot is always molly-guarded on this system.
Please type in hostname of the machine to reboot:
Good thing I asked; I won't reboot bates ...
=== Command detached from window (Tue Jul 21 15:23:36 2020) ===
=== Command terminated normally (Tue Jul 21 15:23:46 2020) ===
```
It doesn't alert you it was restoring original state of sources.list.
After rebooting the system and it came back up showing `Welcome to Ubuntu 20.04 LTS`, I've just noticed it was pointing out to bionic instead of focal installing a package.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1888916/+subscriptions
More information about the foundations-bugs
mailing list