个人工具

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

来自Ubuntu中文

跳转至: 导航, 搜索
第5行: 第5行:
 
默认情况下,当您把 Ubuntu 安装到您的计算机时,很多有用的程序就已经装好了。然而,这些程序可能仍然不能满足您的需要,或者您觉得它不够好,想要试试其他的“替代品”。换句话说,您需要新软件。
 
默认情况下,当您把 Ubuntu 安装到您的计算机时,很多有用的程序就已经装好了。然而,这些程序可能仍然不能满足您的需要,或者您觉得它不够好,想要试试其他的“替代品”。换句话说,您需要新软件。
  
如果您想了解关于软件安装的一些背景知识(有时可能很专业),请参阅 '''软件包和软件包管理''' 一节;如果您只想安装新程序,您可以直接跳转到 '''安装软件包''' 一节。
+
如果您想了解关于软件安装的一些背景知识(有时可能很专业),请参阅 ''软件包和软件包管理'' 一节;如果您只想安装新程序,您可以直接跳转到 ''安装软件包'' 一节。
  
 
== 软件包和软件包管理 ==
 
== 软件包和软件包管理 ==
第11行: 第11行:
 
本节包括软件包以及软件包管理的基本概念。通过阅读本节您将了解什么是软件包,软件包的分类,以及 Ubuntu 是如何管理软件包的。
 
本节包括软件包以及软件包管理的基本概念。通过阅读本节您将了解什么是软件包,软件包的分类,以及 Ubuntu 是如何管理软件包的。
  
=== 什么是软件包? ===  
+
=== 什么是软件包? ===
  
'''软件''' 是一个非常宽泛的概念,通常认为软件指的就是可以运行在计算机上的程序。不过,有的程序必须依赖其它的资源才能正常工作。当您安装一个软件时,光是启动这个程序就可能要求几千个文件!想想看,这些成千上万的文件都必须放在正确的位置,有些文件还要根据不同的计算机的平台来做变更,这是个很麻烦的事情。幸运的是,Ubuntu 能够处理这种复杂性。Ubuntu 使用软件包存储指定程序运行所需的一切文件。一个 '''软件包''' 实际上是所需的文件集捆绑在一个单独文件里,这样使得操作更加方便。就如文件需要程序来运行一样,这个包也需要一个特定的文件,"installation scripts(安装脚本)"来指定各个文件该拷贝到什么地方(当然脚本做的可能还不止这些)。
+
''软件'' 是一个非常宽泛的概念,通常认为软件指的就是可以运行在计算机上的程序。不过,有的程序必须依赖其它的资源才能正常工作。当您安装一个软件时,光是启动这个程序就可能要求几千个文件!想想看,这些成千上万的文件都必须放在正确的位置,有些文件还要根据不同的计算机的平台来做变更,这是个很麻烦的事情。幸运的是,Ubuntu 能够处理这种复杂性。Ubuntu 使用 ''软件包'' 来保存指定程序运行所需的所有文件。一个 ''软件包'' 就是将一些文件捆绑到一个单独文件里,这样管理起来更方便。除了程序运行所需要的文件之外,它还包含一个称为“安装脚本(installation scripts)”的文件,用来指定各个文件该安装到什么地方(这是安装脚本的作用之一)。
  
 
=== 源码还是二进制? ===
 
=== 源码还是二进制? ===
  
通常,人们将程序打包时,他们把所有程序需要的的源代码放到软件包里。源代码实际上是程序员写的可阅读的计算机指令列表。想要计算机能读懂它,就必须翻译为计算机能够阅读的形式。而翻译源代码为计算机能够阅读的形式的一种方式就是"编译""二进制"形式,编译以後计算机就可以理解它了。
+
通常,人们将程序打包时,他们把所有的 ''源代码'' 也打进软件包里。''源代码'' 是程序员编写的,可供人们阅读的计算机指令列表。想要计算机能读懂它,就必须将源代码 ''翻译'' 为计算机能够读取的格式。而这种翻译的方式之一就是将源代码 ''编译'' ''二进制'' 格式。编译以后计算机就可以理解它了。
  
