MasterGeekMX / snap-to-flatpak

A BASH script that removes Snap from an Ubuntu system and replaces it with Flatpak
GNU General Public License v3.0
85 stars 13 forks source link

Issue at removing snapd #2

Closed Aditya753b closed 2 years ago

Aditya753b commented 2 years ago

Screenshot from 2022-06-13 17-32-50

Stuck at removing core20 so i manually tried to remove snapd it by running a seperate command and this error is coming...

intelligentgaming commented 2 years ago

The error message tells you what to do, remove core first.

"sudo snap remove core" and then "sudo snap remove snapd".

MasterGeekMX commented 2 years ago

Yeah. snaps can't be uninstalled if they are a dependency of other snap. If you check the script what it does is that it tries to remove each snap, and if it fails it goes to the next snap on the list and so on. the reason why you don't see any error messages on the script is becasue I'm sending them out to the sink.

Look at line 84 on the script:

sudo snap remove --purge $current_snap 2> /dev/null

the 2> is for taking the error output and then redirecting it at the /dev/null device, which is a black hole for data.

try removing the 2> /dev/null from the scrip (it is completely safe) and see how it tries on each item till if finds one that can be removed.

and if you look the rest of that part of the script, it checks if the snap could be removed and then erases it from the list fo snaps to remove.

the script does that cycle of going in each snap on the list and trying to remove it till the snap list is empty (meaning that we were able to remove all of them)