Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Without Ubuntu Software Center in Lubuntu I was unable to edit opening apt links in any program in Firefox (see this question) After installing Ubuntu Software Center, that problem is solved, but could I use other program instead of Ubuntu Software Center for the same purpose? I find it too heavy, and to install I prefer the Terminal, gdebi, Lubuntu Software Center or the Synaptic.

(Now that I have the apt option in Firefox/Preferences/Applications, I try to change Ubuntu Software Center to Lubuntu Software Center but this does not change the option.)

share|improve this question
    
What happens when you click the link? it should take you to the online software center and when you click on the button (orange) you should be a dialog box trying to install –  Anwar Shah Sep 3 '12 at 9:42
    
as i already have Ubuntu Software Center installed the link opens that program as a means of installing. i was looking for other programs than Ubuntu Software Center. why not the terminal opening instead of Ubuntu Software Center? –  cipricus Sep 3 '12 at 9:43
add comment

2 Answers

up vote 7 down vote accepted
  • Neither gDebi, Synaptic or Lubuntu Software Center support handling the "apt://" protocol/links.
  • But a very simple graphical apt-get-type installer called AptURL does.

    • Install it with sudo apt-get install apturl
    • Set Firefox Preferences to "Always Ask" for apt
    • Click on a link, and select AptURL:

    enter image description here

    • And the window will pop open:

    enter image description here

    • Installation will take place using a lightweight gDebi-style frontend
  • The other option is to use a custom script such as green7's answer

  • But to be browser-independent, what you really need is:

    1. A .desktop file for your script/application, indicating that it handles the x-scheme-handler/apt protocol (see MimeType= lines in aptURL.desktop, ubuntu-software-center.desktop)
    2. And you can set the default by modifying the defaults.list file in /usr/share/applications/
share|improve this answer
add comment

You can change the Action in Preferences > Applications from Ubuntu Software Center to this simple shell script.

#! /bin/bash

toInstall="$@"
toInstall=${toInstall#*:}
lxterm -e "sudo apt-get install $toInstall; read"

Save this to some file, say aptFirefox.sh, and make it executable by running:

chmod +x /path/to/aptFirefox.sh

Now you can replace Ubuntu Software Center with aptFirefox.sh.

enter image description here

Now whenever you click on any apt link, it will show a terminal window asking for your password.

enter image description here

After you correctly enter your password, it will install the package.

enter image description here

Note that you can use xterm in place of lxterm.

share|improve this answer
    
as i use Firefox, your answer is perfect to me but i have set as definitive izx's answer as it has a more general application. merging the 2 answers into one would be great. –  cipricus Sep 3 '12 at 14:17
add comment

Your Answer

 
discard

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.