那打包的人(打包工?)为什么不在一开始就直接转换为二进制形式呢?通常不同的计算机使用不同形式的二进制编码,这样如果您将编译了一种二进制包(比如适合intel PC的),他在其他的计算机里就没法工作了。(例如Apple macintosh)
+
那么,打包的人(称为 packager)为什么不一开始就直接转换为二进制形式呢?实际上,不同的计算机使用不同的二进制指令,如果您为某种特定的计算机(比如 Intel PC)做了编译,编译后的文件在其他类型的计算机里是无法工作的。(比如 Apple Macintosh)
  
'''源码包''' 是一个仅仅包含源代码的软件包,一般只要经过正确的编译就可以在任何机器上使用。
+
'''源码包''' 是一个仅仅包含源代码的软件包,一般只要经过正确的编译就可以在任何机器上使用。
  
'''二进制包'''是为特定类型的平台或“架构”编译的包。Ubuntu支持x86(i386 or i686),AMD64和ppc架构。正确的二进制软件包可以自动使用,所以您不必担心该选哪个。想要知道您的正在使用的平台,您可以打开:'Applications''→''Accessories''→''Terminal'', 输入 <code><nowiki>arch</nowiki></code> ,然後回车。''
+
'''二进制包''' 是为特定类型的计算机平台或 ''架构'' 编译好的包。Ubuntu 支持 x86(i386 or i686),AMD64 和 ppc 架构。正确的二进制软件包可以自动使用,您不必担心该选哪个。想要知道您的正在使用的平台,您可以打开:''应用程序''→''附件''→''终端'', 输入 <code><nowiki>arch</nowiki></code> ,然后回车。
  
 
=== 软件包的依赖 ===
 
=== 软件包的依赖 ===
第32行: 第32行:
  
 
当您安装一个程序时,同时也会安装其依赖的东西。通常您依赖的包一般都已经安装了,但是有时候依然会要安装一些包。所以,您安装软件包时,看到其他软件包也被安装时,不要感到奇怪--他们仅仅是保证这个包能运行所需要的文件。
 
当您安装一个程序时,同时也会安装其依赖的东西。通常您依赖的包一般都已经安装了,但是有时候依然会要安装一些包。所以,您安装软件包时,看到其他软件包也被安装时,不要感到奇怪--他们仅仅是保证这个包能运行所需要的文件。
 
----
 
  
 
https://help.ubuntu.com/community/InstallingSoftware?action=AttachFile&amp;do=get&amp;target=scrn-synaptic-dependencies.jpg <br> ''描述依赖关系的图例''
 
https://help.ubuntu.com/community/InstallingSoftware?action=AttachFile&amp;do=get&amp;target=scrn-synaptic-dependencies.jpg <br> ''描述依赖关系的图例''
第65行: 第63行:
 
安装软件包最简洁的方法就是:点击 '''程序''' → '''添加/删除...'''。找到您需要安装的包。您可以通过关键词搜索,如"email",也可以通过左边的分类选项来进行过滤。一旦您找到您要安装的包,标记图标旁边的复选框。
 
安装软件包最简洁的方法就是:点击 '''程序''' → '''添加/删除...'''。找到您需要安装的包。您可以通过关键词搜索,如"email",也可以通过左边的分类选项来进行过滤。一旦您找到您要安装的包,标记图标旁边的复选框。
  
一旦您完成了选择,点击下面的“应用”按钮。会弹出一个窗口列出您已经选择的包并提示您是否应用更改。想要安装的话,点击“应用”。您将会被提示输入超级用户的密码。一旦输入,会有另一个窗口显示安装进度。安装完成後,点击"关闭"。您的新程序就装好了,去用吧。
+
一旦您完成了选择,点击下面的“应用”按钮。会弹出一个窗口列出您已经选择的包并提示您是否应用更改。想要安装的话,点击“应用”。您将会被提示输入超级用户的密码。一旦输入,会有另一个窗口显示安装进度。安装完成后,点击"关闭"。您的新程序就装好了,去用吧。
  
 
==== Synaptic(新立得软件包管理器) ——更高级的方法 ====
 
==== Synaptic(新立得软件包管理器) ——更高级的方法 ====

2008年2月13日 (三) 15:47的版本

引言

Ubuntu 下安装软件是非常简单。本文将告诉您如何操作。

默认情况下,当您把 Ubuntu 安装到您的计算机时,很多有用的程序就已经装好了。然而,这些程序可能仍然不能满足您的需要,或者您觉得它不够好,想要试试其他的“替代品”。换句话说,您需要新软件。

