New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Closed
sojharo opened this issue
Jan 6, 2016
· 15 comments
Closed
xdg-open command not found error on Ubuntu
#1538
sojharo opened this issue
Jan 6, 2016
· 15 comments
Comments
I have used this boilerplate on windows and it works fine.
However, I recently switched to Ubuntu and my same project is not working there.
When I give command : grunt serve
It fails on following message:
Running "open:server" (open) task
Warning: Command failed: /bin/sh -c sudo -u sojharo /media/sojharo/Data/blood-donations/node_modules/open/vendor/xdg-open "http://localhost:9000"
sudo: /media/sojharo/Data/blood-donations/node_modules/open/vendor/xdg-open: command not found
Use --force to continue.
What is your Ubuntu version?
I dont have exact the same issue, but I encounter some errors in Ubuntu 15.04, while in Ubuntu 14.04.3 LTS everything works just fine and smooth.
How about run the following command in your terminal
to confirm if your xdg-open is installed in your ubuntu system
mine shows
if not installed, you can try
sudo apt-get install xdg-utils --fix-missing
Please let me know if this solves your problem. Have a nice day! 
ramaprv, moegts, and VismayaSathyan reacted with hooray emoji
zashishz, larry-dalmeida, vivian-src, Andryas, moegts, hemantsomanna, and VismayaSathyan reacted with heart emoji
Thank you for nice response
My Ubuntu version is 14.04.3 LTS. I just installed it 10 days back.
I ran the command which xdg-open and it exactly showed me /usr/bin/xdg-open
I ran the command ‘sudo apt-get install xdg-utils —fix-missing’
It showed
Reading package lists... Done
Building dependency tree
Reading state information... Done
xdg-utils is already the newest version.
xdg-utils set to manually installed.
The following packages were automatically installed and are no longer required:
linux-headers-3.19.0-25 linux-headers-3.19.0-25-generic
linux-image-3.19.0-25-generic linux-image-extra-3.19.0-25-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.
The problem is still not resolved for me. However, I start the server using this command now : grunt serve --force. It doesn’t crash but shows the problem. However, after this I am successfully able to go to the localhost:9000 in my browser
Until you figure this out, I’d suggest removing the 'open' task from grunt serve instead of using --force
Nice to know you can access your app now!
However it is strange that the error occurs even your xdg-open is installed.
my next guess is:
Are you using sudo to run
or did you use command like
in the generation process at any point?
When I use
I get permission denied error.
When I use
I get the error xdg-open command not found for which I have opened this issue.
I remember npm install also gave me some permission issues, therefore I had to use command:
Should I clone my project again and then try with npm install?
Yes, I highly recommend you to do it again without sudo
The things you need to sudo install are the packages supposed to be used globally (everywhere in your machine):
like npm itself, grunt-cli, bower, yo, generator-angular-fullstack etc. using
sudo npm install -g packagename
Please try again with a clean generation use
mkdir yourapp
cd yourapp
yo angular-fullstack
Good luck 
I created a new and clean application using yo angular-fullstack. I did not use sudo anywhere. Still, I got the same Permission denied error.
And when I used sudo grunt serve, I got command not found error.
Thanks @Awk34 for suggestion to remove the ‘open’.
Could you please show us your permission error messages?
and can you confirm by:
sudo npm list -g --depth=0
to find out what has been installed globally, and show us the result please?
Without knowing the details of your machine and your setup process, I’m guessing that you might be installing your grunt or something globally which might cause the error.
If it is the case, the following commands might solve your problem:
sudo npm uninstall -g grunt
cd yourapp
npm install grunt
(Highly recommended) Also remove all the packages that are not supposed to be install globally by running
sudo npm uninstall -g packagename
and install them locally withou sudo
On sudo npm list -g --depth=0 I got:
/usr/local/n/versions/node/5.2.0/lib
└── npm@3.3.12
On sudo npm list -g --depth=1, I got:
/usr/local/n/versions/node/5.2.0/lib
└─┬ npm@3.3.12
├── abbrev@1.0.7
├── ansi-regex@2.0.0
├── ansicolors@0.3.2
├── ansistyles@0.1.3
├── aproba@1.0.1
├── archy@1.0.0
├── async-some@1.0.2
├── chownr@1.0.1
├── cmd-shim@2.0.1
├── columnify@1.5.2
├── config-chain@1.1.9
├── debuglog@1.0.1
├── dezalgo@1.0.3
├── editor@1.0.0
├── fs-vacuum@1.2.7
├── fs-write-stream-atomic@1.0.4
├── fstream@1.0.8
├── fstream-npm@1.0.5
├── glob@5.0.15
├── graceful-fs@4.1.2
├── has-unicode@1.0.1
├── hosted-git-info@2.1.4
├── iferr@0.1.5
├── inflight@1.0.4
├── inherits@2.0.1
├── ini@1.3.4
├── init-package-json@1.9.1
├── lockfile@1.0.1
├── lodash._baseindexof@3.1.0
├── lodash._baseuniq@3.0.3
├── lodash._bindcallback@3.0.1
├── lodash._cacheindexof@3.0.2
├── lodash._createcache@3.1.2
├── lodash._getnative@3.9.1
├── lodash.clonedeep@3.0.2
├── lodash.isarguments@3.0.4
├── lodash.isarray@3.0.4
├── lodash.keys@3.1.2
├── lodash.restparam@3.6.1
├── lodash.union@3.1.0
├── lodash.uniq@3.2.2
├── lodash.without@3.2.1
├── mkdirp@0.5.1
├── node-gyp@3.0.3
├── nopt@3.0.4
├── normalize-git-url@3.0.1
├── normalize-package-data@2.3.4
├── npm-cache-filename@1.0.2
├── npm-install-checks@2.0.1
├── npm-package-arg@4.0.2
├── npm-registry-client@7.0.7
├── npm-user-validate@0.1.2
├── npmlog@1.2.1
├── once@1.3.2
├── opener@1.4.1
├── osenv@0.1.3
├── path-is-inside@1.0.1
├── read@1.0.7
├── read-cmd-shim@1.0.1
├── read-installed@4.0.3
├── read-package-json@2.0.1
├── read-package-tree@5.1.2
├── readdir-scoped-modules@1.0.2
├── realize-package-specifier@3.0.1
├── request@2.65.0
├── retry@0.8.0
├── rimraf@2.4.3
├── semver@5.0.3
├── sha@2.0.1
├── slide@1.1.6
├── sorted-object@1.0.0
├── strip-ansi@3.0.0
├── tar@2.2.1
├── text-table@0.2.0
├── uid-number@0.0.6
├── umask@1.1.0
├── unique-filename@1.0.0
├── unpipe@1.0.0
├── validate-npm-package-license@3.0.1
├── validate-npm-package-name@2.2.2
├── which@1.2.0
├── wrappy@1.0.1
└── write-file-atomic@1.1.3
This is the permission error I get when I run without sudo:
Running "open:server" (open) task
Warning: Command failed: /bin/sh -c /media/sojharo/Data/blood-donations/node_modules/open/vendor/xdg-open "http://localhost:9000"
/bin/sh: 1: /media/sojharo/Data/blood-donations/node_modules/open/vendor/xdg-open: Permission denied
Use --force to continue.
Aborted due to warnings.
I notice you are using n to manage your node version.
Things might be, you have install some global package to version A, when you switch to version B, you have to install global package again for that version, because they don’t share global package folder among different versions.
On sudo npm list -g --depth=0
only npm is shown, means that you did not install others for this node version (in this case node version 5.2.0)
try
sudo npm install -g yo grunt-cli bower generator-angular-fullstack
Also I suggest you use node 4.2.4(don’t forget to check installed global packaged again, if you switch node version to 4.2.4, if needed do the above again for 4.2.4)
While running this command I also noticed warning which said,
wanted: {"node":"^4.2.3","npm":"^2.14.7"} (current: {"node":"5.2.0","npm":"3.3.12"})
I think I am now beginning to understand the problem. I would test with reinstalling the packages again. If failed, I would remove current nodejs and then would go for 4.2.4.
Thanks. I would let know here about results.
Still getting permission denied error. I think I should move towards nodejs 4.2.4. I would do this tomorrow and would let you know here. Thanks for your help 
I installed 4.2.4 but still no luck. 
The short term hack if 'open' doesn’t work is to just delete that task in your Grunt/Gulp config. All it does is open your browser to your project (localhost:9000). It’s not necessary.
What is your Ubuntu version? I dont have exact the same issue, but I encounter some errors in Ubuntu 15.04, while in Ubuntu 14.04.3 LTS everything works just fine and smooth.
How about run the following command in your terminal
to confirm if your xdg-open is installed in your ubuntu system mine shows
if not installed, you can try
sudo apt-get install xdg-utils --fix-missingPlease let me know if this solves your problem. Have a nice day!
![]()
Hey, it worked for me. I Was facing a similar issue with xdg-open command. It’s solved. Thank you! :’)
#1 2013-11-09 01:31:23
- morganmay
- Member
- Registered: 2011-09-04
- Posts: 9
[SOLVED] xdg-open: no method available for opening
I’m using Openbox. Whenever I try to use xdg-open to open a file or link from the command line, I get the error «xdg-open: no method available for opening». This happens with all files and links, regardless of type. I’ve tried editing ~/.local/share/applications/mimeapps.list, both manually and with xdg-mime; neither had any effect. I’ve also tried setting environment variables such as $BROWSER; that had no effect, either.
Strangely, exo-open works with no problem (although the only way I’ve found to change file associations is by using Thunar). I would just switch to exo-open, except I’ve encountered a couple of programs that rely on xdg-open for opening web links and the like.
Has anyone else seen this problem? At this point, I’m pretty confused, and I would appreciate any help. Thanks!
Last edited by morganmay (2013-11-19 16:31:08)
#2 2013-11-09 01:47:54
- cfr
- Member
- From: Cymru
- Registered: 2011-11-27
- Posts: 7,127
Re: [SOLVED] xdg-open: no method available for opening
Have you investigated the other tools that are packaged with xdg-open e.g. xdg-mime, xdg-settings? You can use the former to display and/or set and/or change associations. They have quite good manual pages and there are debug options you can set for xdg-mime, for example, if there’s a problem.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
#3 2013-11-09 01:51:09
- WonderWoofy
- Member
- From: Los Gatos, CA
- Registered: 2012-05-19
- Posts: 8,414
Re: [SOLVED] xdg-open: no method available for opening
I remember reading about a bug with xdg-open that causes this… but a five second google didn’t yield the result I was looking for.
#4 2013-11-10 16:41:49
- morganmay
- Member
- Registered: 2011-09-04
- Posts: 9
Re: [SOLVED] xdg-open: no method available for opening
I’ve tried setting associations using xdg-mime, but it has no effect. I mean, it works in the sense that the associations appear in mimeapps.list, but xdg-open still returns the «no method available for opening» error. xdg-mime returns no errors.
#5 2013-11-19 03:50:11
- morganmay
- Member
- Registered: 2011-09-04
- Posts: 9
Re: [SOLVED] xdg-open: no method available for opening
Was poking around with this again. I still haven’t solved the problem, but I did notice an error that might be a clue. When I enter «xdg-settings get default-url-scheme-handler», I get the error «xdg-settings: unknown desktop environment». I don’t have a DE installed, just openbox (although as far as I can tell, XDG doesn’t require a DE).
Does anyone know what this means? Searches for this error have only led me to threads recommending solutions that I’ve already tried without success (editing mimeapps.list, setting environment variables like BROWSER, etc.).
#6 2013-11-19 04:01:06
- cfr
- Member
- From: Cymru
- Registered: 2011-11-27
- Posts: 7,127
Re: [SOLVED] xdg-open: no method available for opening
What did you try? For example, did you try https://bugs.archlinux.org/task/29967?
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
#7 2013-11-19 04:23:52
- morganmay
- Member
- Registered: 2011-09-04
- Posts: 9
Re: [SOLVED] xdg-open: no method available for opening
Actually, I just had a brainstorm just now and figured it out. Poking around in the xdg-settings script revealed that it was checking the DE environment variable, and it returns that error when it doesn’t recognize it. So I checked around, and it turns out that for some reason DE was set to «openbox» in .xinitrc. I’m not sure how or why that happened, but it’s not something that xdg-open recognizes. Unsetting that variable fixed the problem.
Thanks for helping!
#8 2013-11-19 07:47:50
- ConnorBehan
- Package Maintainer (PM)
- From: Long Island NY
- Registered: 2007-07-05
- Posts: 1,359
- Website
Re: [SOLVED] xdg-open: no method available for opening
When DE is not recognized shouldn’t xdg-open treat it as it would if unset? Anyway, remember to edit the title to solved.
#9 2013-11-19 16:30:31
- morganmay
- Member
- Registered: 2011-09-04
- Posts: 9
Re: [SOLVED] xdg-open: no method available for opening
ConnorBehan wrote:
When DE is not recognized shouldn’t xdg-open treat it as it would if unset?
One would think so, but apparently not.
- Forum
- The Ubuntu Forum Community
- Ubuntu Official Flavours Support
- New to Ubuntu
- [SOLVED] xdg-open fails without a desktop environment
-
xdg-open fails without a desktop environment
xdg-open fails to open folder without a proper desktop environment like gnome/kde.
I have openbox with thunar installed as file manager. When I run the commandthen it shows the errorCode:
Warning: unknown mime-type for "/tmp" -- using "application/octet-stream" Error: no "view" mailcap rules found for type "application/octet-stream"
Searched the internet and found out that this is a bug.
See bug report here and here.Has this been solved yet?
-
Re: xdg-open fails without a desktop environment
According to that bug report, it’s been fixed upstream but the fix hasn’t been released in Ubuntu.
If you’re comfortable compiling from source, you could do that with the upstream releases. Otherwise, wait for the new release to be packaged in Debian, then synced into Ubuntu. As we’re past DebianImportFreeze, you’re probably going to have to wait until maverick+1 unless a developer specifically syncs the fix over.
EDIT: seems like the fix hasn’t been released upstream yet.
Last edited by Flimm; August 4th, 2010 at 03:27 PM.
-
Re: xdg-open fails without a desktop environment
@Flimm thanks for your answer.
Following your post, I found a simple yet effective solution. For people who would like a quick and simple hack, can do the following, until xdg-open is fixed in Lucid (if at all).
Install the package libfile-mimeinfo-perl.Code:
sudo apt-get install libfile-mimeinfo-perl
Then copy the xdg-open to local home bin.
Code:
cp /usr/bin/xdg-open ~/bin/
This would ensure your hack is not over-written by updates.
Finally open the ~/bin/xdg-open file and search for the open_generic() function and change the following linesCode:
if which run-mailcap >/dev/null &&
to
Code:
if mimeopen -v 2>/dev/null 1>&2 &&
and the line
Code:
run-mailcap --action=view "$file"
to
Code:
mimeopen -n "$file"
Done. This works in openbox+thunar.
To set thunar as default folder opener
The «-d» open sets the default application. For more options check
-
Re: xdg-open fails without a desktop environment
Since copying xdg-open to your home directory makes this a per-user solution, why not just create an alias to gnome-open or kde-open, if you’re using gnome or kde? I guess it depends on what you need xdg-open for.
In my case I just edited .bashrc and added this line near the end:
Code:
alias xdg-open='kde-open'
-
Re: xdg-open fails without a desktop environment
@Zalbor
gnome and kde are desktop environments. As my subject line says «xdg-open fails without a desktop environment» so evidently I don’t have a desktop environment like gnome/kde/xfce. In fact I am using openbox.
I found that xdg-open works with gnome without any hacks.
Bookmarks
Bookmarks

