[Bug 1888916] Re: release upgrader can restore sources.list file from a previous release upgrade
Łukasz Zemczak
1888916 at bugs.launchpad.net
Thu Aug 27 12:33:22 UTC 2020
Hello Patricia, or anyone else affected,
Accepted ubuntu-release-upgrader into focal-proposed. The package will
build now and be available at https://launchpad.net/ubuntu/+source
/ubuntu-release-upgrader/1:20.04.25 in a few hours, and then in the
-proposed repository.
Please help us by testing this new package. See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed. Your feedback will aid us getting this
update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested, what testing has been
performed on the package and change the tag from verification-needed-
focal to verification-done-focal. If it does not fix the bug for you,
please add a comment stating that, and change the tag to verification-
failed-focal. In either case, without details of your testing we will
not be able to proceed.
Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in
advance for helping!
N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.
** Changed in: ubuntu-release-upgrader (Ubuntu Focal)
Status: In Progress => Fix Committed
** Tags added: verification-needed verification-needed-focal
--
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:
Fix Released
Status in ubuntu-release-upgrader source package in Focal:
Fix Committed
Status in ubuntu-release-upgrader source package in Groovy:
Fix Released
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 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