0

How do I safely uninstall snaps which are installed by transitional packages? For example I upgraded a system from 20.04 to 22.04 which had chromium-browser installed. As a result, chromium-browser was upgraded to:

rc chromium-browser 1:85.0.4183.83-0ubuntu0.20.04.2 amd64 Transitional package - chromium-browser -> chromium snap

Which resulted in /snap/chromium being populated

I now need to uninstall this. I apt-get remove'd the chromium and chromium-browser packages (then apt-get autoremove'd all orphaned dependencies), however /snap/chromium did not get smaller. dpkg -l | grep chromium still shows the chromium-browser line shown above.

what is the right way to remove this snap, without apt transitional packages getting out-of-sync?

I ask because I have a bunch of other /snap/* directories I want to clean up to recover disk space on this smaller aging system, however they must have been installed by apt and I do not want to remove the snap packages directly.

  • chromium converted to snap package prior to 20.04, thus it was a snap package in 20.04 & no conversion or change occurred on release-upgrade to later releases than 20.04 as snap packages don't change. If you note your paste it was installed at 20.04 as if the change occurred at 22.04 you would have pasted 1:85.0.4183.83-0ubuntu2 – guiverc Sep 13 '22 at 02:57
  • Ok thanks, perhaps I included enough details to distract from my real question.

    Does APT track snap packages after the transition? Or are they just snap, and I can remove them safely via snap directly without apt getting out of sync? @guiverc

    – flieslikeabrick Sep 13 '22 at 02:58
  • Apt knows nothing about snap packages, and apt cares nothing about snap packages. You can safely remove transition packages at any time. – user535733 Sep 13 '22 at 03:10

1 Answers1

2

"Transitional" packages do not include application files. They are essentially just a script that runs snap install <snap-package-name> and possibly copies any user data to the new location in ~/.snap/.

  • After a transitional package has been installed once, it's done. Running it's script and installing the snap are part of the apt install process -- you DON'T need to "run" it or "launch" it; apt did it for you already. It's job is finished.

  • Installing the snap does NOT require the transitional apt package; you can simply snap install <snap-name> yourself. if you wish.

  • The transitional package can be safely removed at any time...or safely left installed. Apt won't complain because transitional packages have no deb dependencies.

How to remove a transitional package:

sudo apt remove <transitional-package>

Transitional packages are a one-way trip. You cannot remove snap packages by using apt. Removing the apt package WON'T remove the snap, and removing the apt package won't break anything.

If you want to remove the snap package, use the snap command.

To remove the newly-installed snap:

sudo snap remove <snap-package-name>
  • If you don't know the snap package name, run snap list to see what snaps are installed.

  • The transitional apt package won't care if you remove the snap. However, if the apt package is installed, it might try to reinstall the snap in the future.

user535733
  • 62,253
  • Thank you -- so to confirm, snap remove won't piss off apt (make its metadata/state inconsistent, upsetting dependency resolutions or future uninstallation/reinstallation options of packages), because the transitional packages were one-way? They installed the snap, and have zero involvement after that? – flieslikeabrick Sep 13 '22 at 03:02