InstallingSoftware
原文出处:Ubuntu官方Wiki
原文作者:
授权许可:创作共用协议
翻译人员:onlysai
校对人员:purewind
适用版本:
文章状态:完成
InstallingSoftware(安装软件)
Introduction(说明)
By default, many useful programs are installed when you put Ubuntu onto your computer. However, from time to time you may need to perform a task that the default set of applications cannot manage, and so will require some new software. Or you might just want to try out an alternative program to one which is already installed. Installing software in Ubuntu is easy, and this guide will show you how to do it.
在默认情况下,很多有用的程序在你添上Ubuntu系统到你电脑的时候已经安装好了。当然,有时候你可能需要完成一项工作而默认的应用程序无法满足,在这时你就需要一些新的软件。或者您可能想尝试用一个新软件来替换已经安装好的程序。在Ubuntu系统中安装软件是简单的,本向导将向你展示如何做。
If you'd like to get some background information on what's happening when you install software (which may be a little technical in places), read Packages and Package Management. If you just want to get started installing new programs, you can skip straight to Installing a Package.
如果您想了解更多的安装软件时发生的背景信息(可能包含适量的技术性知识),请阅读“软件包和软件包管理”。如果您仅仅想立刻了解安装新程序,可以直接跳到“安装软件包”。
Packages and Package Management(软件包和软件包管理器)
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系统上软件包管理器如何运作。
What is a package?(什么是软件包?)
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 help them accomplish their tasks. When you install software, thousands of files might be required just to let the program start! When you think that they all have to be put into exactly the right location, and some of those files might need to be changed depending on what type of computer you have, it all gets very complicated. But you don't have to worry about this - Ubuntu has a way of handling all this complexity.
“软件”是一个非常广泛的界限,一般意义上是指一个可以在你电脑上运行的程序。当然,这样的程序常常需要其它的资源来完成它的工作任务。当您安装软件时,可能会需要数以千计的文件而仅仅是用来程序的启动。当你以为应该要把它们安置在一个精确的位置时,一部分文件却可能由于你电脑的类型而需要更改时,所有的这些将变得非常复杂难解。但是您无需担心——Ubuntu有个方法搞定这些。
Ubuntu uses packages to store everything that a particular program needs to run. Packages are collections 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使用“软件包”来存储运行需要的每一个单独的程序。包是收集相应文件并捆绑进一个单一的文件,这能使操作变得容易很多。以及当一个程序运行需要相应文件时,这里有一个特殊的文件称作“安装脚本”会在其它文件中复制相关文件到所需之处。
Source or Binary? (源文件还是二进制文件?)
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 compiling it into binary, which computers are able to understand.
通常,当某人要为一个程序制作包时,他们把这个程序相关的所有的“源文件”放进一个包中。源代码是由程序员编写的,本质上是一连串的人们能够阅读和编写的计算机指令。计算机仅仅能够明白这已经以一种特定形式为它们解释的,人们能够直接使用的代码。一种方法为计算机解释源代码是使用“编译”它使其成为计算机能够理解 的“二进制”文件。
So why don't the people who make the package (called packagers) just convert it into binary straight away? 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.
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 arch
then hit the enter key.
源码包是仅仅包含源代码文件的包,而且只要代码以正确方式编译就能够在不同类型的机器上广泛地使用。
二进制包是为某种类型或架构的计算机生成的特定的包。Ubuntu支持x86(i386 或 i686),AMD64和PPC架构。正确的二进制文件包可以自动地使用,因此您你无需为选择合适的而担忧。想知道您正在使用何种包,打开应用程序 --> 附件 --> 终端,键入 arch
然后回车。
Package Dependencies(软件包依赖)
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 choose to 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 extra ones may be required 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.
当您选择一个安装一个程序,它的依赖必须也同时被安装。常常的,很多要求的依赖已经安装,但还有额外的一小部分可能还要求。所以您你安装一个包时,不要惊讶另外某些包也被安装--这些仅仅是您所选择包要正常运行的依赖。
Package Managers(软件包管理器)
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包含一些软件包管理器,您要使用哪个取决于您所要实现的软件包管理任务的高深程度。大多数人只需使用最基本的软件包管理器,非常易用的--“添加/删除工具”。
Software Channels/Repositories(软件频道/源)
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 be able to install packages from Universe or Multiverse, see the Repositories page for instructions.
每种架构有四个Ubuntu软件频道-- Main, Restricted, Universe 和 Multiverse。每一个有不同的用途。默认情况下,只有来自Main 和 Restricted的软件包可以安装。如果您想能够安装来自Universe 或 Multiverse的软件包,查看Repositories 说明页。
In addition to the official Ubuntu repositories, it is possible to use third party repositories. Be careful - 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 Repositories page gives instructions on how to enable them.
此外,Ubuntu官方库里可能使用第三方软件源。要小心啦 -- 使用一些不兼容 Ubuntu 的包可能会令您的程序停止工作或者更甚会严重损坏您的安装。页面 http://www.ubuntulinux.nl/source-o-matic 能够帮助你查找额外的软件源,而Repositories页面会给出启用它们的说明。
Installing a Package(安装软件包)
This section explains how to install packages using the various tools available in Ubuntu and Kubuntu.
这部分解释如何在Ubuntu和Kubuntu上使用多种可用工具安装软件包。
Ubuntu
- Ubuntu 6.06 LTS (Dapper Drake)
Add/Remove - the basic method(添加/删除--基本方法)
The easiest way of installing a package is to use the 'Add/Remove' tool. Click Applications --> Add/Remove... to start it. First, 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. You can do this for as many packages as you like.
最简单安装包的方法是使用“添加/删除”工具。单击 应用程序 --> 添加/删除... 来启动它。首先,查找你想安装的包。你可以用一个关键词来搜索,例如 “电子邮件”,或者通过查看窗口左边的分类显示。一旦您找到一个您想要安装的包,把包图标旁边的方框打勾即可。您可以依此勾上您所需的许多包。
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 - the more advanced method(新立得软件包管理器--更高级的方法)
The 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 SynapticHowto.
要了解新立得软件包管理器使用的详细信息,请阅读如何使用新立得软件包管理器。
Kubuntu
- Kubuntu 6.06 LTS (Dapper Drake)
Add/Remove Programs - the basic method(添加/删除程序--基本方法)
A new and easy method of installing packages is to use the 'Add/Remove Programs' tool. Click K-Menu --> Add/Remove Programs to start it.
一个新鲜而且简单的安装包的方法是应用'添加/删除程序'工具。单击'菜单 --> 添加/删除程序 来启动。
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.
在Kubuntu中添加/删除程序是安装和删除应用程序的一个简单的图形模式下的方法。要运行添加/删除程序,在桌面菜单系统中选择菜单 --> 添加/删除程序。
. Running Add/Remove Programs requires administrative privileges; see RootSudo for more information.
运行添加/删除程序要求管理者的权限;要了解详细信息请查看RootSudo。
. 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.
要安装新的应用程序先要选择左边分类,然后核对你要安装的应用程序。当完成选择时单击应用,然后你所选择的程序将会自动下载并自动安装,同时会安装任何其它所需的附加应用程序。默认选择下是限定KDE的程序组,但从顶端的下拉菜单中选择的GNOME应用程序也可被安装。另外,如果你知道你所要安装程序的名字,可使用顶端的搜索工具。
. 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 Repositories page.
附加软件源里的软件如果在您的软件源列表中可用,则可通过启用显示:不支持和显示:专有软件选择框来安装。要了解更详细信息,查看[Repositories']页。
. Once this has finished, click Close'''.Your new programs are installed, ready to use!
一旦这完成,单击关闭'。你新的程序已经安装,并可以随时使用。
.
Adept - the more advanced method(Adept--更先进的方法)
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.
Adept软件包管理器提供了一种更先进的软件包安装方法。如果您用添加/删除程序工具查找匹配软件包有问题,请尝试使用Adept的搜索功能。
For details on using Adept, read the Adept Howto.
要了解使用Adept更多详细信息,请参阅Adept Howto。
.
Text Based Methods (基本文本方法)
Text based methods can be used across Ubuntu, Kubuntu and Xubuntu, but require familiarity with the terminal.
基本文本方法可以一致在Ubuntu,Kubuntu和Xubuntu上使用,但要求熟悉终端。
Aptitude - the text-based method (Aptitude -- 基本文本方法)
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.
Aptitude是基于文本方式的软件包管理器,它必须在终端下运行。请阅读AptitudeSurvivalGuide了解更多如何使用Aptitude的信息。
apt-get - the technical method (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 if you ever have to use it. Power users may find that apt-get is quicker to use and more powerful than the graphical options above.
apt-get程序是一个命令行软件包管理器,当使用添加/删除程序工具和新立得软件包管理器都运行出现问题时就应当使用它。它提供高级的接口到APT,是一个Ubuntu下基本的软件包管理系统,当你不得不使用它时,它相当的易于操作。有能力的用户应该发现apt-get是一个比上述图形选项更快更多功能的管理器。
For details on how to use apt-get, read AptGetHowto and CommandLinePackageManagement.
要了解如何使用apt-get的更详细信息,请阅读AptGetHowto and CommandLinePackageManagement。
Installing downloaded packages(安装下载完的软件包)
Sometimes you might want to install a package which 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, they may have unmet dependencies on Ubuntu and so may not be installable.
有时候您可能想安装一个已经从网站下载好的软件包,而不是从软件库安装。这些包称为.deb文件。它们可能是为不同的Linux发行版而创建的,故而在Ubuntu上可能会因未满足依赖性而无法被安装。
Using GDebi to install packages (使用GDebi来安装软件包)
GDebi is a graphical application used to install 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
.
GDebi是一个用于安装软件包的图形化应用程序。如果可能的话它会自动检查包的依赖并尝试从Ubuntu软件库中下载相应的包。你首先要安装GDebi--使用上述列出的一种软件包管理器简单安装gdebi
包,或者打开终端并键入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:
一旦您完成GDebi安装,请使用文件浏览器查找你想要安装的包,包文件看起来会类似于这:
attachment: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.
双击包使用GDebi打开它。如果所有的依赖已经和所选的包相匹配,简单地单击“安装包”按钮来安装它。未满足依赖的情况下GDebi会警告你。
Using the Kubuntu Package Management Utility(使用Kubuntu软件包管理工具)
To install a .deb file in Kubuntu, right-click on the .deb file, and choose Kubuntu Package Menu->Install Package.
在Kubuntu中安装.deb文件,在.deb文件上右击,选择Kubuntu软件包菜单 --> 安装软件包。
.
Using dpkg to install packages(使用dpkg安装包)
dpkg is a command-line tool used to install packages. To install a package with dpkg, open a Terminal and type the following:
dpkg是一个命令行包安装工具。使用dpkg安装一个包,打开终端并键入如下:
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.
注意:请将directory
替换成包保存的目录,而package_name
替换成包文件名。
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
.
在使用dpkg之前推荐您阅读dpkg手册,因为引入使用可能会破坏包管理数据库。要查看dpkg手册页,打开终端并键入man dpkg 。
Automatic updates(自动升级)
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.
当安全升级和软件升级可能时,Ubuntu将自动通告你。单击升级图标(出现在通知区域),键入你超级用户/管理员密码并依照屏幕说明进行下载和安装升级。
Keeping up to date is important, as security fixes which protect your computer from harm are delivered in this way.
保持更新是重要的,用这方法作为安全修复和保护你的计算机不受伤害。
attachment:update-notification.png
Glossary(词汇表)
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.
apt:Advanced Package Tool(高级软件包工具),Ubuntu系统包管理器基本程序。apt处理软件包管理的较复杂部分,例如维护一个数据库包。
Architecture: The type of processor the computer uses is referred to as its architecture.
Architecture:计算机所用处理器的类型决定它的架构。
Binary Package: A package which contains a program suitable for one particular architecture.
Binary Package:包含适合一个特定架构的程序的软件包。
deb: A .deb file is an Ubuntu (or Debian) package, which contains all of the files which the package will install.
deb:一个.deb文件就是一个包含软件包将要安装的全部文件的Ubuntu(或Debian)包。
Dependency: A dependency is a package which must be installed for another package to work properly.
Dependency:依赖是为另一个软件包正常工作而必须安装的一个软件包。
Package Manager: A program which handles packages, allowing you to search, install and remove them.
Package Manager:一个处理软件包程序,允许你查找,安装和删除包。
Repository/Software Channel: A location from which packages of a similar type are available to download and install.
Repository/Software Channel:一个可用于下载和安装的,类似于包类型的位置。
Source Package: A package which contains the original code for a program, which must be compiled to be usable on a particular architecture.
Source Package:一个包含程序原始代码的包,必须针对特定的架构进行编译才可用。