If you’ve installed Wine on your Linux machine, you may have noticed that it creates file associations for common Windows file types. This can be annoying if you regularly use Linux programs to open these file types. In this article, we’ll show you how to unregister Wine file associations in Linux.
In this article, we will show you how to unregister wine file associations in Linux. This can be useful if you want to remove an old wine installation, or if you want to reset your file associations to the default values.
We will first show you how to unregister wine file associations using the command line. We will then show you how to do this using the GUI.
Unregistering wine file associations using the command line
The first thing you need to do is open a terminal. You can do this by pressing Ctrl+Alt+T or by going to Applications -> Accessories -> Terminal.
Once you have a terminal open, you need to run the following command:
gconftool-2 –recursive-unset /desktop/gnome/url-handlers/wine
This will unregister all of the wine file associations.
Unregistering wine file associations using the GUI
The second way to unregister wine file associations is to use the GUI. This can be done by going to Applications -> System Tools -> Preferences -> Default Applications.
Scroll down until you find the section for “URL Handlers”. Find the entry for “wine” and click the “Remove” button.
This will remove the wine file associations.
What are file associations?
A file association is a link between a file type and the program that opens it. In Linux, file associations are managed by the desktop environment. When you open a file in Linux, the system looks at the file extension and then launches the associated program.
For example, if you open a file with the .txt extension, the system will launch the text editor. If you open a file with the .mp3 extension, the system will launch the music player.
Wine is a program that allows you to run Windows applications on Linux. When you install Wine, it will create file associations for Windows applications. That means that if you open a file with a .exe extension, it will launch the Wine program.
However, you may not want Wine to handle all .exe files. Or, you may want to use a different program to open .exe files. In that case, you will need to unregister the file associations that Wine has created.
To do that, open a terminal and type the following command:
For each file in this directory that has a .desktop extension, open the file in a text editor and look for the line that starts with “Exec=”. This line contains the command that is executed when you open the file.
If the command includes the word “wine”, that means the file is associated with Wine. To unregister the association, simply delete the “Exec=” line. Save the file and close the text editor.
Repeat this process for each file in the directory. Once you have unregistered all of the file associations, you can then associate .exe files with the program of your choice.
Why would you want to unregister them?
If you’ve registered file associations for Wine and you want to unregister them, you can do so easily in Linux. This is helpful if you want to use another application to open files that are associated with Wine. To unregister file associations, follow these steps:
1. Open a terminal.
2. Type in the following command:
for i in `ls ~/.local/share/applications/wine*`; do echo $i; sudo sed -i -e ‘s/^Exec=wine/\#\!\/bin\/sh\nexec wine/g’ $i; done
3. Press Enter.
This will unregister all file associations for Wine.
How to do it in Linux
If you’re a Linux user, you may occasionally need to unregister a file association for a specific program. This can be done by opening the terminal and using the “unlink” command.
For example, let’s say you want to unregister the “.txt” file extension for the program “gedit”. You would first open the terminal and type the following command:
unlink ~/.local/share/applications/gedit.desktop ~/.local/share/applications/mimeinfo.cache
This will remove the “.txt” file association from gedit. You can then register the file extension with another program using the “link” command.
If you want to remove wine file associations in Linux, the easiest way is to use the GUI method. Here are the steps:
1. Open the wine file manager.
2. Select the file type that you want to remove the association for.
3. In the right-hand pane, right-click on the association and select “Remove Association”.
That’s all there is to it! Your file associations will now be removed and you’ll be able to open files in the default application for that file type.
Command Line Method
The following method will unregister all wine file associations in Linux. This can be useful if you want to remove wine from your system, or if you want to reset your file associations.
1. Open a terminal.
2. Run the following command:
for f in ~/.local/share/applications/wine-extension*; do echo -ne “$f\0″; done | xargs -0 -n1 env WINEPREFIX=”$HOME/.wine” wine unregister
This will unregister all wine file associations.