如果您想了解关于软件安装的一些背景知识(有时可能很专业),请参阅 软件包和软件包管理 一节;如果您只想安装新程序,您可以直接跳转到 安装软件包 一节。

软件包和软件包管理

本节包括软件包以及软件包管理的基本概念。通过阅读本节您将了解什么是软件包,软件包的分类,以及 Ubuntu 是如何管理软件包的。

什么是软件包?

软件 是一个非常宽泛的概念,通常认为软件指的就是可以运行在计算机上的程序。不过,有的程序必须依赖其它的资源才能正常工作。当您安装一个软件时,光是启动这个程序就可能要求几千个文件!想想看,这些成千上万的文件都必须放在正确的位置,有些文件还要根据不同的计算机的平台来做变更,这是个很麻烦的事情。幸运的是,Ubuntu 能够处理这种复杂性。Ubuntu 使用 软件包 来保存指定程序运行所需的所有文件。一个 软件包 就是将一些文件捆绑到一个单独文件里,这样管理起来更方便。除了程序运行所需要的文件之外,它还包含一个称为“安装脚本(installation scripts)”的文件,用来指定各个文件该安装到什么地方(这是安装脚本的作用之一)。

源码还是二进制?

通常,人们将程序打包时,他们把所有的 源代码 也打进软件包里。源代码 是程序员编写的,可供人们阅读的计算机指令列表。想要计算机能读懂它,就必须将源代码 翻译 为计算机能够读取的格式。而这种翻译的方式之一就是将源代码 编译二进制 格式。编译以后计算机就可以理解它了。

那么,打包的人(称为 packager)为什么不一开始就直接转换为二进制形式呢?实际上,不同的计算机使用不同的二进制指令,如果您为某种特定的计算机(比如 Intel PC)做了编译,编译后的文件在其他类型的计算机里是无法工作的。(比如 Apple Macintosh)

源码包 是一个仅仅包含源代码的软件包,一般只要经过正确的编译就可以在任何机器上使用。

二进制包 是为特定类型的计算机平台或 架构 编译好的包。Ubuntu 支持 x86(i386 or i686),AMD64 和 ppc 架构。正确的二进制软件包可以自动使用,您不必担心该选哪个。想要知道您的正在使用的平台,您可以打开:应用程序附件终端, 输入 arch ,然后回车。

软件包的依赖

不同的程序经常会用到相同的文件。与其将这些共同的文件放在每个软件包里,不如用单独的包来安装这些大家都需要的文件。如果安装一个程序时,需要这些文件,这个包包含的这些文件都必须被安装。当一个包以这种形式依赖其他包时,我们称其为'包依赖',通过指定依赖关系,可以让包边的更小,尽可能移除重复的文件和程序。


当您安装一个程序时,同时也会安装其依赖的东西。通常您依赖的包一般都已经安装了,但是有时候依然会要安装一些包。所以,您安装软件包时,看到其他软件包也被安装时,不要感到奇怪--他们仅仅是保证这个包能运行所需要的文件。

InstallingSoftware?action=AttachFile&do=get&target=scrn-synaptic-dependencies.jpg
描述依赖关系的图例

软件包管理器

软件包管理器是一个管理下载和安装包的应用程序。Ubuntu默认自带几个包管理器,选择使用哪个包管理器取决于您需要进行包管理任务的复杂程度。大多数人仅仅需要使用基本的包管理器器:"添加/删除工具"即可,它使用起来非常简单。

软件 频道/源

您的软件包打哪来的?

Ubuntu 将所有的软件包存储在"软件仓库"。软件仓库用一致的格式存储软件包,您可以使用包管理器从软件仓库下载安装包。软件包管理器存储从软件仓库获得的所有可用软件的索引。软件包管理器会定期重建索引,以确定从上次索引以来,有哪些软件更新了,或者又添加了哪些新软件。

Ubuntu 软件仓库有四种类型 - Main,Restricted,Universe 和 Multiverse。他们用于不同的目的。默认情况下只有 Main 和 Restricted 类的包会被安装。如果您想安装 Universe 或 Multiverse 的包,请参考<a href="UbuntuHelp:Repositories">UbuntuHelp:Repositories</a> 页的介绍。

