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.

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
  • 68,493