Installation - 安装
https://gohugo.io/installation/
在macOS、Linux、Windows、BSD上,以及任何可以运行Go编译器工具链的机器上都可以安装Hugo。
https://gohugo.io/installation/
在macOS、Linux、Windows、BSD上,以及任何可以运行Go编译器工具链的机器上都可以安装Hugo。
https://gohugo.io/installation/macos/
Install Hugo on macOS.
Hugo is available in two editions: standard and extended. With the extended edition you can:
We recommend that you install the extended edition.
Although not required in all cases, Git and Go are often used when working with Hugo.
Git is required to:
Go is required to:
Please refer to the Git and Go documentation for installation instructions.
Prebuilt binaries are available for a variety of operating systems and architectures. Visit the latest release page, and scroll down to the Assets section.
Please consult your operating system documentation if you need help setting file permissions or modifying your PATH environment variable.
If you do not see a prebuilt binary for the desired edition, operating system, and architecture, install Hugo using one of the methods described below.
Homebrew is a free and open source package manager for macOS and Linux. This will install the extended edition of Hugo:
|
|
MacPorts is a free and open source package manager for macOS. This will install the extended edition of Hugo:
|
|
Erlend Klakegg Bergheim graciously maintains Docker images based on images for Alpine Linux, Busybox, Debian, and Ubuntu.
|
|
To build Hugo from source you must:
The install directory is controlled by the GOPATH and GOBIN environment variables. If GOBIN is set, binaries are installed to that directory. If GOPATH is set, binaries are installed to the bin subdirectory of the first directory in the GOPATH list. Otherwise, binaries are installed to the bin subdirectory of the default GOPATH ($HOME/go or %USERPROFILE%\go).
Then build and test:
|
|
Prebuilt binaries | Package managers | Docker | Build from source | ||
---|---|---|---|---|---|
Easy to install? | ✔️ | ✔️ | ✔️ | ✔️ | |
Easy to upgrade? | ✔️ | ✔️ | ✔️ | ✔️ | |
Easy to downgrade? | ✔️ | ✔️ 1 | ✔️ | ✔️ | |
Automatic updates? | ❌ | ❌ 2 | ❌ 2 | ❌ | |
Latest version available? | ✔️ | ✔️ | ✔️ | ✔️ |
https://gohugo.io/installation/linux/
在Linux上安装Hugo。
Hugo有两个版本:标准版和扩展版。使用扩展版可以:
我们建议您安装扩展版。
虽然并非所有情况下都需要,但在使用Hugo时通常使用Git和Go。
需要Git的情况:
需要Go的情况:
预构建的二进制文件可用于各种操作系统和架构。访问最新版本页面,然后向下滚动到Assets 部分。
如果需要帮助设置文件权限或修改PATH环境变量,请参考操作系统文档。
如果您没有看到所需版本、操作系统和架构的预构建二进制文件,请使用以下方法之一安装Hugo。
Snap是Linux的免费开源软件包管理器。Snap包适用于大多数发行版,易于安装并且会自动更新。
Hugo snap包是严格隔离的。严格隔离的snap运行在完全隔离的环境中,最小访问级别被认为是始终安全的。您创建和构建的站点必须位于您的主目录内或可移动媒体上。
这将安装Hugo的扩展版:
|
|
Homebrew是macOS和Linux的免费开源软件包管理器。这将安装Hugo的扩展版:
|
|
大多数Linux发行版都维护着一个通用安装应用程序的软件仓库。请注意,这些仓库可能不包含最新版本。
基于Arch Linux的Linux发行版包括EndeavourOS,Garuda Linux,Manjaro等。这将安装Hugo的扩展版:
|
|
基于Debian的Linux发行版包括elementary OS,KDE neon,Linux Lite,Linux Mint,MX Linux,Pop!_OS,Ubuntu,Zorin OS等。这将安装Hugo的扩展版:
|
|
您也可以从最新版本页面下载Debian包。
基于Fedora的Linux发行版包括CentOS,Red Hat Enterprise Linux等。这将安装Hugo的扩展版:
|
|
基于openSUSE的Linux发行版包括GeckoLinux,Linux Karmada等。这将安装Hugo的扩展版:
|
|
Solus的Linux发行版在其包存储库中包含Hugo。这将安装Hugo的标准版:
|
|
Erlend Klakegg Bergheim慷慨地维护了基于Alpine Linux、Busybox、Debian和Ubuntu的Docker images。
|
|
要从源代码构建Hugo,您必须:
安装目录由GOPATH和GOBIN环境变量控制。如果设置了GOBIN,那么二进制文件将安装到该目录中。如果设置了GOPATH,则二进制文件将安装到GOPATH列表中第一个目录的bin子目录中。否则,二进制文件将安装到默认GOPATH的bin子目录(
$HOME/go
或%USERPROFILE%\go
)。
然后构建和测试:
|
|
Prebuilt binaries | Package managers | Repository packages | Docker | Build from source | |
---|---|---|---|---|---|
Easy to install? | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
Easy to upgrade? | ✔️ | ✔️ | varies | ✔️ | ✔️ |
Easy to downgrade? | ✔️ | ✔️ 1 | varies | ✔️ | ✔️ |
Automatic updates? | ❌ | varies 2 | ❌ | ❌ 3 | ❌ |
Latest version available? | ✔️ | ✔️ | varies | ✔️ | ✔️ |
https://gohugo.io/installation/windows/
在 Windows 上安装 Hugo。
Hugo 有两个版本:标准版和扩展版。使用扩展版,您可以:
我们建议您安装扩展版。
虽然在某些情况下不是必需的,但在使用 Hugo 时经常使用 Git 和 Go。
需要Git的情况:
需要Go的情况:
预构建的二进制文件可用于各种操作系统和架构。访问最新版本页面,然后向下滚动到Assets 部分。
如果需要帮助设置文件权限或修改PATH环境变量,请参考操作系统文档。
如果您没有看到所需版本、操作系统和架构的预构建二进制文件,请使用以下方法之一安装Hugo。
Chocolatey是 Windows 的一个免费开源软件包管理器。这将安装 Hugo 的扩展版:
|
|
Scoop是 Windows 的一个免费开源软件包管理器。这将安装 Hugo 的扩展版:
|
|
Winget是微软的官方免费开源软件包管理器。这将安装 Hugo 的扩展版:
|
|
Erlend Klakegg Bergheim 慷慨地维护基于 Alpine Linux、Busybox、Debian 和 Ubuntu 的 Docker 映像。
|
|
要从源代码构建 Hugo,您必须:
安装目录由GOPATH和GOBIN环境变量控制。如果设置了GOBIN,则二进制文件将安装到该目录。如果设置了GOPATH,则二进制文件将安装到GOPATH列表中第一个目录的bin子目录中。否则,二进制文件将安装到默认的GOPATH的bin子目录中(
$HOME/go
或%USERPROFILE%\go
)。
然后进行构建和测试:
|
|
在Windows上构建Hugo的扩展版时,还需要安装GCC编译器。请参考这些详细的说明。
Prebuilt binaries | Package managers | Docker | Build from source | ||
---|---|---|---|---|---|
Easy to install? | ✔️ | ✔️ | ✔️ | ✔️ | |
Easy to upgrade? | ✔️ | ✔️ | ✔️ | ✔️ | |
Easy to downgrade? | ✔️ | ✔️ 1 | ✔️ | ✔️ | |
Automatic updates? | ❌ | ❌ 2 | ❌ 2 | ❌ | |
Latest version available? | ✔️ | ✔️ | ✔️ | ✔️ |
https://gohugo.io/installation/bsd/
Install Hugo on BSD derivatives.
Hugo is available in two editions: standard and extended. With the extended edition you can:
We recommend that you install the extended edition.
Although not required in all cases, Git and Go are often used when working with Hugo.
Git is required to:
Go is required to:
Please refer to the Git and Go documentation for installation instructions.
Prebuilt binaries are available for a variety of operating systems and architectures. Visit the latest release page, and scroll down to the Assets section.
Please consult your operating system documentation if you need help setting file permissions or modifying your PATH environment variable.
If you do not see a prebuilt binary for the desired edition, operating system, and architecture, install Hugo using one of the methods described below.
Most BSD derivatives maintain a repository for commonly installed applications. Please note that these repositories may not contain the latest release.
DragonFly BSD includes Hugo in its package repository. This will install the extended edition of Hugo:
|
|
FreeBSD includes Hugo in its package repository. This will install the extended edition of Hugo:
|
|
NetBSD includes Hugo in its package repository. This will install the extended edition of Hugo:
|
|
OpenBSD includes Hugo in its package repository. This will prompt you to select which edition of Hugo to install:
|
|
To build Hugo from source you must:
The install directory is controlled by the GOPATH and GOBIN environment variables. If GOBIN is set, binaries are installed to that directory. If GOPATH is set, binaries are installed to the bin subdirectory of the first directory in the GOPATH list. Otherwise, binaries are installed to the bin subdirectory of the default GOPATH ($HOME/go or %USERPROFILE%\go).
Then build and test:
|
|
Prebuilt binaries | Repository packages | Build from source | |
---|---|---|---|
Easy to install? | ✔️ | ✔️ | ✔️ |
Easy to upgrade? | ✔️ | varies | ✔️ |
Easy to downgrade? | ✔️ | varies | ✔️ |
Automatic updates? | ❌ | varies | ❌ |
Latest version available? | ✔️ | varies | ✔️ |