Merge pull request #9241 from MjSeven/master

20180320 Migrating to Linux- Installing Software.md 翻译完毕
This commit is contained in:
MjSeven 2018-06-22 23:29:48 +08:00 committed by GitHub
commit 07d3be22af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 85 additions and 84 deletions

View File

@ -1,84 +0,0 @@
Translating by MjSeven
Migrating to Linux: Installing Software
======
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/birds-1835510_1920.jpg?itok=8i6mBStG)
With all the attention you are seeing on Linux and its use on the Internet and in devices like Arduino, Beagle, and Raspberry Pi boards and more, perhaps you are thinking it's time to try it out. This series will help you successfully make the transition to Linux. If you missed the earlier articles in the series, you can find them here:
[Part 1 - An Introduction][1]
[Part 2 - Disks, Files, and Filesystems][2]
[Part 3 - Graphical Environments][3]
[Part 4 - The Command Line][4]
[Part 5 - Using sudo][5]
### Installing software
To get new software on your computer, the typical approach used to be to get a software product from a vendor and then run an install program. The software product, in the past, would come on physical media like a CD-ROM or DVD. Now we often download the software product from the Internet instead.
With Linux, software is installed more like it is on your smartphone. Just like going to your phone's app store, on Linux there is a central repository of open source software tools and programs. Just about any program you might want will be in a list of available packages that you can install.
There isn't a separate install program that you run for each program. Instead you use the package management tools that come with your distribution of Linux. (Remember a Linux distribution is the Linux you install such as Ubuntu, Fedora, Debian, etc.) Each distribution has its own centralized place on the Internet (called a repository) where they store thousands of pre-built applications for you to install.
You may note that there are a few exceptions to how software is installed on Linux. Sometimes, you will still need to go to a vendor to get their software as the program doesn't exist in your distribution's central repository. This typically is the case when the software isn't open source and/or not free.
Also keep in mind that if you end up wanting to install a program that is not in your distribution's repositories, things aren't so simple, even if you are installing free and open source programs. This post doesn't get into these more complicated scenarios, and it's best to follow online directions.
With all the Linux packaging systems and tools out there, it may be confusing to know what's going on. This article should help clear up a few things.
### Package Managers
Several packaging systems to manage, install, and remove software compete for use in Linux distributions. The folks behind each distribution choose a package management system to use. Red Hat, Fedora, CentOS, Scientific Linux, SUSE, and others use the Red Hat Package Manager (RPM). Debian, Ubuntu, Linux Mint, and more use the Debian package system, or DPKG for short. Other package systems exist as well, while RPM and DPKG are the most common.
![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/package-installer.png?itok=V9OU1Q0u)
Regardless of the package manager you are using, they typically come with a set of tools that are layered on top of one another (Figure 1). At the lowest level is a command-line tool that lets you do anything and everything related to installed software. You can list installed programs, remove programs, install package files, and more.
This low-level tool isn't always the most convenient to use, so typically there is a command line tool that will find the package in the distribution's central repositories and download and install it along with any dependencies using a single command. Finally, there is usually a graphical application that lets you select what you want with a mouse and click an 'install'' button.
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/package-kit.png?itok=YimOq2Je)
For Red Hat based distributions, which includes Fedora, CentOS, Scientific Linux, and more, the low-level tool is rpm. The high-level tool is called dnf (or yum on older systems). And the graphical installer is called PackageKit (Figure 2) and may appear as "Add/Remove Software" under System Administration.
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ubuntu-software.png?itok=5QSctLEW)
For Debian based distributions, which includes Debian, Ubuntu, Linux Mint, Elementary OS, and more, the low-level, command-line tool is dpkg. The high-level tool is called apt. The graphical tool to manage installed software on Ubuntu is Ubuntu Software (Figure 3). For Debian and Linux Mint, the graphical tool is called Synaptic, which can also be installed on Ubuntu.
You can also install a text-based graphical tool on Debian related distributions called aptitude. It is more powerful than Synaptic, and works even if you only have access to the command line. You can try that one if you want access to all the bells and whistles, though with more options, it is more complicated to use than Synaptic. Other distributions may have their own unique tools.
### Command Line
Online instructions for installing software on Linux usually describe commands to type in the command line. The instructions are usually easier to understand and can be followed without making a mistake by copying and pasting the command into your command line window. This is opposed to following instructions like, "open this menu, select this program, enter in this search pattern, click this tab, select this program, and click this button," which often get lost in translation.
Sometimes the Linux installation you are using doesn't have a graphical environment, so it's good to be familiar with installing software packages from the command line. Tables 1 and 2 a few common operations and their associated commands for both RPM and DPKG based systems.
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/table_1_0.png?itok=hQ_o5Oh2)
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/table_2.png?itok=yl3UPQDw)
Note that SUSE, which uses RPM like Redhat and Fedora, doesn't have dnf or yum. Instead, it uses a program called zypper for the high-level, command-line tool. Other distributions may have different tools as well, such as, pacman on Arch Linux or emerge on Gentoo. There are many package tools out there, so you may need to look up what works on your distribution.
These tips should give you a much better idea on how to install programs on your new Linux installation and a better idea how the various package methods on your Linux installation relate to one another.
Learn more about Linux through the free ["Introduction to Linux"][6]course from The Linux Foundation and edX.
--------------------------------------------------------------------------------
via: https://www.linux.com/blog/learn/2018/3/migrating-linux-installing-software
作者:[JOHN BONESIO][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.linux.com/users/johnbonesio
[1]:https://www.linux.com/blog/learn/intro-to-linux/2017/10/migrating-linux-introduction
[2]:https://www.linux.com/blog/learn/intro-to-linux/2017/11/migrating-linux-disks-files-and-filesystems
[3]:https://www.linux.com/blog/learn/2017/12/migrating-linux-graphical-environments
[4]:https://www.linux.com/blog/learn/2018/1/migrating-linux-command-line
[5]:https://www.linux.com/blog/learn/2018/3/migrating-linux-using-sudo
[6]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux

View File

@ -0,0 +1,85 @@
迁移到 Linux 之安装软件
=====
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/birds-1835510_1920.jpg?itok=8i6mBStG)
你看到的所有有关 Linux 的关注,以及它在互联网,以及 Arduino, Beagle 和 Raspberry Pi boards树莓派板等设备上的使用或许你正在考虑是时候尝试一下 Linux 了。本系列将帮助你成功过渡到 Linux。如果你错过了本系列的早期文章可以在这里找到它们
[Part 1 - 介绍][1]
[Part 2 - 磁盘、文件和文件系统][2]
[Part 3 - 图形界面][3]
[Part 4 - 命令行][4]
[Part 5 - 使用 sudo][5]
### 安装软件
要在你的计算机上获得新软件,通常的方法是从供应商处获得软件产品,然后运行一个安装程序。过去,软件产品会像 CD-ROM 或 DVD 一样出现在物理媒介上。而现在我们经常从网上下载软件产品。
使用 Linux安装软件就像在你的智能手机上安装一样。就像去你的手机应用商店一样在 Linux 上有个开源软件工具和程序的中央仓库,几乎任何你可能想要的程序都会在你可安装的可用软件包列表中。
没有为每个程序运行的单独安装程序。相反,你可以使用 Linux 发行版附带的软件包管理工具。请记住Linux 发行版是你安装的 Linux例如 Ubuntu, Fedora, Debian 等)每个发行版在 Internet 上都有自己的集中位置(称为仓库),用于存储数千个预先安装的应用程序。
你可能会注意到,在 Linux 上安装软件有几个例外。有时候,你仍然需要去供应商处获取他们的软件,因为该程序不存在于你发行版的中央仓库中。当软件不是开源和/或免费(自由)的时候,通常就是这种情况。
另外请记住,如果你最终想要安装一个不在发行版仓库中的程序,事情就不是那么简单了,即使你正在安装免费(自由)和开源程序。这篇文章没有涉及到这些更复杂的情况,最好遵循在线引导。
有了所有的 Linux 包管理系统和工具,接下来干什么可能仍然令人困惑。本文应该有助于澄清一些事情。
### 包管理
一些用于管理、安装和删除软件的包管理系统在 Linux 发行版中竞争。那个发行版背后的人都选择一个包管理系统来使用。Red Hat, Fedora, CentOS, Scientific Linux, SUSE 等使用 Red Hat 包管理RPM。Debian, Ubuntu, Linux Mint 等等都使用 Debian 包管理系统,简称 DPKG。其他包管理系统也存在但 RPM 和 DPKG 是最常见的。
![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/package-installer.png?itok=V9OU1Q0u)
图 1: Package installers
无论你使用的软件包管理是什么,它们通常都附带一组工具,它们是分层的(图 1。最底层是一个命令行工具它可以让你做任何事情以及与安装软件相关的一切。你可以列出已安装的程序删除程序安装软件包文件等等。
这个底层工具并不总是最方便使用的,所以通常会有一个命令行工具,它可以在发行版的中央仓库中找到软件包,并使用单个命令下载和安装它以及任何依赖项。最后,通常会有一个图形应用程序,让你使用鼠标选择任何想要的内容,然后单击 “install” 按钮。
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/package-kit.png?itok=YimOq2Je)
图 2: PackageKit
对于基于 Red Hat 的发行版,包括 Fedora, CentOS, Scientific Linux 等。它们的底层工具是 rpm高级工具叫做 dnf在旧系统上是 yum。图形安装程序称为 PackageKit图 2它可能在系统管理下显示为 “Add/Remove Software添加/删除软件)”。
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ubuntu-software.png?itok=5QSctLEW)
图 3: Ubuntu Software
对于基于 Debian 的发行版,包括 Debian, Ubuntu, Linux Mint, Elementary OS 等。它们的底层命令行工具是 dpkg高级工具称为 apt。在 Ubuntu 上管理已安装软件的图形工具是 Ubuntu Software图 3。对于 Debian 和 Linux Mint图形工具称为 Synaptic它也可以安装在 Ubuntu 上。
你也可以在 Debian 相关发行版上安装基于文本的图形工具 aptitude。它比 Synaptic新立得更强大并且即使你只能访问命令行也能工作。如果你想获得所有花里胡哨的东西to 校正者:这句话仔细考虑一下)你可以试试那个,尽管有更多的选择,但使用起来比 Synaptic新立得更复杂。其他发行版可能有自己独特的工具。
### 命令行工具
在 Linux 上安装软件的在线说明通常描述在命令行中键入的命令。这些指令通常更容易理解,并且可以在不出错的情况下,将命令复制粘贴到命令行窗口中。这与下面的说明相反:“打开这个菜单,选择这个程序,输入这个搜索模式,点击这个标签,选择这个程序,然后点击这个按钮”,这经常在翻译中丢失。
有时你正在使用的 Linux 没有图形环境,因此熟悉从命令行安装软件包是件好事。表 1 和表 2 列出了基于 RPM 和 DPKG 系统的一下常见操作及其相关命令。
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/table_1_0.png?itok=hQ_o5Oh2)
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/table_2.png?itok=yl3UPQDw)
请注意 SUSE它像 RedHat 和 Fedora 一样使用 RPM却没有 dnf 或 yum。相反它使用一个名为 zypper 的程序作为高级命令行工具。其他发行版也可能有不同的工具,例如 Arch Linux 上的 pacman 或 Gentoo 上的 emerge。有很多包工具所以你可能需要查找哪个适用于你的发行版。
这些技巧应该能让你更好地了解如何在新的 Linux 中安装程序,以及更好地了解 Linux 中各种软件包方法如何相互关联。
通过 Linux 基金会和 edX 的免费 [“Linux 入门”][6]课程了解有关 Linux 的更多信息。
--------------------------------------------------------------------------------
via: https://www.linux.com/blog/learn/2018/3/migrating-linux-installing-software
作者:[JOHN BONESIO][a]
译者:[MjSeven](https://github.com/MjSeven)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.linux.com/users/johnbonesio
[1]:https://www.linux.com/blog/learn/intro-to-linux/2017/10/migrating-linux-introduction
[2]:https://www.linux.com/blog/learn/intro-to-linux/2017/11/migrating-linux-disks-files-and-filesystems
[3]:https://www.linux.com/blog/learn/2017/12/migrating-linux-graphical-environments
[4]:https://www.linux.com/blog/learn/2018/1/migrating-linux-command-line
[5]:https://www.linux.com/blog/learn/2018/3/migrating-linux-using-sudo
[6]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux