Install Hugo testing distribution on Debian
All notes in this series:
- Automating hugo development with npm scripts
- normalize-scss with hugo
- Automatic image thumbnails in Hugo from static directory
- Escaping Hugo shortcodes within Hugo markdown
- Hugo tag and category pages
- Bind hugo to localhost for development
- Hugo 0.37 does not support h6 markdown heading
- Install Hugo testing distribution on Debian
- Hugo anchors next to headers
- Hugo: Migrating from Pygments to Chroma
- Hugo: Global resources
- Hugo: How to create a post series
On a default installation of Debian, trying to install hugo with apt install hugo
will fetch the latest stable
version of Hugo, which at time of writing is v0.18.1, and was released in December 2016! I would like to install the more recent version 0.47.1 which came out last month in August 2018. However it is on the testing
distribution so by default cannot be installed. To enable installing the testing
version of Hugo, follow these steps:
Edit /etc/apt/apt.conf
((which did not already exist)[https://www.debian.org/doc/manuals/apt-howto/ch-apt-get.en.html#s-default-version]) to set stable
as the default distribution. This will ensure that when the apt
command is used, the stable
distibution is always assumed unless otherwise specified:
Next, update the apt sources list to enable the testing
distribution for the repository that contains Hugo. For this, I created a /etc/apt/sources.list.d/testing.list
file with the following:
Now, after running apt update
, you can install the testing
distribution of Hugo using the -t
option:
To confirm:
Note that if you have not run apt update
or have not added testing
to a source list which contains Hugo, then you will get the following error:
A word of caution: beware about using testing
or unstable
distributions in general, but in particular for packages which have dependencies.