Posting Permissions
Forum rules
There are no such things as «stupid» questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help. Topics in this forum are automatically closed 6 months after creation.
-
ovrflo
- Level 2
- Posts: 91
- Joined: Sat Feb 25, 2017 3:12 pm
xdg-open not working
I am trying to use zoom from google chrome (hate GC, but it is the only browser that 100% works with zoom). The dialog box open xdg-open pops up, but even though I OK the action, nothing happens. I copied the link that is embedded in the page and ran xdg-open in a terminal to see what happened, and I reinstalled both google chrolme and zoom using the deb packages from the vendor’s web site.I copied the link that is embedded in the page and ran xdg-open in a terminal. How can I troubleshoot this? I’m surprised that after 2 days of searching I haven’t been able to find hardly anything recent.
Any suggestions are much appreciated — supporting info below:
Terminal output from xdg-open:
Code: Select all
xdg-open 'zoommtg://zoom.us/join?action=join&confno=98726540865&pwd=SDNaeXhJWXBxWVlpdnJKeFpGaUFoUT09&zc=64&mcv=0.92.11227.0929&confid=dXNzPVdjZ3lNbHlhZUduU3FGS3lseE1wUWFvT2F5bWZ6d0ZqMEFjaWx4UTd3YUIwWXZPYUI0LWdlZGRvLWxJVGJRaWE1bGphWXJ4RG1objlTUjlkLjBtZTUxZ1FIUzlpQVU3TEwmdGlkPWRjYjBlZmI0YzZkZjRmN2RhNWRkNWMwYTZjMGM2YTgx&browser=chrome&t=1596151174547'
gvfs-open: zoommtg://zoom.us/join?action=join&confno=98726540865&pwd=SDNaeXhJWXBxWVlpdnJKeFpGaUFoUT09&zc=64&mcv=0.92.11227.0929&confid=dXNzPVdjZ3lNbHlhZUduU3FGS3lseE1wUWFvT2F5bWZ6d0ZqMEFjaWx4UTd3YUIwWXZPYUI0LWdlZGRvLWxJVGJRaWE1bGphWXJ4RG1objlTUjlkLjBtZTUxZ1FIUzlpQVU3TEwmdGlkPWRjYjBlZmI0YzZkZjRmN2RhNWRkNWMwYTZjMGM2YTgx&browser=chrome&t=1596151174547: error opening location: The specified location is not supported
Here is an inxi
Code: Select all
System: Host: Aspire-E5-476 Kernel: 4.15.0-112-generic x86_64 (64 bit gcc: 5.4.0)
Desktop: Cinnamon 3.6.7 (Gtk 3.18.9-1ubuntu3.3) dm: lightdm Distro: Linux Mint 18.3 Sylvia
Machine: System: Acer product: Aspire E5-476 v: V1.03
Mobo: KBL model: AntMan_SK v: V1.03 Bios: Insyde v: V1.03 date: 07/06/2017
CPU: Quad core Intel Core i5-8250U (-HT-MCP-) cache: 6144 KB
flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 14400
clock speeds: min/max: 400/3400 MHz 1: 1074 MHz 2: 1577 MHz 3: 1487 MHz 4: 1434 MHz 5: 1110 MHz
6: 1500 MHz 7: 1177 MHz 8: 1211 MHz
Graphics: Card: Intel UHD Graphics 620 bus-ID: 00:02.0 chip-ID: 8086:5917
Display Server: X.org 1.18.4 drivers: intel (unloaded: fbdev,vesa)
tty size: 167x45 Advanced Data: N/A for root
Audio: Card Intel Sunrise Point-LP HD Audio driver: snd_hda_intel bus-ID: 00:1f.3 chip-ID: 8086:9d71
Sound: Advanced Linux Sound Architecture v: k4.15.0-112-generic
Network: Card-1: Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter
driver: ath10k_pci bus-ID: 02:00.0 chip-ID: 168c:0042
IF: wlp2s0 state: up mac: <filter>
Card-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
driver: r8169 v: 2.3LK-NAPI port: 3000 bus-ID: 03:00.0 chip-ID: 10ec:8168
IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives: HDD Total Size: 1000.2GB (41.2% used)
ID-1: /dev/sda model: TOSHIBA_MQ01ABD1 size: 1000.2GB serial: 17UYC8UXT temp: 35C
Partition: ID-1: / size: 59G used: 25G (45%) fs: ext4 dev: /dev/sda6
ID-2: /home size: 493G used: 246G (53%) fs: ext4 dev: /dev/sda7
ID-3: swap-1 size: 8.59GB used: 0.46GB (5%) fs: swap dev: /dev/sda5
RAID: System: supported: linear multipath raid0 raid1 raid6 raid5 raid4 raid10
No RAID devices: /proc/mdstat, md_mod kernel module present
Unused Devices: none
Sensors: System Temperatures: cpu: 35.0C mobo: N/A
Fan Speeds (in rpm): cpu: N/A
Info: Processes: 295 Uptime: 2 days Memory: 2219.3/7853.2MB
Init: systemd v: 229 runlevel: 5 default: 2 Gcc sys: 5.4.0
Client: Shell (sudo running in bash) inxi: 2.2.35
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
-
hydrurga
- Level 5
- Posts: 743
- Joined: Sun Nov 15, 2015 4:08 pm
Re: xdg-open not working
Post
by hydrurga » Fri Jul 31, 2020 6:26 am
I think that you’re going to have to first make Chrome the scheme handler for zoommtg:, either through Chrome itself (if it provides that functionality) or by editing Chrome’s desktop entry. Then you’re going to have to set Chrome as your preferred browser.
I’ve found it easy just to surf to join.zoom.us and enter the meeting id, as described here: https://support.zoom.us/hc/en-us/articl … eb-browser
I did try installing the Zoom client for Linux but it installed ibus as a dependency which I didn’t want or need, thereby mucking up the language selection in my system tray. It was very quickly uninstalled with some curse words supplied as a going-away present.




