linuxmint / mintupgrade

41 stars 16 forks source link

Mintupgrade performs un-backed-up permanent changes to apt configuration before user authorizes upgrade #60

Open VA1DER opened 1 year ago

VA1DER commented 1 year ago

The current iteration of mintupgrade performs silent, permanent changes to /etc/apt/sources.d/official-package-repositories.list before the user has actually authorized the upgrade. This is occurring during phase 2, which is labelled "Simulation and Download". When the user is presented with a proposed list of changes, if the user declines and exits the utility rather than continue with the upgrade, then apt is left with a (silently) changed configuration that tells it that the system is currently on Mint 21 (Vanessa). This has the effect of then causing some mischief with mintupdate, which will then itself try to update all the packages to Mint 21.

There are many reasons why the user may not want to proceed with an upgrade at some point before it is authorized. For example, in my case, I did not like that the upgrade was going to leave me with gcc 9, 10, 11, and 12 all installed at once. After I exited, I found apt had been silently changed and that no backup had been made to it.

At any time before the upgrade is actually authorized, exiting from mintupgrade should revert all changes to apt so that the system is not in an unstable hybrid state (Mint 20.3 packages with apt configured as if it is Mint 21).

In addition to an automatic reversion to original apt configuration on mintupgrade's normal termination at any point before the upgrade is commenced, it should also back up all apt configuration files which it touches. This in case an unforseen crash or system restart occurs before the upgrade proceeds. In fact, an entry in should be made in something like /etc/rc.local which will cause the apt configuration files to revert to normal at next system restart.

nonkreon commented 1 year ago

I second this, I experienced the same thing last night. My internet connection went unstable during the "phase 2, which is labelled "Simulation and Download"" and it wasn't able to refresh all InRelease/Metadata/Packages, ended up showing it would remove a lot of packages since it couldn't find them in the new (incomplete) package lists.