0

I tried to uninstall Brave web browser using Discover (Kubuntu 24.10) and got this message:

cannot perform the following tasks: - Remove data for snap "brave" (452) (failed to remove snap "brave" base directory: remove /root/snap/brave: directory not empty)

I've tried a lot of commands I found online to purge this app completely but nothing has worked. The folder uses almost 0.5Gb and I could use the space.

Everything else appears to have been removed except the folder listed.

3 Answers3

0

So, when you remove a snap, just because that folder isn't empty doesn't mean you have a problem.

Like packages in apt and dpkg that will not remove directories that they manage if they're not empty on uninstall, snap has a similar mechanism.

The snap should already show as uninstalled now if you do snap list. You can simply delete the folder yourself to finish the cleanup.

Thomas Ward
  • 78,878
0

Sometimes you just have to use the command line. I run into the problem of orphaned files from apps I've removed all the time, particularly in .conf and .config directories.

If you want to remove /root/snap/brave, then just break down and do it with "rm -fr /root/snap/brave". Don't forget, though, that Brave (like a lot of software) leaves spoor in .config and .cache directories, usually with the directory name BraveSoftware. You can delete those by hand as well.

If you are super new to linux, the command line can be a little scary. But don't worry, you'll soon find that it's usually a lot more efficient than using a GUI. If you are not used to using the "rm" (remove) command, be sure to read the man page and some of the help pages online. There are a couple of "gotchas" with it, mostly having to do with wildcards.

0

Check that the brave snap package has been completely removed by running sudo snap remove brave.

If the snap removal fails or the directory remains, you can try manually deleting the directory by running sudo rm -rf /root/snap/brave. Make sure that the folder path is correct to avoid unintentionally removing files that you still need.

karel
  • 122,292
  • 133
  • 301
  • 332