arch 还原pacman
Using the Arch Linux Package Manager (pacman
) is the easiest way to install Go. Based on the Arch Linux philosophy of providing new software versions very fast, you will get a very current version of Go.
使用Arch Linux软件包管理器( pacman
)是安装Go的最简单方法。 基于Arch Linux的理念,即快速提供新软件版本,您将获得最新版本的Go。
Before you can install the Go package, you have to bring the system and all of your installed packages up to date. However, before updating your system and its packages, remember to check the Arch Linux home page first. Any out-of-the-ordinary steps that you have to do to prevent packages from breaking will be listed in a post there.
在安装Go软件包之前,您必须先更新系统以及所有已安装的软件包。 但是,在更新系统及其软件包之前,请记住首先检查Arch Linux主页 。 您为防止软件包损坏而必须采取的任何非常规步骤都将在此处的帖子中列出。
Once you've confirmed that it's safe to update your system, just run the following command:
确认可以安全更新系统后,只需运行以下命令:
$ sudo pacman -Syu
Remember that the -S
flag is used to install a single package or a list of packages, the y
option refreshes the list of all Arch Linux packages, and the option u
upgrades all packages that are out of date.
请记住, -S
标志用于安装单个软件包或软件包列表, y
选项刷新所有Arch Linux软件包的列表,选项u
升级所有已过期的软件包。
After your system is completely up to date, install Go with the following command:
系统完全更新之后,请使用以下命令安装Go:
$ sudo pacman -S go
检查Go的安装和版本 (Check the installation and version of Go)
To check if Go was successfully installed, run:
要检查Go是否已成功安装,请运行:
$ go version
> go version go1.13.8 linux/amd64
This will print the installed version of Go to the console, while at the same time making sure the installation went smoothly.
这将打印转到控制台的已安装版本,同时确保安装顺利进行。
有关Go的更多信息: (More info about Go:)
Learn Go in this free video course
How to build a photo feed with Go and Vue.js
有关Arch Linux的更多信息: (More info about Arch Linux:)
How to install Arch Linux from scratch
奖励:如何在Ubuntu / Linux Mint上安装Go: (Bonus: How to Install Go on Ubuntu / Linux Mint:)
Using Ubuntu’s Source Package Manager (apt
) is the easiest way to install Go. While Arch Linux's pacman
is on the bleeding edge, packages installed using apt
and its variants are often several versions behind.
使用Ubuntu的Source Package Manager( apt
)是安装Go的最简单方法。 虽然Arch Linux的pacman
处于最前沿,但使用apt
及其变体安装的软件包通常落后几个版本。
The benefit of this approach is stability – while you won't be able to install the latest and greatest version of any package, you can be certain that your system won't break.
这种方法的好处是稳定性–虽然您将无法安装任何软件包的最新和最高版本,但是可以确定系统不会中断。
First, update your system with the following commands:
首先,使用以下命令更新系统:
$ sudo apt update
$ sudo apt upgrade
Then install Go by running:
然后运行以下命令安装Go:
$ sudo apt install golang-go
检查Go的安装和版本 (Check the installation and version of Go)
To check if Go was successfully installed, open your terminal and run:
要检查Go是否已成功安装,请打开您的终端并运行:
$ go version
This will print the installed version of Go to the console.
这将打印转到控制台的已安装版本。
奖励:如何在macOS上安装Go: (Bonus: How to Install Go on macOS:)
使用Package Installer在Mac OS X中安装Go (Installing Go in Mac OS X using Package Installer)
From the golang’s download page, get the Mac package installer (ending in .pkg) and run it.
在golang的下载页面上 ,获取Mac软件包安装程序(以.pkg结尾)并运行它。
检查Go的安装和版本 (Check the installation and version of Go)
To check if Go was successfully installed, open your terminal and run:
要检查Go是否已成功安装,请打开您的终端并运行:
$ go version
This will print the installed version of Go to the console.
这将打印转到控制台的已安装版本。
使用tarball在Mac OS X中安装Go (Installing Go in Mac OS X using tarball)
You can get the link to the Mac OS tarball archive from the Latest Stable section of the golang download page.
您可以从golang下载页面的“最新稳定”部分获得指向Mac OS tarball存档的链接。
安装过程 (Installation Process)
In this installation process we’ll use the latest stable version as of this writing (Go 1.9.1). For a newer or older version simply replace the link in the first step. Check the golang download page to see what versions are currently available.
在此安装过程中,我们将使用撰写本文时的最新稳定版本(Go 1.9.1)。 对于较新或较旧的版本,只需在第一步中替换链接即可。 检查golang下载页面以查看当前可用的版本。
安装Go 1.9.1 (Installing Go 1.9.1)
$ curl -O https://storage.googleapis.com/golang/go1.9.1.darwin-amd64.tar.gz
$ sudo tar -C /usr/local -xzf go1.9.1.darwin-amd64.tar.gz
$ export PATH=$PATH:/usr/local/go/bin
检查go的安装和版本 (Check installation and version of go)
To check if Go was successfully installed, use:
要检查Go是否已成功安装,请使用:
$ go version
This will print the installed version of Go to the console.
这将打印转到控制台的已安装版本。
翻译自: https://www.freecodecamp.org/news/how-to-install-go-in-arch-linux-using-pacman/
arch 还原pacman