除 Ubuntu 官方软件仓库外,您还可以使用第三方软件仓库。但是您必须小心,因为有些与 Ubuntu 存在兼容性问题,使用可能会导致程序无法工作,或者安装问题。http://www.ubuntulinux.nl/source-o-matic 页可以协助您找到合适的软件仓库。 <a href="UbuntuHelp:Repositories">UbuntuHelp:Repositories</a> 也介绍了如何使用这些软件仓库。

安装软件包

这部分将向您解释如何使用 Ubuntu 和 Kubuntu 下可用的各种工具安装软件包。

Ubuntu

  • Ubuntu 6.06 LTS (Dapper Drake)
  • Ubuntu 6.10 (Edgy Eft)
  • Ubuntu 7.04 (Feisty Fawn)

添加/删除—— 最基本方法

安装软件包最简洁的方法就是:点击 程序添加/删除...。找到您需要安装的包。您可以通过关键词搜索,如"email",也可以通过左边的分类选项来进行过滤。一旦您找到您要安装的包,标记图标旁边的复选框。

一旦您完成了选择,点击下面的“应用”按钮。会弹出一个窗口列出您已经选择的包并提示您是否应用更改。想要安装的话,点击“应用”。您将会被提示输入超级用户的密码。一旦输入,会有另一个窗口显示安装进度。安装完成后,点击"关闭"。您的新程序就装好了,去用吧。

Synaptic(新立得软件包管理器) ——更高级的方法

The <a href="UbuntuHelp:Synaptic">Synaptic Package Manager</a> 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 <a href="UbuntuHelp:SynapticHowto">UbuntuHelp:SynapticHowto</a>.


Kubuntu

  • Kubuntu 6.06 LTS (Dapper Drake)
  • Kubuntu 6.10 (Edgy Eft)


添加/删除 应用程序——- 最基本方法

A new and easy method of installing packages is to use the 'Add/Remove Programs' tool. Click K-MenuAdd/Remove Programs to start it.

InstallingSoftware?action=AttachFile&do=get&target=AddRemoveProgs.png

Add/Remove Programs is a simple graphical way of installing and removing applications in Kubuntu. To launch Add/Remove Programs, choose K MenuAdd/Remove Programs from the desktop menu system.

Running Add/Remove Programs requires administrative privileges; see RootSudo for more information.

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

Show: Unsupported and Show: proprietary software checkboxes if they are enabled in your repository list. For more information, see the <a href="UbuntuHelp:Repositories">UbuntuHelp:Repositories</a> page.


Once this has finished, click Close.Your new programs are installed, ready to use!


Adept——更高级的方法

InstallingSoftware?action=AttachFile&do=get&target=adept.png

The Adept 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 Adept.


For details on using Adept, read the <a href="UbuntuWiki:Ubuntu/AdeptHowto">Adept Howto</a>.


基于文本的方法

Text based methods can be used across Ubuntu, Kubuntu and Xubuntu, but require familiarity with the terminal.


Aptitude ——基于文本方法

InstallingSoftware?action=AttachFile&do=get&target=Aptitude.png

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.


apt-get ——终端下方法

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.

For details on how to use apt-get, read [[UbuntuHelp:AptGetHowto] and [|CommandLinePackageManagement]].


安装已下载软件包

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.


使用 GDebi 安装软件包

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 gdebi package using one of the package managers listed above, or open a Terminal and type sudo apt-get install gdebi.

Once you have installed GDebi, use the File Browser to find the package you wish to install. Package files will look similar to this:

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:

cd directory
sudo dpkg -i package_name.deb

Note: replace directory with the directory in which the package is stored and package_name 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 man dpkg.

自动更新

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.

Keeping up to date is important, as security fixes which protect your computer from harm are delivered in this way.

InstallingSoftware?action=AttachFile&do=get&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:

The type of processor the computer uses is referred to as its architecture.


Binary Package:

A package which contains a program suitable for one particular architecture.


deb:

A .deb file is a Ubuntu (or Debian) package, which contains all of the files which the package will install.


Dependency:

A dependency is a package which must be installed for another package to work properly.


Package Manager:

A program which handles packages, allowing you to search, install and remove them. E.g. Add/Remove...


Repository/Software Channel:

A location from which packages of a similar type are available to download and install.


Source Package:

A package which contains the original code for a program, which must be compiled to be usable on a particular architecture.



<a href="Category:CategoryDocumentation">Category:CategoryDocumentation</a> <a href="Category:UbuntuHelp">Category:UbuntuHelp</a>