Can I use other tool than Ubuntu Software Center to open apt links?
- 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:
- And the window will pop open:
- Installation will take place using a lightweight gDebi-style frontend
- Install it with
The other option is to use a custom script such as green7's answer
-
But to be browser-independent, what you really need is:
- A
.desktop
file for your script/application, indicating that it handles thex-scheme-handler/apt
protocol (seeMimeType=
lines in aptURL.desktop, ubuntu-software-center.desktop) - And you can set the default by modifying the
defaults.list
file in/usr/share/applications/
- A
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
.
Now whenever you click on any apt
link, it will show a terminal window asking for your password.
After you correctly enter your password, it will install the package.
Note that you can use xterm
in place of lxterm
.