Debian Codegraph @

docs/content/en/installation/linux.md

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