Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zh-cn: update Debian/Ubuntu/RHEL section #1856

Merged
merged 1 commit into from
Oct 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
186 changes: 3 additions & 183 deletions locale/zh-cn/download/package-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ title: 通过包管理器安装 Node.js

* [Android](#android)
* [Arch Linux](#arch-linux)
* [基于 Linux 的 Debian 和 Ubuntu 发行版](#debian-and-ubuntu-based-linux-distributions)
* [Enterprise Linux 和 Fedora](#enterprise-linux-and-fedora)
* [基于 Linux 的 Debian 和 Ubuntu 发行版, Enterprise Linux/Fedora 和 Snap packages](#debian-and-ubuntu-based-linux-distributions-enterprise-linux-fedora-and-snap-packages)
* [FreeBSD](#freebsd)
* [Gentoo](#gentoo)
* [NetBSD](#netbsd)
Expand Down Expand Up @@ -48,188 +47,9 @@ Node.js 以及 npm 包管理器在社区库中可如下方式使用:
pacman -S nodejs npm
```

## 基于Linux 发布的 Debian 和 Ubuntu 系统
## 基于 Linux 的 Debian 和 Ubuntu 发行版, Enterprise Linux/Fedora 和 Snap packages

同时包括 **Linux Mint**, **Linux Mint Debian Edition (LMDE)**, **elementaryOS**, **bash on Windows** 和其它系统等。

你同时也可以从 [NodeSource](https://nodesource.com) 获取 Debian 和 Ubuntu 的 Node.js 二进制分发库(在此之前则是通过 [Chris Lea's](https://github.com/chrislea) Launchpad PPA)。
有关于这些库和脚本代码方面的分发支持,你可以在 [nodesource/distributions](https://github.com/nodesource/distributions) 找到相关信息。

**注意:** 如果你在使用 Ubuntu Precise 或 Debian Wheezy 系统,你可能需要阅读相关信息:[在更古老的发行版系统上运行大于 6.0 版的 Nodejs](https://github.com/nodesource/distributions/blob/master/OLDER_DISTROS.md)。

```bash
wget -qO- https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
```

而在 Node.js 10 版本中:

```bash
wget -qO- https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
```

***可选***:安装构建工具

为构建和安装本地化的 npm 插件,你或许需要安装构建工具:

```bash
sudo apt-get install -y build-essential
```

**支持的架构:**

* **i386** (32 位)
* **amd64** (64 位)
* **armhf** (ARM 32 位 hard-float, ARMv7 和以上的 _arm-linux-gnueabihf_)

**Ubuntu 中支持的版本:**

* **Ubuntu 14.04 LTS** (Trusty Tahr)
* **Ubuntu 16.04 LTS** (Xenial Xerus)

**Debian 中支持的版本:**

* **Debian 8** (Jessie,上一个稳定版)
* **Debian 9 / stable** (当前稳定版)
* **Debian testing** (目前仍在测试的下一个稳定版)
* **Debian unstable** (依然在不断迭代的测试版)

您也可以在 [官网发布版](http://packages.debian.org/search?searchon=names&keywords=nodejs) 获取针对 Debian Sid(非稳定版)、Jessie(测试版)和 Wheezy (wheezy补丁版) 的 Nodejs 程序包。它仅仅安装一个 `nodejs` 二进制程序包。

[nodejs-legacy 程序包](http://packages.debian.org/search?searchon=names&keywords=nodejs-legacy) 安装一个被许多模块使用、并使它们能够正常构建和运行的 `node` 符号链接。
注:官方发布的 Node.js 模块库并不需要此链接。

**Linux Mint 中支持的版本:**

* **Linux Mint 17 "Qiana"** (基于 Ubuntu 14.04 LTS)
* **Linux Mint 17.1 "Rebecca"** (基于 Ubuntu 14.04 LTS)
* **Linux Mint 17.2 "Rafaela"** (基于 Ubuntu 14.04 LTS)
* **Linux Mint Debian Edition (LMDE) 2 "Betsy"** (基于 Debian 8)

**OS 中支持的版本:**

* **elementary OS Luna** (基于 Ubuntu 12.04 LTS)
* **elementary OS Freya** (基于 Ubuntu 14.04 LTS)
* **elementary OS Loki** (基于 Ubuntu 16.04 LTS)
* **elementary OS Juno** (基于 Ubuntu 18.04 LTS)

**Trisquel 中支持的版本:**

* **Trisquel 7 "Belenos"** (基于 Ubuntu 14.04 LTS)

**BOSS 中支持的版本:**

* **BOSS 5.0 "Anokha"** (基于 Debian 7)

## Enterprise Linux 和 Fedora

包含 **Red Hat® Enterprise Linux®** / **RHEL**, **CentOS** 以及 **Fedora**。

你可以在 [NodeSource](https://nodesource.com) 获得企业版的 Linux 和 Fedora 版的程序分发包。
并且你可在 [nodesource/distributions](https://github.com/nodesource/distributions) 获取相关信息。

注意: 针对于 EL 5 (RHEL5 和 CentOS 5) 的 Nodejs 程序包依赖于 **[EPEL](https://fedoraproject.org/wiki/EPEL)** 库是否可用, 安装程序将检测是否安装此依赖库并提供相关信息。

对于 RHEL, CentOS or Fedora 系统,Node.js v8 LTS版本命令:

```bash
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
```

而 Node.js 10 的命令:

```bash
curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash -
```

然后安装:

```bash
sudo yum -y install nodejs
```

***可选:***: 安装构建工具

为构建和安装本地化的 npm 插件,你或许需要安装构建工具:

```bash
sudo yum install gcc-c++ make
# or: sudo yum groupinstall 'Development Tools'
```

**支持的架构:**

* **i386** (32 位, EL7不支持)
* **x86_64** (64 位)

**Red Hat® Enterprise Linux® 中支持的版本:**

* **RHEL 5** (32 位以及 64 位)
* **RHEL 6** (32 位以及 64 位)
* **RHEL 7** (64 位)

**CentOS 中支持的版本:**

* **CentOS 5** (32 位以及 64 位)
* **CentOS 6** (32 位以及 64 位)
* **CentOS 7** (64 位)

**CloudLinux 中支持的版本:**
* **CloudLinux 6** (32 位以及 64 位)

**Fedora 中支持的版本:**

* **Fedora 21 (Twenty One)** (32 位以及 64 位)
* **Fedora 20 (Heisenbug)** (32 位以及 64 位)
* **Fedora 19 (Schrödinger's Cat)** (32 位以及 64 位)

**其余支持的系统:**

* **Oracle Linux** (非常接近于 RHEL 镜像)
* **Amazon Linux** (于 2016.03 测试完毕)

### 可替代方案

在 Fedora 18 以及后继版本中,你可以通过 [Node.js](https://apps.fedoraproject.org/packages/nodejs) 和 [npm](https://apps.fedoraproject.org/packages/npm) 获取官方正式 Nodejs 安装包。用以下命令安装:

```bash
sudo dnf install nodejs
```

急于获取最新版本?[用于更新测试](https://fedoraproject.org/wiki/QA:Updates_Testing)

**Enterprise Linux** (RHEL 和 CentOS) 的用户可以通过 [EPEL](https://fedoraproject.org/wiki/EPEL) 获得 Node.js 和 npm 程序管理包,并且使用。

针对你的版本安装最合适的 *epel 发布版* (在 [EPEL](https://fedoraproject.org/wiki/EPEL) 的库首页面上),随后运行:

```bash
sudo yum install nodejs npm --enablerepo=epel
```

急于获取最新版本?[用于 epel 测试](https://fedoraproject.org/wiki/EPEL/testing)

**支持架构:**

* **i686** (32 位,EL7不支持)
* **x86_64** (64 位)
* **armv6hl** (Raspberry Pi,仅是 [Pidora](http://pidora.ca))
* **armv7hl** (32 位 ARM hard-float, ARMv7 以及后续版本,仅Fedora)

**Red Hat® Enterprise Linux® 中支持的版本:**

* **RHEL 6** (i686/x86_64)
* **RHEL 7** (aarch64/x86_64)

RHEL 6 在 EPEL 中已经不被支持,但你可以使用 [Red Hat Software Collections](https://www.softwarecollections.org/en/scls/?search=nodejs) 取代。

除此之外,和以上 RHEL 版本相当的 **CentOS** 和 **Scientific Linux** 系统同样被所有的 EHEL 包支持,包括 nodejs。 因为之前在 epel-devel 中邮件列表中的报告说 Amazon Linux 有巨大的兼容性差异,所以此系统不被官方 EPEL 正式支持,但 Nodejs 仍然可以正常运行。

**Fedora 中支持版本:**

* **Fedora Rawhide** (i686/x86_64/armv7hl/aarch64/ppc64/ppc64le/s390x)
* **Fedora 27** (i686/x86_64/armv7hl/aarch64/ppc64/ppc64le/s390x)
* **Fedora 26** (i686/x86_64/armv7hl/aarch64/ppc64/ppc64le)
[Node.js 官方二进制发行版](https://github.com/nodesource/distributions/blob/master/README.md) 由 NodeSource 提供。

## FreeBSD

Expand Down