The apturl is a graphical mini-program for installing packages from the repository that a user has. It is pre-installed on Ubuntu since version 7.10, and the Firefox and Pidgin programs come with support for it.
Making an APT link
The basic syntax for an apt link is the following:
Where package is the package you'd like the user to install.
To bundle several packages into one link, the syntax is the following:
Where package1, package2 and package3 are the packages you'd like the user to install.
Installs Pidgin and Pidgin Plugin Pack (if the user confirms).
Enables the "universe" component and installs package Freevial.
Using AptUrl right after adding a repository
After adding a repository line via the Software Sources tool, the user has an option to reload the package list now or close the window, without reloading.
This can be an issue if the user wants to install a package via AptUrl right after - because the newly added repositories haven't been scanned, and thus the program will not be found. To avoid such a situation, a "refresh" flag is available - if it's present, apturl will do a refresh first and then look for the program.
Sample syntax: <a href="apt:package1?refresh=yep">click</a>
Sample link: Get Geany!
For websites that malform apt: links
Some websites / wiki's tend to break apt links. A workaround for this is to make use of appnr.com for the linking - simply use http://appnr.com/install/package as the link URL, though appnr does not let you add repositories.
Another workaround is to use a service like TinyURL. This link enables the Universe repository and then installs Wine, for instance: http://tinyurl.com/installwine
Using apturl on the Ubuntu Forums
apturl can be used on the Ubuntu Forums by using BBcode.
or apt://firefox in a insert link box also works great.
Appnr.com is a website that works entirely on apturl links.
Apturl links can also be very handy if your program is available in Ubuntu repositories. Providing one on your project website is a user-friendly way to have the user install your program and additionally takes the load off your servers.