| 1 |
--- |
| 2 |
title: Linux |
| 3 |
description: Install Hugo on Linux. |
| 4 |
categories: [] |
| 5 |
keywords: [] |
| 6 |
weight: 20 |
| 7 |
--- |
| 8 |
|
| 9 |
{{% include "/_common/installation/01-editions.md" %}} |
| 10 |
|
| 11 |
{{% include "/_common/installation/02-prerequisites.md" %}} |
| 12 |
|
| 13 |
{{% include "/_common/installation/03-prebuilt-binaries.md" %}} |
| 14 |
|
| 15 |
## Package managers |
| 16 |
|
| 17 |
You can also install Hugo using one of the following package managers. |
| 18 |
|
| 19 |
### Snap |
| 20 |
|
| 21 |
[Snap][] is a free and open-source package manager for Linux. Available for [most distributions][], snap packages are simple to install and are automatically updated. |
| 22 |
|
| 23 |
The Hugo snap package is [strictly confined][]. Strictly confined snaps run in complete isolation, up to a minimal access level that's deemed always safe. The sites you create and build must be located within your home directory, or on removable media. |
| 24 |
|
| 25 |
To install the extended edition of Hugo: |
| 26 |
|
| 27 |
```sh |
| 28 |
sudo snap install hugo |
| 29 |
``` |
| 30 |
|
| 31 |
To control automatic updates: |
| 32 |
|
| 33 |
```sh |
| 34 |
# disable automatic updates |
| 35 |
sudo snap refresh --hold hugo |
| 36 |
|
| 37 |
# enable automatic updates |
| 38 |
sudo snap refresh --unhold hugo |
| 39 |
``` |
| 40 |
|
| 41 |
To control access to removable media: |
| 42 |
|
| 43 |
```sh |
| 44 |
# allow access |
| 45 |
sudo snap connect hugo:removable-media |
| 46 |
|
| 47 |
# revoke access |
| 48 |
sudo snap disconnect hugo:removable-media |
| 49 |
``` |
| 50 |
|
| 51 |
To control access to SSH keys: |
| 52 |
|
| 53 |
```sh |
| 54 |
# allow access |
| 55 |
sudo snap connect hugo:ssh-keys |
| 56 |
|
| 57 |
# revoke access |
| 58 |
sudo snap disconnect hugo:ssh-keys |
| 59 |
``` |
| 60 |
|
| 61 |
{{% include "/_common/installation/homebrew.md" %}} |
| 62 |
|
| 63 |
## Repository packages |
| 64 |
|
| 65 |
Most Linux distributions maintain a repository for commonly installed applications. |
| 66 |
|
| 67 |
> [!NOTE] |
| 68 |
> The Hugo version available in package repositories varies based on Linux distribution and release, and in some cases will not be the [latest version][]. |
| 69 |
> |
| 70 |
> Use one of the other installation methods if your package repository does not provide the desired version. |
| 71 |
|
| 72 |
### Alpine Linux |
| 73 |
|
| 74 |
To install the extended edition of Hugo on [Alpine Linux][]: |
| 75 |
|
| 76 |
```sh |
| 77 |
doas apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community hugo |
| 78 |
``` |
| 79 |
|
| 80 |
### Arch Linux |
| 81 |
|
| 82 |
Derivatives of the [Arch Linux][] distribution of Linux include [EndeavourOS][], [Garuda Linux][], [Manjaro][], and others. To install the extended edition of Hugo: |
| 83 |
|
| 84 |
```sh |
| 85 |
sudo pacman -S hugo |
| 86 |
``` |
| 87 |
|
| 88 |
### Debian |
| 89 |
|
| 90 |
Derivatives of the [Debian][] distribution of Linux include [elementary OS][], [KDE neon][], [Linux Lite][], [Linux Mint][], [MX Linux][], [Pop!_OS][], [Ubuntu][], [Zorin OS][], and others. To install the extended edition of Hugo: |
| 91 |
|
| 92 |
```sh |
| 93 |
sudo apt install hugo |
| 94 |
``` |
| 95 |
|
| 96 |
You can also download Debian packages from the [latest release][] page. |
| 97 |
|
| 98 |
### Exherbo |
| 99 |
|
| 100 |
To install the extended edition of Hugo on [Exherbo][]: |
| 101 |
|
| 102 |
1. Add this line to /etc/paludis/options.conf: |
| 103 |
|
| 104 |
```text |
| 105 |
www-apps/hugo extended |
| 106 |
``` |
| 107 |
|
| 108 |
1. Install using the Paludis package manager: |
| 109 |
|
| 110 |
```sh |
| 111 |
cave resolve -x repository/heirecka |
| 112 |
cave resolve -x hugo |
| 113 |
``` |
| 114 |
|
| 115 |
### Fedora |
| 116 |
|
| 117 |
Derivatives of the [Fedora][] distribution of Linux include [CentOS][], [Red Hat Enterprise Linux][], and others. To install the extended edition of Hugo: |
| 118 |
|
| 119 |
```sh |
| 120 |
sudo dnf install hugo |
| 121 |
``` |
| 122 |
|
| 123 |
### Gentoo |
| 124 |
|
| 125 |
Derivatives of the [Gentoo][] distribution of Linux include [Calculate Linux][], [Funtoo][], and others. To install the extended edition of Hugo: |
| 126 |
|
| 127 |
1. Specify the `extended` [USE][] flag in /etc/portage/package.use/hugo: |
| 128 |
|
| 129 |
```text |
| 130 |
www-apps/hugo extended |
| 131 |
``` |
| 132 |
|
| 133 |
1. Build using the Portage package manager: |
| 134 |
|
| 135 |
```sh |
| 136 |
sudo emerge www-apps/hugo |
| 137 |
``` |
| 138 |
|
| 139 |
### NixOS |
| 140 |
|
| 141 |
The NixOS distribution of Linux includes Hugo in its package repository. To install the extended edition of Hugo: |
| 142 |
|
| 143 |
```sh |
| 144 |
nix-env -iA nixos.hugo |
| 145 |
``` |
| 146 |
|
| 147 |
### openSUSE |
| 148 |
|
| 149 |
Derivatives of the [openSUSE][] distribution of Linux include [GeckoLinux][], [Linux Karmada][], and others. To install the extended edition of Hugo: |
| 150 |
|
| 151 |
```sh |
| 152 |
sudo zypper install hugo |
| 153 |
``` |
| 154 |
|
| 155 |
### Solus |
| 156 |
|
| 157 |
The [Solus][] distribution of Linux includes Hugo in its package repository. To install the extended edition of Hugo: |
| 158 |
|
| 159 |
```sh |
| 160 |
sudo eopkg install hugo |
| 161 |
``` |
| 162 |
|
| 163 |
### Void Linux |
| 164 |
|
| 165 |
To install the extended edition of Hugo on [Void Linux][]: |
| 166 |
|
| 167 |
```sh |
| 168 |
sudo xbps-install -S hugo |
| 169 |
``` |
| 170 |
|
| 171 |
{{% include "/_common/installation/04-build-from-source.md" %}} |
| 172 |
|
| 173 |
## Comparison |
| 174 |
|
| 175 |
|Prebuilt binaries|Package managers|Repository packages|Build from source |
| 176 |
:--|:--:|:--:|:--:|:--: |
| 177 |
Easy to install?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark: |
| 178 |
Easy to upgrade?|:heavy_check_mark:|:heavy_check_mark:|varies|:heavy_check_mark: |
| 179 |
Easy to downgrade?|:heavy_check_mark:|:heavy_check_mark: [^1]|varies|:heavy_check_mark: |
| 180 |
Automatic updates?|:x:|varies [^2]|:x:|:x: |
| 181 |
Latest version available?|:heavy_check_mark:|:heavy_check_mark:|varies|:heavy_check_mark: |
| 182 |
|
| 183 |
[^1]: Easy if a previous version is still installed. |
| 184 |
[^2]: Snap packages are automatically updated. Homebrew requires advanced configuration. |
| 185 |
|
| 186 |
[Alpine Linux]: https://alpinelinux.org/ |
| 187 |
[Arch Linux]: https://archlinux.org/ |
| 188 |
[Calculate Linux]: https://www.calculate-linux.org/ |
| 189 |
[CentOS]: https://www.centos.org/ |
| 190 |
[Debian]: https://www.debian.org/ |
| 191 |
[EndeavourOS]: https://endeavouros.com/ |
| 192 |
[Exherbo]: https://www.exherbolinux.org/ |
| 193 |
[Fedora]: https://getfedora.org/ |
| 194 |
[Funtoo]: https://www.funtoo.org/ |
| 195 |
[Garuda Linux]: https://garudalinux.org/ |
| 196 |
[GeckoLinux]: https://geckolinux.github.io/ |
| 197 |
[Gentoo]: https://www.gentoo.org/ |
| 198 |
[KDE neon]: https://neon.kde.org/ |
| 199 |
[Linux Karmada]: https://linuxkamarada.com/ |
| 200 |
[Linux Lite]: https://www.linuxliteos.com/ |
| 201 |
[Linux Mint]: https://linuxmint.com/ |
| 202 |
[MX Linux]: https://mxlinux.org/ |
| 203 |
[Manjaro]: https://manjaro.org/ |
| 204 |
[Pop!_OS]: https://pop.system76.com/ |
| 205 |
[Red Hat Enterprise Linux]: https://www.redhat.com/ |
| 206 |
[Snap]: https://snapcraft.io/ |
| 207 |
[Solus]: https://getsol.us/ |
| 208 |
[USE]: https://packages.gentoo.org/packages/www-apps/hugo |
| 209 |
[Ubuntu]: https://ubuntu.com/ |
| 210 |
[Void Linux]: https://voidlinux.org/ |
| 211 |
[Zorin OS]: https://zorin.com/os/ |
| 212 |
[elementary OS]: https://elementary.io/ |
| 213 |
[latest release]: https://github.com/gohugoio/hugo/releases/latest |
| 214 |
[latest version]: https://github.com/gohugoio/hugo/releases/latest |
| 215 |
[most distributions]: https://snapcraft.io/docs/installing-snapd |
| 216 |
[openSUSE]: https://www.opensuse.org/ |
| 217 |
[strictly confined]: https://snapcraft.io/docs/snap-confinement |