> ## Content Index
> Fetch the complete content index at: https://itsfoss.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Fix Unable to detect the URI-scheme of magnet Error In Xubuntu
- URL: https://itsfoss.com/unable-detect-urischeme-magnet/
- Published: 2014-03-23T01:13:21.000Z
- Updated: 2023-01-11T09:56:06.000Z
- Author: Abhishek Prakash
- Tags: #Import 2022-12-26 08:27

I was trying to download a ‘file’ from a torrent site with Magnet links. I was using Google Chrome in [Xubuntu](http://xubuntu.org/?ref=itsfoss.com) and surprisingly instead of opening a torrent client, it threw an error which read like:

**Unable to detect the URI-scheme of “magnet:?**

It was surprising for me as I never encountered such an error ever with other Linux OS such as Ubuntu or Linux Mint. After looking for a little, it turned out to be a bug in Linux OS based on [Xfce desktop environments](http://www.xfce.org/?ref=itsfoss.com). In this quick tip, I’ll share with you the fix I used for to solve the “**Unable to detect the URI-scheme of “magnet:”** error in Xubuntu.

## Fix Unable to detect the URI-scheme of “magnet: error

We will edit xdg-open file. You can use your preferred text editor be it GUI based or terminal based such as Vi. In Xubuntu, you can use mousepad in a terminal using the following command:

sudo mousepad /usr/bin/xdg-open

In the opened file, look for lines like:

open_xfce()  
{  
exo-open "$1"  
if [ $? -eq 0 ]; then  
exit_success  
else  
exit_failure_operation_failed  
fi  
}

Replace the above lines with the following and save the file:

open_xfce()  
{  
if (echo "$1" | grep -q '^magnet:'); then  
transmission-gtk "$1"  
else  
exo-open "$1"  
fi  
if [ $? -eq 0 ]; then  
exit_success  
else  
exit_failure_operation_failed  
fi  
}

If you are using any torrent application other than Transmission, you can use that application name in the above command in place of **transmission-gtk**.

Once you saved the changes, you should be able to open magnet files. No need to restart or even logout. It will start working straightaway.

### What we did to fix the problem

You problem is fixed but just in case you want to know what we did to fix the problem of “Unable to detect the URI-scheme of “magnet:”. If you are familiar with shell scripting you can easily figure it out. 

Here, if the argument to a command includes something that begins with “magnet:”, it will pass that argument to Transmission (or your own torrent application). As the standard with [magnet links](http://en.wikipedia.org/wiki/Magnet%5FURI%5Fscheme?ref=itsfoss.com), they always start with “magnet:” so all the magnet links will now be opened with Transmission.

I hope this quick post helped you to fix “Unable to detect the URI-scheme of “magnet:” error not only in Xubuntu but alos in other Xfce based distros such as ArchLinux, Manjaro, Linux Mint etc.