Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to be able to install stuff straight from, but the software center takes a long time to load up and install stuff. Is there a way to set "apt" URIs to open up in the terminal as "sudo apt-get install X

EDIT: I am using chrome. Is there some kind of extension that can do this?

share|improve this question
up vote 6 down vote accepted

Assuming you are using Firefox, you can create a simple shell script to do this. There may be a similar mechanism for other browsers, but I am not familiar with those.

  1. Open GEdit (or any other editor) and enter the following:

    #! /bin/bash
    gnome-terminal -e "sudo apt-get install $aptInstall"
  2. Save this script. I will refer to it as ~/

  3. Open the terminal and run chmod a+x ~/ This will make the script executable.
  4. Now open Firefox's Preferences and go to the "Applications" section. Find the "apt" content type.
  5. Select "Use other" under the "Action" heading for the "apt" content type and browse to the location of the script you just created.

Now apt:// URLs should open up in the terminal by prompting you for your password.

share|improve this answer
How do I set it in chrome? Will I need an extension? – phillips1012 Dec 9 '12 at 23:14
I'm not exactly sure how to do it for Chrome, but I did find this question that explains how to make Chrome use AptURL to install software from apt:// links. You may find that using AptURL satisfies your requirements, as it starts much faster than the software center. You may be able to modify the method provided in the link above to work with this script, but I don't have Chrome installed so I can't try it out at the moment. – Andrew Johnson Dec 9 '12 at 23:30
The bits in gconf are no longer necessary. And you should place the apt-terminal.desktop file in ~/.local/share/applications/ and then run update-mime-database ~/.local/share/applications so that the MIME handler info is cached. Installing apturl might be a better option though. – dobey Dec 9 '12 at 23:31
Hmm... that might be a better solution for me (edit: yay it worked) – phillips1012 Dec 9 '12 at 23:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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