pop-os / upgrade

Utility for upgrading Pop!_OS and its recovery partition to new releases.
GNU General Public License v3.0
95 stars 29 forks source link

Auto-remove remoteless packages before upgrade #293

Closed mmstick closed 2 years ago

mmstick commented 2 years ago

This will auto-remove locally-installed packages with no remote repository. These packages either belonged to a PPA or were installed with Eddy / dpkg by hand, which might conflict with apt's dependency resolution in the future. You can get a list of packages that would be removed by running this:

git clone https://github.com/pop-os/apt-cmd
cd apt-cmd
cargo run --example remoteless
mmstick commented 2 years ago

Sounds like a conflict with the pop-system-updater package perhaps?

jacobgkau commented 2 years ago

Sounds like a conflict with the pop-system-updater package perhaps?

I installed other updates to make sure it wasn't anything else I have installed (I removed the staging branch, installed updates, then added the staging branch back), and pop-system-updater is able to be installed. I then get this when running the same command as above:

system76@pop-os:~$ sudo apt install pop-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libgsound0 librygel-core-2.6-2 librygel-db-2.6-2 librygel-renderer-2.6-2
  librygel-server-2.6-2 libs76-hidpi-widget libwhoopsie-preferences0
  libwhoopsie0 rygel whoopsie-preferences
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  gnome-control-center libpop-upgrade-gtk pop-desktop system76-driver
  system76-driver-nvidia
The following packages will be upgraded:
  pop-upgrade
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  pop-desktop gnome-control-center (due to pop-desktop)
1 upgraded, 0 newly installed, 5 to remove and 8 not upgraded.
Need to get 1,946 kB of archives.
After this operation, 11.6 MB disk space will be freed.
This operation is not permitted because it will break the system.
Abort.

Which doesn't mention system-updater, so maybe it's something else.

jacobgkau commented 2 years ago

The libpop-upgrade-gtk from this staging branch depends on libpop-system-updater-gtk, but that package has no sources available on this 20.04 machine, that's why it's trying to remove libpop-upgrade-gtk.

mmstick commented 2 years ago

I'll get that fixed then

mmstick commented 2 years ago

The newer version of pop-system-updater will get published there soon.

jacobgkau commented 2 years ago

This doesn't seem to cause any problems, although it doesn't work very consistently across a variety of situations.

Thoughts on the inconsistency? Is removing only completely-orphaned packages accomplishing the goal, or should this be more robust? I'm not aware of the specific case/cases that prompted this feature.

mmstick commented 2 years ago

So it isn't a good idea to remove sourceless packages after fetching package lists for the next release, because some of those are essential packages to the current release. It'd only be safe to do that after the release is finished upgrading.

I was able to locate and downgrade packages that are installed locally with a package version higher than from the sources. I was able to get spotify-client to automatically uninstall, and qbittorrent is correctly downgraded to the repository version after being installed from a PPA.

jacobgkau commented 2 years ago

spotify-client is still removed when upgrading from 21.10 to 22.04 and not removed when upgrading from 20.04 to 22.04. This isn't a problem since pop-transition is there to handle it; pop-transition shows up for it now since the installed version's source was Pop.

Still need to do a little more regression testing on this.

Derisis13 commented 2 years ago

I have read trough the conversation and the commit messages but I still can't tell what is the conclusion: do I need to create a list of the applications I have installed and have no sources before upgrading or are they excluded from the removal automatically (by generating a list of them before any upgrading takes place)?

mmstick commented 2 years ago

This is something that is performed automatically by these changes. There is no user intervention required. This change has not been released yet.