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.

Is it possible to execute a command from a single link?

For example when a user clicks on a link it does this:

sudo apt-get install vlc wine openshot but by clicking on a link

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Your particular example is possible via the apt-uris:

http://apt.ubuntu.com/p/wine

This will open wine in the software centre, giving the user the option to install it.

Running arbitrary commands on any Ubuntu machine is (hopefully) never possible:

share|improve this answer
    
I think I'm right in saying that apt.ubuntu.com is the preferred way of linking packages. The AptUrl wiki page is rather old :-) –  Stefano Palazzo Jun 9 '11 at 15:24
    
What about the answer I posted above. Does it work for multiple programs or not since i took it from the Wiki about AptUrl. –  Luis Alvarado Jun 9 '11 at 15:25
    
Just read your answer. what about an example of installing multiple programs. –  Luis Alvarado Jun 9 '11 at 15:26
    
Installing multiple programs with one click doesn't work with this syntax I don't think –  Stefano Palazzo Jun 9 '11 at 15:32

Lol found it thanks to Oli's post here Is it possible to install a repository via a web (Clicking in a webpage link)

It is possible to install multiple packages. In this wiki https://wiki.ubuntu.com/AptUrl all the possible actions can be found. To install one would be like this:

<a href="apt:package">click</a> 

For example:

<a href="apt:vlc">click</a> 

This would install vlc.

But lets say you want to install VLC, Ubuntu Extras and subdownloader:

<a href="apt:vlc,ubuntu-restricted-extras,subdownloader">click</a> 

Each separated by a comma. Awesome.

share|improve this answer

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.