个人工具

“UbuntuHelp:AptURL”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(创建新页面为 '{{From|https://help.ubuntu.com/community/AptURL}} {{Languages|UbuntuHelp:AptURL}} == Introduction == The '''APT protocol''', or '''apturl''', is a very simple way to install a s...')
 
 
(未显示同一用户的2个中间版本)
第3行: 第3行:
 
== Introduction ==
 
== Introduction ==
 
The '''APT protocol''', or '''apturl''', is a very simple way to install a software package from a web browser.
 
The '''APT protocol''', or '''apturl''', is a very simple way to install a software package from a web browser.
On computers where apturl is enabled, the clic in a web page on a special link starts the installation of one or several packages available in the package repositories of this computer.
+
On computers where apturl is enabled, clicking on a special type of link on a web page starts the installation of one or several packages available in the package repositories of this computer.
 
For example, from a web page, when a Ubuntu user clicks on the link apt:packageexample , the apturl protocol will launch the package manager to propose the installation of the package called "packageexample" from the repositories available on the computer.
 
For example, from a web page, when a Ubuntu user clicks on the link apt:packageexample , the apturl protocol will launch the package manager to propose the installation of the package called "packageexample" from the repositories available on the computer.
 
Please note that ''apturl'' is not aimed at replacing the current system of repositories and package manager. It is a complementary method.
 
Please note that ''apturl'' is not aimed at replacing the current system of repositories and package manager. It is a complementary method.
第16行: 第16行:
 
* if you use a version of Firefox3, see below to enable the apturl in your browser.
 
* if you use a version of Firefox3, see below to enable the apturl in your browser.
 
==== Firefox 3 ====
 
==== Firefox 3 ====
Enter ''about:config'' in the url bar and add :
+
Enter ''about:config'' in the URL bar and add :
 
* '''network.protocol-handler.app.apt''' in character chain with '''/usr/bin/apturl''' as value,
 
* '''network.protocol-handler.app.apt''' in character chain with '''/usr/bin/apturl''' as value,
 
* '''network.protocol-handler.app.apt+http''' in character chain with '''/usr/bin/apturl''' as value,
 
* '''network.protocol-handler.app.apt+http''' in character chain with '''/usr/bin/apturl''' as value,
第22行: 第22行:
 
* '''network.protocol-handler.warn-external.apt+http''' in boolean value and put '''true''' as value.
 
* '''network.protocol-handler.warn-external.apt+http''' in boolean value and put '''true''' as value.
 
Close and restart Firefox.
 
Close and restart Firefox.
Clic on this link [[UbuntuHelp:apt://mplayer|apt://mplayer]] , and in the "Application launch" windows, clic on the "Choose" button and :
+
Click on this link [[UbuntuHelp:apt://mplayer|apt://mplayer]] , and in the "Application launch" windows, click on the "Choose" button and :
Clic on ''File system'', and the /usr/bin directory then on the ''apturl'' file.  
+
Click on ''File system'', and the /usr/bin directory then on the ''apturl'' file.  
 
Don't forget to enable "Remember my choice" and validate.
 
Don't forget to enable "Remember my choice" and validate.
 
=== Konqueror ===
 
=== Konqueror ===
第52行: 第52行:
 
Save this file under the name '''apt+http.protocol''' in the ''/usr/share/services'' folder.
 
Save this file under the name '''apt+http.protocol''' in the ''/usr/share/services'' folder.
 
=== Opera ===
 
=== Opera ===
If you use [[UbuntuHelp:OperaBrowser|Opera]], you just need to go in the menu ''Tools'' then ''Preferences''. Clic on the tab ''Advanced'' then ''Programs'', and choose ''Add''. In ''Protocol'', enter '''apt''' and in ''Open with another application'', enter '''apturl'''. Clic on the button OK and restart Opera.
+
If you use [[UbuntuHelp:OperaBrowser|Opera]], you just need to go in the menu ''Tools'' then ''Preferences''. Click on the tab ''Advanced'' then ''Programs'', and choose ''Add''. In ''Protocol'', enter '''apt''' and in ''Open with another application'', enter '''apturl'''. Click on the button OK and restart Opera.
 
=== Swiftfox ===
 
=== Swiftfox ===
To enjoy the APT protocol with [[UbuntuHelp:Swiftfox|Swiftfox]], enter '''about:config''' in the url bar and add :  
+
To enjoy the APT protocol with [[UbuntuHelp:Swiftfox|Swiftfox]], enter '''about:config''' in the URL bar and add :  
 
* '''network.protocol-handler.app.apt''' in character chain with '''/usr/bin/apturl''' as value,
 
* '''network.protocol-handler.app.apt''' in character chain with '''/usr/bin/apturl''' as value,
 
* '''network.protocol-handler.app.apt+http''' in character chain with '''/usr/bin/apturl''' as value,
 
* '''network.protocol-handler.app.apt+http''' in character chain with '''/usr/bin/apturl''' as value,
* '''network.protocol-handler.warn-external.apt''' in boolean value and put '''false''' as value,
+
* '''network.protocol-handler.warn-external.apt''' in Boolean value and put '''false''' as value,
* '''network.protocol-handler.warn-external.apt+http''' in boolean value and put '''false''' as value.
+
* '''network.protocol-handler.warn-external.apt+http''' in Boolean value and put '''false''' as value.
 
Close and restart Swiftfox.
 
Close and restart Swiftfox.
 
== Use of apturl ==
 
== Use of apturl ==
第64行: 第64行:
 
" To install this software in Ubuntu, [[UbuntuHelp:InstallingSoftware#installing-a-package|install the following package]]: '''''[[UbuntuHelp:apt:supertux|supertux]]'''''. "
 
" To install this software in Ubuntu, [[UbuntuHelp:InstallingSoftware#installing-a-package|install the following package]]: '''''[[UbuntuHelp:apt:supertux|supertux]]'''''. "
 
Click on the name of the package ("supertux" in the example): if the apturl protocol is enabled on your computer, you will be proposed to install the package called "supertux".
 
Click on the name of the package ("supertux" in the example): if the apturl protocol is enabled on your computer, you will be proposed to install the package called "supertux".
 +
Multiple packages can be linked to in documentation, they need only be separated by a comma. The following code is an example, first the source then the result.
 +
<pre><nowiki>
 +
[[InstallingSoftware#installing-a-package|install the following packages]]: '''''[[apt:rsync,xinetd|rsync xinetd]]'''''.
 +
</nowiki></pre>
 +
This would produce - [[UbuntuHelp:InstallingSoftware#installing-a-package|install the following packages]]: '''''[[UbuntuHelp:apt:rsync,xinetd|rsync xinetd]]'''''.
 
== Create an apturl link ==
 
== Create an apturl link ==
 
* See https://wiki.ubuntu.com/AptUrl
 
* See https://wiki.ubuntu.com/AptUrl

2010年5月19日 (三) 21:35的最新版本

Introduction

The APT protocol, or apturl, is a very simple way to install a software package from a web browser. On computers where apturl is enabled, clicking on a special type of link on a web page starts the installation of one or several packages available in the package repositories of this computer. For example, from a web page, when a Ubuntu user clicks on the link apt:packageexample , the apturl protocol will launch the package manager to propose the installation of the package called "packageexample" from the repositories available on the computer. Please note that apturl is not aimed at replacing the current system of repositories and package manager. It is a complementary method.

Installation

To use this package installation method:

Firefox and Epiphany

  • apturl works by default with Firefox and Epiphany if they are normally installed from the repositories
  • if you use a version of Firefox2 or Epiphany that you didn't install from the repositories, you need to enable the apturl in your browser with the same procedure as Swiftfox (see below).
  • if you use a version of Firefox3, see below to enable the apturl in your browser.

Firefox 3

Enter about:config in the URL bar and add :

  • network.protocol-handler.app.apt in character chain with /usr/bin/apturl as value,
  • network.protocol-handler.app.apt+http in character chain with /usr/bin/apturl as value,
  • network.protocol-handler.warn-external.apt in boolean value and put true as value,
  • network.protocol-handler.warn-external.apt+http in boolean value and put true as value.

Close and restart Firefox. Click on this link apt://mplayer , and in the "Application launch" windows, click on the "Choose" button and : Click on File system, and the /usr/bin directory then on the apturl file. Don't forget to enable "Remember my choice" and validate.

Konqueror

  • Execute the Kate text editor in administrator mode: kdesudo kate
  • Create a new text file containing these data :
[Protocol]
exec=apturl "%u"
protocol=apt
input=none
output=none
helper=true
reading=true
writing=true

Save this file under the name apt.protocol in the /usr/share/services folder.

  • Create a second text file containing these data :
[Protocol]
exec=apturl "%u"
protocol=apt+http
input=none
output=none
helper=true
reading=true
writing=true

Save this file under the name apt+http.protocol in the /usr/share/services folder.

Opera

If you use Opera, you just need to go in the menu Tools then Preferences. Click on the tab Advanced then Programs, and choose Add. In Protocol, enter apt and in Open with another application, enter apturl. Click on the button OK and restart Opera.

Swiftfox

To enjoy the APT protocol with Swiftfox, enter about:config in the URL bar and add :

  • network.protocol-handler.app.apt in character chain with /usr/bin/apturl as value,
  • network.protocol-handler.app.apt+http in character chain with /usr/bin/apturl as value,
  • network.protocol-handler.warn-external.apt in Boolean value and put false as value,
  • network.protocol-handler.warn-external.apt+http in Boolean value and put false as value.

Close and restart Swiftfox.

Use of apturl

In the Ubuntu Documentation, you will sometimes find sentences like for example: " To install this software in Ubuntu, install the following package: supertux. " Click on the name of the package ("supertux" in the example): if the apturl protocol is enabled on your computer, you will be proposed to install the package called "supertux". Multiple packages can be linked to in documentation, they need only be separated by a comma. The following code is an example, first the source then the result.

[[InstallingSoftware#installing-a-package|install the following packages]]: '''''[[apt:rsync,xinetd|rsync xinetd]]'''''. 

This would produce - install the following packages: rsync xinetd.

Create an apturl link

See also