Unable to remove a snap package

Hi All :slight_smile:

I had to install snapd so that I could install lz4 in order to decompress a lz4 file on my almalinux.

Now I don’t want lz4 to be on the machine forever just to have to decompress this one file so I wanted to remove lz4 and then snapd cause I don’t use it enough to warrant it;s existence on the server so I proceeded to run sudo snap remove --purge lz4 to first remove lz4 but when I run this command, it just throws this out:

2021-08-27T18:51:53+02:00 ERROR cannot remove snap file “lz4”, will retry in 3 mins: unlinkat /var/lib/snapd/snap/lz4/3: device or resource busy
Remove snap “lz4” (3) from the system

I’m not sure what to do as it just sits here forever.

Any ideas on what to do??

rebooting the server allowed me to run the command and it succeeded this time. probably because there was an open file somewhere.

Running lsof yielded waaaay too many results to know which file so i just rebooted.

Now I’m trying to figure out how to unmount the old snap mounts. :stuck_out_tongue: