个人工具

“UbuntuHelp:InstallingSoftware/zh”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
源码还是二进制?
词汇表
 
(未显示7个用户的32个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/InstallingSoftware}}
 
{{From|https://help.ubuntu.com/community/InstallingSoftware}}
{{Languages|UbuntuHelp:InstallingSoftware}}
 
  
 +
{{Translator|onlysai}}
  
== 引言 ==
+
{{Verifier|purewind dbzhang800}}
  
Ubuntu下安装软件是很容易的,本向导将向您演示如何操作。
+
{{Languages|UbuntuHelp:InstallingSoftware}}
  
默认情况下,当您把Ubuntu安装到您的计算机时很多有用的程序就已经安装完毕了。  然而,您可能需要某一项默认应用程序中不提供的软件服务。也许您只是想尝试一下某一已安装软件的另类功能。换句话说,您需要新软件。
+
== 前言 ==
  
如果您想获取安装软件时的一些后台信息(有时可能有很高技术性),请参阅 '''软件包和软件包的管理'''。如果您只是想安装新程序,您可以直接跳转到 '''安装软件包'''。
+
在默认情况下,很多有用的程序在你添上Ubuntu系统到你电脑的时候已经安装好了。当然,有时候你可能需要完成一项工作而默认的应用程序无法满足,在这时你就需要一些新的软件。或者您可能想尝试用一个新软件来替换已经安装好的程序。在Ubuntu系统中安装软件是简单的,本向导将向你展示如何做。
  
== 软件包和软件包的管理 ==
+
<br> 如果您想了解更多的安装软件时发生的背景信息(可能包含适量的技术性知识),请阅读“''软件包和软件包管理''”。如果您仅仅想立刻了解安装新程序,可以直接跳到“''安装软件包''”。
This section covers the basic concepts of packages and package management. You will learn about what a package is, the differences between different types of package and also how package management works on Ubuntu.
+
  
----
+
== 软件包和软件包管理器 ==
本节概述包的基本概念,以及包管理.通过阅读本节你将会了解包是什么,不同类型包之间的区别,同样你也会了解如何在Ubuntu中进行软件包管理工作.
+
  
=== 什么是软件包? ===
+
这部分包含软件包和软件包管理器的基本概念。您将会学习到什么是软件包,不同类型的软件包之间的区别和在Ubuntu系统上软件包管理器如何运作。
  
''Software'' is a very broad term, and is generally taken to mean a program which you can run on your computer.  However, such programs often need other resources to work. When you install software, thousands of files may be required just to let the program start!  When you think that they all have to be put in exactly the right location, and some of those files may need to be changed depending on what type of computer you have, it can all get very complicated. Luckily, Ubuntu can look after this complexity.
+
=== 什么是软件包? ===
----
+
"软件"是一个非常宽泛的概念,通常认为软件是指可以运行在计算机上的长须。然而,有些程序必须依赖其它的资源才能正常工作。当你安装一个软件时,很可能你需要安装成千上万的文件才能使程序运行起来!当你想到这些成千上万的文件中,有些文件必须放置在正确的路径,而有些文件的位置又因为计算机平台的不同而不同时,这将是个很麻烦的事情,Ubuntu可以很好地解决这种麻烦.
+
----
+
Ubuntu uses ''packages'' to store everything that a particular program needs to run. A 'package', then, is essentially a collection of files bundled into a single file, which can be handled much more easily.  As well as the files required for the program to run, there will be special files called ''installation scripts'', which copy the files to where they are needed (amongst other things).
+
----
+
Ubuntu使用软件包存储指定程序运行所需的一切文件.一个“包裹”实际上是所需的文件集捆绑在一个单独文件里,这样使得操作更加方便。就如文件需要程序来运行一样,这个包也需要一个特定的文件,名为"installation scripts(安装脚本)"来指定各个文件该拷贝到什么地方(当然脚本做的可能还不止这些)。
+
  
=== 源码还是二进制? ===
+
“软件”是一个非常广泛的界限,一般意义上是指一个可以在你电脑上运行的程序。当然,这样的程序常常需要其它的资源来完成它的工作任务。当您安装软件时,可能会需要数以千计的文件而仅仅是用来程序的启动。当你以为应该要把它们安置在一个精确的位置时,一部分文件却可能由于你电脑的类型而需要更改时,所有的这些将变得非常复杂难解。但是您无需担心——Ubuntu有个方法搞定这些。
  
Normally, when someone makes a package for a program, they put all of the ''source code'' for the program into that package.  Source code is written by programmers and is essentially a list of instructions to a computer which humans are able to read and write.  Computers can only understand this code if it is ''interpreted'' for them into a form that they can use directly.  One such way of interpreting source code for a computer is by translating or ''compiling'' it into ''binary'', which computers can understand.
+
<br> Ubuntu使用“''软件包''”来存储运行需要的每一个单独的程序。包是收集相应文件并捆绑进一个单一的文件,这能使操作变得容易很多。以及当一个程序运行需要相应文件时,这里有一个特殊的文件称作“''安装脚本''”会在其它文件中复制相关文件到所需之处。
----
+
通常,人们将程序打包时,他们把所有程序需要的的源代码放到软件包里。源代码实际上是程序员写的可阅读的计算机指令列表。想要计算机能读懂它,就必须翻译为计算机能够阅读的形式。而翻译源代码为计算机能够阅读的形式的一种方式就是"编译"为"二进制"形式,编译以后计算机就可以理解它了。
+
----
+
So why don't the people who make the package (called ''packagers'') just convert it into binary from the start?  Well, different computers use different types of binary, so if you make a binary package for one type (like an Intel PC), it won't work on another (like an Apple Macintosh).
+
----
+
那打包的人(打包工?)为什么不在一开始就直接转换为二进制形式呢?通常不同的计算机使用不同形式的二进制编码,这样如果你将编译了一种二进制包(比如适合intel PC的),他在其他的计算机里就没法工作了。(例如Apple macintosh)
+
----
+
'''Source packages''' are simply packages which just include source code, and can generally be used on any type of machine if the code is compiled in the right way.
+
----
+
'''源码包'''是一个仅仅包含源代码的软件包,一般只要经过正确的编译就可以在任何机器上使用。
+
----
+
<br>
+
'''Binary packages''' are ones which have been made specifically for one type of computer, or ''architecture''. Ubuntu supports the x86 (i386 or i686), AMD64 and PPC architectures. The correct binary packages will be used automatically, so you don't have to worry about picking the right ones. To find out which one you are using, open ''Applications'' → ''Accessories'' → ''Terminal'', type <code><nowiki>arch</nowiki></code> then hit the enter key.
+
  
=== 软件包的依赖===
+
=== 源文件还是二进制文件? ===
  
Programs often use some of the same files as each other.  Rather than putting these files into each package, a separate package can be installed to provide them for all of the programs that need them.  So, to install a program which needs one of these files, the package containing those files must also be installed.  When a package depends on another in this way, it is known as a ''package dependency''. By specifying dependencies, packages can be made smaller and simpler, and duplicates of files and programs are mostly removed.
+
通常,当某人要为一个程序制作包时,他们把这个程序相关的所有的“源文件”放进一个包中。源代码是由程序员编写的,本质上是一连串的人们能够阅读和编写的计算机指令。计算机仅仅能够明白这已经以一种特定形式为它们解释的,人们能够直接使用的代码。一种方法为计算机解释源代码是使用“编译”它使其成为计算机能够理解 的“二进制”文件。
  
When you install a program, its dependencies must be installed at the same time.  Usually, most of the required dependencies will already be installed, but a few extras may be needed, too.  So, when you install a package, don't be surprised if several other packages are installed too - these are just dependencies which are needed for your chosen package to function properly.
+
既然如此,为什么包制作者(称作''打包员'')不直接将它转换成二进制文件呢?注意,不同的计算机使用不同类型的二进制文件,因此如果你为某种类型计算机(如Intel PC)制作二进制文件,它在另外类型的计算机(如Apple Macintosh)上将不能正常工作。 '''源码包'''是仅仅包含源代码文件的包,而且只要代码以正确方式编译就能够在不同类型的机器上广泛地使用。
  
https://help.ubuntu.com/community/InstallingSoftware?action=AttachFile&do=get&target=scrn-synaptic-dependencies.jpg
+
'''二进制包'''是为某种类型的计算机生成的特定的包。Ubuntu支持x86(i386 或 i686),AMD64和PPC架构。正确的二进制文件包可以自动地使用,因此您无需为选择合适的包而担忧。想知道您正在使用何种包,打开''应用程序'' --&gt; ''附件'' --&gt; ''终端'',键入<code><nowiki>arch</nowiki></code> 然後回车(ubuntu7.10此命令不能使用)。
<br>
+
''An example of dependencies''
+
  
 +
=== 软件包依赖 ===
  
=== 软件包管理器 ===
+
应用程序常常和另外的程序使用同样的文件。与其把这些文件放到每一个包中,不如把它们放进一个分开并能够安装的包来为所有的程序提供所需。因此,安装需要一个类似这样文件的应用程序,包含这些文件的包就必须也被安装。当一个包以这种方式依赖到另一个包时,它就是所谓的软件''包依赖''。通过指定依赖包,软件包可以做的更小和更简单,重复的文件和程序大部分被移除了。
  
A package manager is an application which handles the downloading and installation of packages. Ubuntu includes a few package managers by default, and which one you use depends on how advanced the package management tasks are that you want to achieve. Most people will only need to use the most basic package manager, the ''Add/Remove tool'', which is very easy to use.
+
当您选择安装一个程序,它的依赖包必须也同时被安装。常常的,很多要求的依赖已经安装,但还有额外的一小部分没有安装。所以您你安装一个包时,不要惊讶另外某些包也被安装--这些仅仅是您所选择包要正常运行的依赖包。
  
 +
=== 软件包管理器 ===
  
=== 软件 频道/源 ===
+
软件包管理器是一个处理包下载和包安装的应用程序。在默认的情况下,Ubuntu包含一些软件包管理器,您要使用哪个取决于您所要实现的软件包管理任务的高深程度。大多数人只需使用最基本的软件包管理器,非常易用的--“''添加/删除工具''”。
  
Where can you get packages from?
+
=== 软件频道/源 ===
  
Ubuntu stores all of its packages in locations called ''software channels'' or ''repositories''. A software channel is simply a location which holds packages of similar types, which can be downloaded and installed using a package manager. A package manager will store an index of all of the packages available from a software channel. Sometimes it will 're-build' this index to make sure that it is up to date and knows which packages have been upgraded or added into the channel since it last checked.
+
您可以从哪里获取到包呢?Ubuntu存储所有属于它的包到名叫''软件频道''''''的位置。软件频道是一个拥有相似类型的包的绝对位置,您可以使用包管理器从其下载和安装包。包管理器将会存储从这个软件频道所有可用包的一个索引。有时候它将会''重建''这个索引来确保它是最新的,同时可以了解从最近一次检查以来哪些包已经被升级或者加进了频道。
  
There are four Ubuntu software channels for each architecture - Main, Restricted, Universe and Multiverse. Each has a different purpose. By default, only packages from Main and Restricted can be installed. If you would like to install packages from Universe or Multiverse, see the [[UbuntuHelp:Repositories]] page for instructions on how to do this.
+
每种架构有四个Ubuntu软件频道-- Main, Restricted, Universe 和 Multiverse。每一个有不同的用途。默认情况下,只有来自Main 和 Restricted的软件包可以安装。如果您想能够安装来自Universe 或 Multiverse的软件包,查看[[UbuntuHelp:Repositories]] 说明页。
  
In addition to the official Ubuntu repositories, it is possible to use ''third party repositories''. Be careful, though - some are not compatible with Ubuntu and using them may cause programs to stop working or may even cause serious damage to your installation. The page http://www.ubuntulinux.nl/source-o-matic can help you to find extra repositories, and the [[UbuntuHelp:Repositories]] page gives instructions on how to enable them.
+
此外,Ubuntu官方库里可能使用''第三方软件源''。要小心啦 -- 使用一些不兼容 Ubuntu 的包可能会令您的程序停止工作或者更甚会严重损坏您的安装。页面 http://www.ubuntulinux.nl/source-o-matic 能够帮助你查找额外的软件源,而[[UbuntuHelp:Repositories]]页面会给出启用它们的说明。
  
==安装软件包 ==
+
== 安装软件包 ==
 
+
这部分将向您解释如何使用Ubuntu和Kubuntu下可用的各种工具安装软件包。
+
  
 +
这部分解释如何在Ubuntu和Kubuntu上使用多种可用工具安装软件包。
  
 
=== Ubuntu ===
 
=== Ubuntu ===
  
 
* '''Ubuntu 6.06 LTS (Dapper Drake)'''
 
* '''Ubuntu 6.06 LTS (Dapper Drake)'''
* '''Ubuntu 6.10 (Edgy Eft)'''
 
* '''Ubuntu 7.04 (Feisty Fawn)'''
 
  
 +
==== 添加/删除软件--基本方法 ====
  
==== 添加/删除—— 最基本方法 ====
+
最简单安装包的方法是使用“添加/删除”工具。单击''应用程序'' --&gt; ''添加/删除...'' 来启动它。首先,查找你想安装的包。你可以用一个关键词来搜索,例如 “电子邮件”,或者通过查看窗口左边的分类显示。一旦您找到一个您想要安装的包,把包图标旁边的方框打勾即可。您可以依此勾上您所需的许多包。
  
The easiest way of installing a package is to click '''Applications''' '''Add/Remove...'''. Find the package or packages you want to install. You can search for a keyword, such as 'email', or look through the categories shown on the left hand side of the window. Once you've found a package you want to install, tick the box next to its icon.
+
当您完成选择后,单击窗口下边的''应用''按钮。另一个窗口会弹出,显示你所选的包并询问你是否真的想应用改变。为了安装包,再次单击''应用''。然后会请您键入''超级用户/管理员''的密码。一旦您完成输入密码,另一个窗口会出现并通知您安装过程的进度。当这完成时,单击''关闭''。您新程序已经安装好,并随时可用。
  
Once you've finished choosing, click the ''Apply'' button at the bottom of the window. Another window will pop up, showing all of the packages you've selected and asking if you'd like to apply the changes. To install the packages, click ''Apply''. You'll then be asked to type in your super-user/administrator password. Once you've entered it, another window will appear informing you of the installation progress. Once this has finished, click ''Close''. Your new programs are installed, ready to use!
+
==== 新立得软件包管理器--更高级的方法 ====
  
 +
新立得(Synaptic)软件包管理器提供更多高级的安装包的方法。如果你用添加/删除工具查找适当的包出现问题时,尝试在新立得软件包管理器里面搜索。这会在可用的源中搜索''全部'',甚至一些没有包含实际程序的包。
  
==== Synaptic(新立得软件包管理器) ——更高级的方法 ====
+
<br> 要了解新立得软件包管理器使用的详细信息,请阅读如何使用新立得软件包管理器。
 
+
The [[UbuntuHelp:Synaptic|Synaptic Package Manager]] offers a more advanced way of installing packages. If you have problems finding a suitable package with the Add/Remove tool, try using the search in Synaptic. This searches ''all'' of the packages in the available repositories, even the ones which don't contain programs.
+
 
+
For details on using Synaptic, read the [[UbuntuHelp:SynapticHowto]].
+
 
+
  
 
=== Kubuntu ===
 
=== Kubuntu ===
  
 
* '''Kubuntu 6.06 LTS (Dapper Drake)'''
 
* '''Kubuntu 6.06 LTS (Dapper Drake)'''
* '''Kubuntu 6.10 (Edgy Eft)'''
 
  
 +
==== 添加/删除程序--基本方法 ====
  
==== 添加/删除 应用程序——- 最基本方法 ====
+
一个新鲜而且简单的安装包的方法是应用'添加/删除程序'工具。单击'菜单''--&gt;''添加/删除程序''来启动。''
  
A new and easy method of installing packages is to use the 'Add/Remove
+
在Kubuntu中'''添加/删除程序'''是安装和删除应用程序的一个简单的图形模式下的方法。要运行'''添加/删除程序''',在桌面菜单系统中选择'''菜单''' --&gt; '''添加/删除程序''''
Programs' tool. Click ''K-Menu'' ''Add/Remove Programs'' to start it.
+
  
https://help.ubuntu.com/community/InstallingSoftware?action=AttachFile&do=get&target=AddRemoveProgs.png
+
<br> 运行添加/删除程序要求管理者的权限;要了解详细信息请查看''RootSudo。''
  
'''Add/Remove Programs''' is a simple graphical way of installing and removing applications in Kubuntu. To launch '''Add/Remove Programs''', choose '''K Menu''' → '''Add/Remove Programs''' from the desktop menu system.
+
<br> 要安装新的应用程序先要选择左边分类,然后核对你要安装的应用程序。当完成选择时单击应用,然后你所选择的程序将会自动下载并自动安装,同时会安装任何其它所需的附加应用程序。默认选择下是限定KDE的程序组,但从顶端的下拉菜单中选择的GNOME应用程序也可被安装。另外,如果你知道你所要安装程序的名字,可使用顶端的搜索工具。'
  
Running Add/Remove Programs requires administrative privileges; see RootSudo for more information.
+
<br> 附加软件源里的软件如果在您的软件源列表中可用,则可通过启用'''显示:不支持'''和'''显示:专有软件'''选择框来安装。要了解更详细信息,查看''''''''[Repositories']''页。''''''''''
  
To install new applications select the category on the left, then check the box of the application you want to install. When finished click Apply, then your chosen programs will be downloaded and installed automatically, as well as installing any additional applications that are required. The default selection is restricted to KDE suite, but GNOME applications can be installed by selecting from dropdown menu at the top. Alternatively, if you know the name of the program you want, use the Search tool at the top.
+
一旦这完成,单击'''''关闭''''。'''''你新的程序已经安装,并可以随时使用'''。 ''''''''''
  
Software from additional repositories may be installed by enabling the
+
==== Adept软件包管理器--更先进的方法 ====
'''Show: Unsupported''' and '''Show: proprietary software''' checkboxes if
+
they are enabled in your repository list. For more information, see the
+
[[UbuntuHelp:Repositories]] page.
+
  
Once this has finished, click ''Close''.Your new programs are installed, ready to use!
+
Adept软件包管理器提供了一种更先进的软件包安装方法。如果您用添加/删除程序工具查找匹配软件包有问题,请尝试使用Adept的搜索功能。
  
 +
要了解使用Adept更多详细信息,请参阅[[UbuntuWiki:Ubuntu:AdeptHowto|Adept Howto]]。
  
==== Adept——更高级的方法 ====
+
<br>
  
https://help.ubuntu.com/community/InstallingSoftware?action=AttachFile&do=get&target=adept.png
+
=== 命令行方式 ===
  
The Adept Package Manager offers a more advanced way of installing packages.
+
基本文本方法可以一致在Ubuntu,Kubuntu和Xubuntu上使用,但要求熟悉终端。
If you have problems finding a suitable package with the Add/Remove tool, try
+
using the search in Adept.
+
  
For details on using Adept, read the [[UbuntuWiki:Ubuntu/AdeptHowto|Adept Howto]].
+
==== Aptitude ====
  
 +
Aptitude是基于文本方式的软件包管理器,它必须在终端下运行。请阅读AptitudeSurvivalGuide了解更多如何使用Aptitude的信息。
  
=== 基于文本的方法 ===
+
==== apt-get--专业的方法 ====
  
Text based methods can be used across Ubuntu, Kubuntu and Xubuntu, but require
+
apt-get程序是一个命令行软件包管理器,当使用添加/删除程序工具和新立得软件包管理器都运行出现问题时就应当使用它。它提供高级的接口到APT,是一个Ubuntu下基本的软件包管理系统,当你不得不使用它时,它相当的易于操作。有能力的用户应该发现apt-get是一个比上述图形选项更快更多功能的管理器。
familiarity with the terminal.
+
  
 +
要了解如何使用apt-get的更详细信息,请阅读AptGetHowto and CommandLinePackageManagement。
  
==== Aptitude ——基于文本方法 ====
+
=== 安装下载完的软件包 ===
  
https://help.ubuntu.com/community/InstallingSoftware?action=AttachFile&do=get&target=Aptitude.png
+
有时候您可能想安装一个已经从网站下载好的软件包,而不是从软件库安装。这些包称为.deb文件。它们可能是为不同的Linux发行版而创建的,故而在Ubuntu上可能会因未满足依赖性而无法被安装。
  
Aptitude is a text-based package manager, which must be run from a Terminal. Read the AptitudeSurvivalGuide for more information on how to use Aptitude.
+
==== 使用GDebi来安装软件包 ====
  
 +
GDebi是一个用于安装软件包的图形化应用程序。如果可能的话它会自动检查包的依赖并尝试从Ubuntu软件库中下载相应的包。你首先要安装GDebi--使用上述列出的一种软件包管理器简单安装<code><nowiki>gdebi</nowiki></code>包,或者打开终端并键入<code><nowiki>sudo apt-get install gdebi</nowiki></code>。
  
==== apt-get ——终端下方法====
+
一旦您完成GDebi安装,请使用文件浏览器查找你想要安装的包,包文件看起来会类似于这:
  
The apt-get program is a command-line package manager, which should be used if the Add/Remove tool and Synaptic ever run into problems. It provides an advanced interface to APT, the underlying package management system which Ubuntu uses, but is reasonably easy to operate. Power users may find that apt-get is quicker to use and more powerful than the graphical options above.
+
https://help.ubuntu.com/community/UbuntuManual?action=AttachFile&amp;do=get&amp;target=deb_package.png
  
For details on how to use apt-get, read [[UbuntuHelp:AptGetHowto] and [|CommandLinePackageManagement]].
+
双击包使用GDebi打开它。如果所有的依赖已经和所选的包相匹配,简单地单击“安装包”按钮来安装它。未满足依赖的情况下GDebi会警告你。
  
 +
==== 使用Kubuntu软件包管理工具 ====
  
=== 安装已下载软件包 ===
+
在Kubuntu中安装.deb文件,在.deb文件上右击,选择Kubuntu软件包菜单 --&gt; 安装软件包。
  
You may wish to install a package you have downloaded from a website, rather than from a software repository.  These packages are called ''.deb'' files. Because they may have been created for a different Linux distribution, you might find that there's dependency issues with Ubuntu, meaning that they may be uninstallable.
+
==== 使用DPKG安装包 ====
  
 
+
dpkg是一个命令行包安装工具。使用dpkg安装一个包,打开终端并键入如下:
==== 使用 GDebi 安装软件包 ====
+
<pre>cd directory
 
+
GDebi is a graphical application used to install ''.deb'' packages. It automatically checks packages for their dependencies and will try to download them from the Ubuntu software repositories if possible. You may first need to install GDebi - simply install the <code><nowiki>gdebi</nowiki></code> package using one of the package managers listed above, or open a Terminal and type <code><nowiki>sudo apt-get install gdebi</nowiki></code>.
+
 
+
Once you have installed GDebi, use the File Browser to find the package you wish to install. Package files will look similar to this:
+
 
+
https://help.ubuntu.com/community/InstallingSoftware?action=AttachFile&do=get&target=deb_package.png
+
 
+
Double-click the package to open it with GDebi. If all dependencies have been met for the selected package, simply click the 'Install package' button to install it. GDebi will warn you if there are unmet dependencies, which means that there's dependencies that aren't in the repositories that you're using.
+
 
+
 
+
==== Using the Kubuntu Package Management Utility ====
+
 
+
To install a .deb file in Kubuntu, right-click on the .deb file, and choose Kubuntu Package Menu->Install Package.
+
 
+
 
+
==== 使用 dpkg 安装软件包 ====
+
 
+
dpkg is a command-line tool used to install packages. To install a package with dpkg, open a Terminal and type the following:
+
 
+
<pre><nowiki>cd directory
+
 
sudo dpkg -i package_name.deb
 
sudo dpkg -i package_name.deb
</nowiki></pre>
+
</pre>  
 
+
''注意:<code><nowiki>请将directory</nowiki></code>替换成包保存的目录,而<code><nowiki>package_name</nowiki></code>替换成包文件名。'' '
''Note: replace <code><nowiki>directory</nowiki></code> with the directory in which the package is stored and <code><nowiki>package_name</nowiki></code> with the filename of the package.''
+
 
+
It is recommended that you read the dpkg manual page before using dpkg, as improper use may break the package management database. To view the manual page for dpkg, open a Terminal and type <code><nowiki>man dpkg</nowiki></code>.
+
 
+
== 自动更新==
+
  
Ubuntu will automatically notify you when security updates and software upgrades are available. Simply click the update icon (which will appear in the notification area), type in your super-user/administrator password and follow the instructions on-screen to download and install the updates.
+
在使用dpkg之前推荐您阅读dpkg手册,因为引入使用可能会破坏包管理数据库。要查看dpkg手册页,打开终端并键入<code><nowiki>man dpkg 。</nowiki></code> '
  
Keeping up to date is important, as security fixes which protect your computer from harm are delivered in this way.
+
== 自动升级 ==
  
https://help.ubuntu.com/community/InstallingSoftware?action=AttachFile&do=get&target=update-notification.png
+
当安全升级和软件升级可能时,Ubuntu将自动通告你。单击升级图标(出现在通知区域),键入你超级用户/管理员密码并依照屏幕说明进行下载和安装升级。
  
 +
<br> 保持更新是重要的,用这方法作为安全修复和保护你的计算机不受伤害。
  
== 词汇 ==
+
https://help.ubuntu.com/community/UbuntuManual?action=AttachFile&amp;do=get&amp;target=update-notification.png
  
'''apt''':
+
== 词汇表 ==
The 'Advanced Package Tool', the program on which Ubuntu's Package Managers are based. apt handles the more complicated parts of package management, such as maintaining a database of packages.
+
  
'''Architecture''':
+
'''apt''':Advanced Package Tool(高级软件包工具),Ubuntu系统包管理器基本程序。apt处理软件包管理的较复杂部分,例如维护一个数据库包。
The type of processor the computer uses is referred to as its architecture.
+
  
'''Binary Package''':
+
'''Architecture''':计算机所用处理器的类型决定它的架构。
A package which contains a program suitable for one particular architecture.
+
  
'''deb''':
+
'''Binary Package''':包含适合一个特定架构的程序的软件包。
A .deb file is a Ubuntu (or Debian) package, which contains all of the files which the package will install.
+
  
'''Dependency''':
+
'''deb''':一个.deb文件就是一个包含软件包将要安装的全部文件的Ubuntu(或Debian)包。
A dependency is a package which must be installed for another package to work properly.
+
  
'''Package Manager''':
+
'''Dependency''':依赖是为另一个软件包正常工作而必须安装的一个软件包。
A program which handles packages, allowing you to search, install and remove them.  E.g. ''Add/Remove...''
+
  
'''Repository/Software Channel''':
+
'''Package Manager''':一个处理软件包程序,允许你查找,安装和删除包。
A location from which packages of a similar type are available to download and install.
+
  
'''Source Package''':
+
'''Repository/Software Channel''':一个可用于下载和安装的,类似于包类型的位置。
A package which contains the original code for a program, which must be compiled to be usable on a particular architecture.
+
  
----
+
'''Source Package''':一个包含程序原始代码的包,必须针对特定的架构进行编译才可用。
[[category:CategoryDocumentation]]
+
  
[[category:UbuntuHelp]]
+
[[category:包管理]]

2010年4月5日 (一) 20:14的最新版本


前言

在默认情况下,很多有用的程序在你添上Ubuntu系统到你电脑的时候已经安装好了。当然,有时候你可能需要完成一项工作而默认的应用程序无法满足,在这时你就需要一些新的软件。或者您可能想尝试用一个新软件来替换已经安装好的程序。在Ubuntu系统中安装软件是简单的,本向导将向你展示如何做。


如果您想了解更多的安装软件时发生的背景信息(可能包含适量的技术性知识),请阅读“软件包和软件包管理”。如果您仅仅想立刻了解安装新程序,可以直接跳到“安装软件包”。

软件包和软件包管理器

这部分包含软件包和软件包管理器的基本概念。您将会学习到什么是软件包,不同类型的软件包之间的区别和在Ubuntu系统上软件包管理器如何运作。

什么是软件包?

“软件”是一个非常广泛的界限,一般意义上是指一个可以在你电脑上运行的程序。当然,这样的程序常常需要其它的资源来完成它的工作任务。当您安装软件时,可能会需要数以千计的文件而仅仅是用来程序的启动。当你以为应该要把它们安置在一个精确的位置时,一部分文件却可能由于你电脑的类型而需要更改时,所有的这些将变得非常复杂难解。但是您无需担心——Ubuntu有个方法搞定这些。


Ubuntu使用“软件包”来存储运行需要的每一个单独的程序。包是收集相应文件并捆绑进一个单一的文件,这能使操作变得容易很多。以及当一个程序运行需要相应文件时,这里有一个特殊的文件称作“安装脚本”会在其它文件中复制相关文件到所需之处。

源文件还是二进制文件?

通常,当某人要为一个程序制作包时,他们把这个程序相关的所有的“源文件”放进一个包中。源代码是由程序员编写的,本质上是一连串的人们能够阅读和编写的计算机指令。计算机仅仅能够明白这已经以一种特定形式为它们解释的,人们能够直接使用的代码。一种方法为计算机解释源代码是使用“编译”它使其成为计算机能够理解 的“二进制”文件。

既然如此,为什么包制作者(称作打包员)不直接将它转换成二进制文件呢?注意,不同的计算机使用不同类型的二进制文件,因此如果你为某种类型计算机(如Intel PC)制作二进制文件,它在另外类型的计算机(如Apple Macintosh)上将不能正常工作。 源码包是仅仅包含源代码文件的包,而且只要代码以正确方式编译就能够在不同类型的机器上广泛地使用。

二进制包是为某种类型的计算机生成的特定的包。Ubuntu支持x86(i386 或 i686),AMD64和PPC架构。正确的二进制文件包可以自动地使用,因此您无需为选择合适的包而担忧。想知道您正在使用何种包,打开应用程序 --> 附件 --> 终端,键入arch 然後回车(ubuntu7.10此命令不能使用)。

软件包依赖

应用程序常常和另外的程序使用同样的文件。与其把这些文件放到每一个包中,不如把它们放进一个分开并能够安装的包来为所有的程序提供所需。因此,安装需要一个类似这样文件的应用程序,包含这些文件的包就必须也被安装。当一个包以这种方式依赖到另一个包时,它就是所谓的软件包依赖。通过指定依赖包,软件包可以做的更小和更简单,重复的文件和程序大部分被移除了。

当您选择安装一个程序,它的依赖包必须也同时被安装。常常的,很多要求的依赖已经安装,但还有额外的一小部分没有安装。所以您你安装一个包时,不要惊讶另外某些包也被安装--这些仅仅是您所选择包要正常运行的依赖包。

软件包管理器

软件包管理器是一个处理包下载和包安装的应用程序。在默认的情况下,Ubuntu包含一些软件包管理器,您要使用哪个取决于您所要实现的软件包管理任务的高深程度。大多数人只需使用最基本的软件包管理器,非常易用的--“添加/删除工具”。

软件频道/源

您可以从哪里获取到包呢?Ubuntu存储所有属于它的包到名叫软件频道的位置。软件频道是一个拥有相似类型的包的绝对位置,您可以使用包管理器从其下载和安装包。包管理器将会存储从这个软件频道所有可用包的一个索引。有时候它将会重建这个索引来确保它是最新的,同时可以了解从最近一次检查以来哪些包已经被升级或者加进了频道。

每种架构有四个Ubuntu软件频道-- Main, Restricted, Universe 和 Multiverse。每一个有不同的用途。默认情况下,只有来自Main 和 Restricted的软件包可以安装。如果您想能够安装来自Universe 或 Multiverse的软件包,查看UbuntuHelp:Repositories 说明页。

此外,Ubuntu官方库里可能使用第三方软件源。要小心啦 -- 使用一些不兼容 Ubuntu 的包可能会令您的程序停止工作或者更甚会严重损坏您的安装。页面 http://www.ubuntulinux.nl/source-o-matic 能够帮助你查找额外的软件源,而UbuntuHelp:Repositories页面会给出启用它们的说明。

安装软件包

这部分解释如何在Ubuntu和Kubuntu上使用多种可用工具安装软件包。

Ubuntu

  • Ubuntu 6.06 LTS (Dapper Drake)

添加/删除软件--基本方法

最简单安装包的方法是使用“添加/删除”工具。单击应用程序 --> 添加/删除... 来启动它。首先,查找你想安装的包。你可以用一个关键词来搜索,例如 “电子邮件”,或者通过查看窗口左边的分类显示。一旦您找到一个您想要安装的包,把包图标旁边的方框打勾即可。您可以依此勾上您所需的许多包。

当您完成选择后,单击窗口下边的应用按钮。另一个窗口会弹出,显示你所选的包并询问你是否真的想应用改变。为了安装包,再次单击应用。然后会请您键入超级用户/管理员的密码。一旦您完成输入密码,另一个窗口会出现并通知您安装过程的进度。当这完成时,单击关闭。您新程序已经安装好,并随时可用。

新立得软件包管理器--更高级的方法

新立得(Synaptic)软件包管理器提供更多高级的安装包的方法。如果你用添加/删除工具查找适当的包出现问题时,尝试在新立得软件包管理器里面搜索。这会在可用的源中搜索全部,甚至一些没有包含实际程序的包。


要了解新立得软件包管理器使用的详细信息,请阅读如何使用新立得软件包管理器。

Kubuntu

  • Kubuntu 6.06 LTS (Dapper Drake)

添加/删除程序--基本方法

一个新鲜而且简单的安装包的方法是应用'添加/删除程序'工具。单击'菜单-->添加/删除程序来启动。

在Kubuntu中添加/删除程序是安装和删除应用程序的一个简单的图形模式下的方法。要运行添加/删除程序,在桌面菜单系统中选择菜单 --> 添加/删除程序。'


运行添加/删除程序要求管理者的权限;要了解详细信息请查看RootSudo。


要安装新的应用程序先要选择左边分类,然后核对你要安装的应用程序。当完成选择时单击应用,然后你所选择的程序将会自动下载并自动安装,同时会安装任何其它所需的附加应用程序。默认选择下是限定KDE的程序组,但从顶端的下拉菜单中选择的GNOME应用程序也可被安装。另外,如果你知道你所要安装程序的名字,可使用顶端的搜索工具。'


附加软件源里的软件如果在您的软件源列表中可用,则可通过启用显示:不支持显示:专有软件选择框来安装。要了解更详细信息,查看'''[Repositories']页。'''''

一旦这完成,单击关闭''你新的程序已经安装,并可以随时使用。 '''''

Adept软件包管理器--更先进的方法

Adept软件包管理器提供了一种更先进的软件包安装方法。如果您用添加/删除程序工具查找匹配软件包有问题,请尝试使用Adept的搜索功能。

要了解使用Adept更多详细信息,请参阅Adept Howto


命令行方式

基本文本方法可以一致在Ubuntu,Kubuntu和Xubuntu上使用,但要求熟悉终端。

Aptitude

Aptitude是基于文本方式的软件包管理器,它必须在终端下运行。请阅读AptitudeSurvivalGuide了解更多如何使用Aptitude的信息。

apt-get--专业的方法

apt-get程序是一个命令行软件包管理器,当使用添加/删除程序工具和新立得软件包管理器都运行出现问题时就应当使用它。它提供高级的接口到APT,是一个Ubuntu下基本的软件包管理系统,当你不得不使用它时,它相当的易于操作。有能力的用户应该发现apt-get是一个比上述图形选项更快更多功能的管理器。

要了解如何使用apt-get的更详细信息,请阅读AptGetHowto and CommandLinePackageManagement。

安装下载完的软件包

有时候您可能想安装一个已经从网站下载好的软件包,而不是从软件库安装。这些包称为.deb文件。它们可能是为不同的Linux发行版而创建的,故而在Ubuntu上可能会因未满足依赖性而无法被安装。

使用GDebi来安装软件包

GDebi是一个用于安装软件包的图形化应用程序。如果可能的话它会自动检查包的依赖并尝试从Ubuntu软件库中下载相应的包。你首先要安装GDebi--使用上述列出的一种软件包管理器简单安装gdebi包,或者打开终端并键入sudo apt-get install gdebi

一旦您完成GDebi安装,请使用文件浏览器查找你想要安装的包,包文件看起来会类似于这:

UbuntuManual?action=AttachFile&do=get&target=deb_package.png

双击包使用GDebi打开它。如果所有的依赖已经和所选的包相匹配,简单地单击“安装包”按钮来安装它。未满足依赖的情况下GDebi会警告你。

使用Kubuntu软件包管理工具

在Kubuntu中安装.deb文件,在.deb文件上右击,选择Kubuntu软件包菜单 --> 安装软件包。

使用DPKG安装包

dpkg是一个命令行包安装工具。使用dpkg安装一个包,打开终端并键入如下:

cd directory
sudo dpkg -i package_name.deb

注意:请将directory替换成包保存的目录,而package_name替换成包文件名。 '

在使用dpkg之前推荐您阅读dpkg手册,因为引入使用可能会破坏包管理数据库。要查看dpkg手册页,打开终端并键入man dpkg 。 '

自动升级

当安全升级和软件升级可能时,Ubuntu将自动通告你。单击升级图标(出现在通知区域),键入你超级用户/管理员密码并依照屏幕说明进行下载和安装升级。


保持更新是重要的,用这方法作为安全修复和保护你的计算机不受伤害。

UbuntuManual?action=AttachFile&do=get&target=update-notification.png

词汇表

apt:Advanced Package Tool(高级软件包工具),Ubuntu系统包管理器基本程序。apt处理软件包管理的较复杂部分,例如维护一个数据库包。

Architecture:计算机所用处理器的类型决定它的架构。

Binary Package:包含适合一个特定架构的程序的软件包。

deb:一个.deb文件就是一个包含软件包将要安装的全部文件的Ubuntu(或Debian)包。

Dependency:依赖是为另一个软件包正常工作而必须安装的一个软件包。

Package Manager:一个处理软件包程序,允许你查找,安装和删除包。

Repository/Software Channel:一个可用于下载和安装的,类似于包类型的位置。

Source Package:一个包含程序原始代码的包,必须针对特定的架构进行编译才可用。