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.
