1

I looked on google for how to uninstall Wine. I found something and it told me to enter these:

rm -r "$HOME/.wine"
rm  $HOME/.config/menus/applications-merged/wine*
rm -r "$HOME/.local/share/applications/wine"
rm $HOME/.local/share/desktop-directories/wine*
rm $HOME/.local/share/icons/????_*.xpm

After entering them I looked in the comments saying it might nuke your home folder. Is this true? I can't see anything wrong right now.

3
  • 5
    Partially true. It will nuke your home folder if you run rm -rf "$HOME". So I suggest you to first read the whole article before attempting to run something which includes rm in the command. May 5 '17 at 20:44
  • Thanks. Did it damage anything and will I need to re-install Ubuntu?
    – RedStar12
    May 5 '17 at 20:46
  • @RedStar12 nope, that's unlikely.
    – grooveplex
    May 5 '17 at 22:11
4

Let's understand how rm -rf command works first. It removes everything in a given directory and the directory itself, so if you give it path $HOME/directory_1/directory_2/ the directory_2 will be gone along with its files. The rest of the path will be safe. Heres' an example:

$ tree somethings/                                     
somethings/
└── subdirectory_1
    ├── a
    └── b

1 directory, 2 files
$ rm -rf somethings/subdirectory_1/                    

$ tree somethings
somethings

So as far as your commands go:

  • rm -r "$HOME/.wine" only removed .wine directory
  • rm $HOME/.config/menus/applications-merged/wine* only took care of all files starting with wine string in $HOME/.config/menus/applications-merged folder
  • rm -r "$HOME/.local/share/applications/wine" removed the wine folder only
  • rm $HOME/.local/share/desktop-directories/wine* got rid of the files starting with wine in $HOME/.local/share/desktop-directories folder
  • rm $HOME/.local/share/icons/????_*.xpm nuked all .xpm files.

In other words they're sufficiently safe.


What me and Rinzwind have discussed in the comments and Ask Ubuntu chatroom, is that it's possible to alter $HOME variable. Yes, it is possible, but if you intentionally alter $HOME , you need to keep that in mind; otherwise, it's not rm's fault and let's be honest - it's plain stupid from user's point of view. Commands work only on the path you give it, so give the commands proper path.

Other potential issues is spaces. If you have space in your home folder name, like /home/My User, then without quotes around $HOME the shell will think you're giving it two arguments, /home/My and User. This effect is known as word splitting. So always quote your variables like "$HOME"

2
  • this is assuming $HOME was not changed by the user ;-)
    – Rinzwind
    May 6 '17 at 9:29
  • @Rinzwind explain what do you mean please ? May 6 '17 at 15:22
0

Partially true. It will nuke your home folder if you run rm -rf "$HOME". So I suggest you to first read the whole article before attempting to run something which includes rm in the command.

And no. As far as we can see, it didn't hurt anything essential or necessary for the correct system operation.

You have so far, removed WINE's configuration files, which WINE will rebuild when necessary and/or reinstalled.

So calm down and good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.