特殊:Badtitle/NS100:InstallingSoftware
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/InstallingSoftware }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/af | • {{#if: UbuntuHelp:InstallingSoftware|Afrikaans| [[::InstallingSoftware/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/ar | • {{#if: UbuntuHelp:InstallingSoftware|العربية| [[::InstallingSoftware/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/az | • {{#if: UbuntuHelp:InstallingSoftware|azərbaycanca| [[::InstallingSoftware/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/bcc | • {{#if: UbuntuHelp:InstallingSoftware|جهلسری بلوچی| [[::InstallingSoftware/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/bg | • {{#if: UbuntuHelp:InstallingSoftware|български| [[::InstallingSoftware/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/br | • {{#if: UbuntuHelp:InstallingSoftware|brezhoneg| [[::InstallingSoftware/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/ca | • {{#if: UbuntuHelp:InstallingSoftware|català| [[::InstallingSoftware/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/cs | • {{#if: UbuntuHelp:InstallingSoftware|čeština| [[::InstallingSoftware/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/de | • {{#if: UbuntuHelp:InstallingSoftware|Deutsch| [[::InstallingSoftware/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/el | • {{#if: UbuntuHelp:InstallingSoftware|Ελληνικά| [[::InstallingSoftware/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/es | • {{#if: UbuntuHelp:InstallingSoftware|español| [[::InstallingSoftware/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/fa | • {{#if: UbuntuHelp:InstallingSoftware|فارسی| [[::InstallingSoftware/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/fi | • {{#if: UbuntuHelp:InstallingSoftware|suomi| [[::InstallingSoftware/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/fr | • {{#if: UbuntuHelp:InstallingSoftware|français| [[::InstallingSoftware/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/gu | • {{#if: UbuntuHelp:InstallingSoftware|ગુજરાતી| [[::InstallingSoftware/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/he | • {{#if: UbuntuHelp:InstallingSoftware|עברית| [[::InstallingSoftware/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/hu | • {{#if: UbuntuHelp:InstallingSoftware|magyar| [[::InstallingSoftware/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/id | • {{#if: UbuntuHelp:InstallingSoftware|Bahasa Indonesia| [[::InstallingSoftware/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/it | • {{#if: UbuntuHelp:InstallingSoftware|italiano| [[::InstallingSoftware/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/ja | • {{#if: UbuntuHelp:InstallingSoftware|日本語| [[::InstallingSoftware/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/ko | • {{#if: UbuntuHelp:InstallingSoftware|한국어| [[::InstallingSoftware/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/ksh | • {{#if: UbuntuHelp:InstallingSoftware|Ripoarisch| [[::InstallingSoftware/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/mr | • {{#if: UbuntuHelp:InstallingSoftware|मराठी| [[::InstallingSoftware/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/ms | • {{#if: UbuntuHelp:InstallingSoftware|Bahasa Melayu| [[::InstallingSoftware/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/nl | • {{#if: UbuntuHelp:InstallingSoftware|Nederlands| [[::InstallingSoftware/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/no | • {{#if: UbuntuHelp:InstallingSoftware|norsk| [[::InstallingSoftware/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/oc | • {{#if: UbuntuHelp:InstallingSoftware|occitan| [[::InstallingSoftware/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/pl | • {{#if: UbuntuHelp:InstallingSoftware|polski| [[::InstallingSoftware/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/pt | • {{#if: UbuntuHelp:InstallingSoftware|português| [[::InstallingSoftware/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/ro | • {{#if: UbuntuHelp:InstallingSoftware|română| [[::InstallingSoftware/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/ru | • {{#if: UbuntuHelp:InstallingSoftware|русский| [[::InstallingSoftware/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/si | • {{#if: UbuntuHelp:InstallingSoftware|සිංහල| [[::InstallingSoftware/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/sq | • {{#if: UbuntuHelp:InstallingSoftware|shqip| [[::InstallingSoftware/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/sr | • {{#if: UbuntuHelp:InstallingSoftware|српски / srpski| [[::InstallingSoftware/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/sv | • {{#if: UbuntuHelp:InstallingSoftware|svenska| [[::InstallingSoftware/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/th | • {{#if: UbuntuHelp:InstallingSoftware|ไทย| [[::InstallingSoftware/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/tr | • {{#if: UbuntuHelp:InstallingSoftware|Türkçe| [[::InstallingSoftware/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/vi | • {{#if: UbuntuHelp:InstallingSoftware|Tiếng Việt| [[::InstallingSoftware/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/yue | • {{#if: UbuntuHelp:InstallingSoftware|粵語| [[::InstallingSoftware/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/zh | • {{#if: UbuntuHelp:InstallingSoftware|中文| [[::InstallingSoftware/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/zh-hans | • {{#if: UbuntuHelp:InstallingSoftware|中文(简体)| [[::InstallingSoftware/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:InstallingSoftware | UbuntuHelp:InstallingSoftware | {{#if: | :}}InstallingSoftware}}/zh-hant | • {{#if: UbuntuHelp:InstallingSoftware|中文(繁體)| [[::InstallingSoftware/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:InstallingSoftware|:InstallingSoftware|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :InstallingSoftware/zh | | {{#ifexist: InstallingSoftware/zh | | {{#ifeq: {{#titleparts:InstallingSoftware|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:InstallingSoftware|1|-1|}} | zh | | }}
Introduction
Installing software in Ubuntu is easy, and this guide will show you how to do it. By default, many useful programs are already installed when you put Ubuntu onto your computer. However, you may need a particular piece of software that serves a purpose not served by the default applications. You might just want to try an alternative program to one which is already installed. In other words, you need new software. If you'd like to get some background information on what's happening when you install software (which can sometimes be technical), 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.
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 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 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).
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 translating or compiling it into binary, which computers can understand.
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).
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.
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 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.
An example of dependencies
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.
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. 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. 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.
Installing a Package
This section explains how to install packages using the various tools available in Ubuntu and Kubuntu.
Ubuntu
- Ubuntu 6.06 LTS (Dapper Drake)
- Ubuntu 6.10 (Edgy Eft)
- Ubuntu 7.04 (Feisty Fawn)
- Ubuntu 7.10 (Gutsy Gibbon)
Add/Remove - the basic method
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. If you have trouble finding the package you want at first, you may want to change the "Show" option to the right of the search field to include more locations to search. 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 - 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, see UbuntuHelp:SynapticHowto.
Kubuntu
- Kubuntu 6.06 LTS (Dapper Drake)
- Kubuntu 6.10 (Edgy Eft)
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. 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 UbuntuHelp:Repositories page. Once this has finished, click Close.Your new programs are installed, ready to use!
Adept - the more advanced method
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, see AdeptHowto.
Text Based Methods
Text based methods can be used across Ubuntu, Kubuntu and Xubuntu, but require familiarity with the terminal.
Aptitude - the text-based method
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 technical method
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]]. Anchor(deb)
Installing downloaded packages
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.
Using GDebi to install packages
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:
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.
Using dpkg to install packages
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
.
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. Keeping up to date is important, as security fixes which protect your computer from harm are delivered in this way.
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. 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.