Eget: Easily Get & Install Some Apps (featuring installing the latest Hugo)
Updated  by  nm  2023-September-28

Page contents

 

News

Ongoing  According to Repology, the latest packaged Eget is version . To keep up with Eget releases, see github.com/zyedidia/eget/releases.

2023-August-23  Published this evolving⁠[1] article.

 

Why I wrote this

Because there are new releases of Hugo all the time and because I always want the latest Hugo, I need an easy way to get the latest Hugo on all my systems (Linux, Windows, and WSL).

I recently stumbled upon Eget and, so far, I think I ❤️ it!

 

Prerequisites

This article assumes you know how to…

  • use the command line and

  • check your path.

 

💡

To learn about checking your path in cmd.exe, PowerShell, and Unix-⁠like shells, see the section called Find out your path in Infinite Ink’s Installing Extended Hugo.

 

What is Eget?

Why use Eget

In general, I prefer to use a package manager to install, update, and uninstall an app, but…

  • if the app is available on GitHub,

  • if the app is a single binary,

  • if the app has no dependencies,

  • and if the latest version of the app is not available through my package manager,⁠[3]

…then I use Eget.

 

Install Eget

You can install Eget with some package managers, including the ones listed in this Repology⁠[4] badge:

Packaging status

 

For details about how to install Eget, see github.com/zyedidia/eget#how-to-get-eget.

 

Windows

On Windows, I use this sequence of commands to install Eget:

scoop update
scoop bucket add extras
scoop info eget
scoop install eget

To learn about Scoop, see Infinite Ink’s Scoop: A Windows Package Manager.

 

Linux

On Linux, I install Eget with:

brew install eget

To learn about Homebrew on Linux, see docs.brew.sh/Homebrew-on-Linux.

 

macOS

The brew install eget command in the previous section also works on macOS (assuming you have Homebrew installed on your Mac).

 

Check Eget

To check if Eget is on your path, run one of these commands:

eget
eget -h
eget --help

Each of these three equivalent commands should produce something like this:

Usage:
  eget [OPTIONS] TARGET

Application Options:
  -t, --tag=           tagged release to use instead of latest
      --pre-release    include pre-releases when fetching the latest version
      --source         download the source code for the target repo instead of a release
      --to=            move to given location after extracting
  -s, --system=        target system to download for (use "all" for all choices)
  -f, --file=          glob to select files for extraction
      --all            extract all candidate files
  -q, --quiet          only print essential output
  -d, --download-only  stop after downloading the asset (no extraction)
      --upgrade-only   only download if release is more recent than current version
  -a, --asset=         download a specific asset containing the given string; can be specified multiple times for additional filtering; use ^ for anti-match
      --sha256         show the SHA-256 hash of the downloaded asset
      --verify-sha256= verify the downloaded asset checksum against the one provided
      --rate           show GitHub API rate limiting information
  -r, --remove         remove the given file from $EGET_BIN or the current directory
  -v, --version        show version information
  -h, --help           show this help message
  -D, --download-all   download all projects defined in the config file
  -k, --disable-ssl    disable SSL verification for download

 

1. Example: Use Eget to install extended Hugo on Windows

1.1. In a terminal, cd to a directory on your path

On my Windows devices, I do this:

cd C:\AppsB4Scoop

Note that C:\AppsB4Scoop is a directory on my path⁠[5] and is where I want Eget to install extended Hugo.

 

1.2. Run Eget

eget gohugoio/hugo
     -------------
      GitHub repo

This is displayed in my terminal:

PS C:\AppsB4Scoop> eget gohugoio/hugo
2 matches found: please select manually
(1) hugo_0.117.0_windows-amd64.zip
(2) hugo_extended_0.117.0_windows-amd64.zip

Enter selection number: 2

https://github.com/gohugoio/hugo/releases/download/v0.117.0/hugo_extended_0.117.0_windows-amd64.zip
Downloading 100% [=============================================================] (21/21 MB, 7.580 MB/s)
Extracted `hugo.exe` to `hugo.exe`

 

💡

If you want Eget to display the SHA-⁠256 checksum of the downloaded file, use this:

eget gohugoio/hugo --sha256
                       👆
                       Note

 

1.3. Test

PS C:\AppsB4Scoop> hugo version
hugo v0.117.0-b2f0696cad918fb61420a6aff173eb36662b406e+extended windows/amd64 BuildDate=2023-08-07T12:49:48Z VendorInfo=gohugoio

PS C:\AppsB4Scoop> where.exe hugo

C:\AppsB4Scoop\hugo.exe
C:\Scoop\shims\hugo.exe

Since C:\AppsB4Scoop\hugo.exe is listed first in the above where.exe output, this is the binary that’s launched by a (pathless) hugo command.

 

2. Example: Use Eget to install extended Hugo on Linux

2.1. In a terminal, cd to a directory on your path

On my Linux device, I do this:

cd ~/bin

Note that ~/bin, which is sometimes known as $HOME/bin or /home/USERNAME/bin, is a directory on my path⁠[5] and is where I want Eget to install extended Hugo.

 

2.2. Run Eget

eget gohugoio/hugo
     -------------
      GitHub repo

This is what’s displayed in my terminal:

$ eget gohugoio/hugo
4 matches found: please select manually
(1) hugo_0.117.0_linux-amd64.deb
(2) hugo_0.117.0_linux-amd64.tar.gz
(3) hugo_extended_0.117.0_linux-amd64.deb
(4) hugo_extended_0.117.0_linux-amd64.tar.gz

Enter selection number: 4

https://github.com/gohugoio/hugo/releases/download/v0.117.0/hugo_extended_0.117.0_linux-amd64.tar.gz
Downloading 100% [=============================================================] (20/20 MB, 8.058 MB/s)
Extracted `hugo` to `hugo`

 

 

💡

If you want Eget to display the SHA-⁠256 checksum of the downloaded file, use this:

eget gohugoio/hugo --sha256
                       👆
                       Note

 

2.3. Test

$ hugo version
hugo v0.117.0-b2f0696cad918fb61420a6aff173eb36662b406e+extended linux/amd64 BuildDate=2023-08-07T12:49:48Z VendorInfo=gohugoio

$ which hugo
/home/USERNAME/bin/hugo

 

Conclusion

Eget makes it easy to get and install single-⁠binary apps.🎉👏

See also

Endnotes


1. Many Infinite Ink pages, including this one, are evergreen 🌲 and regularly updated.
2. “Binaries” are also known as “executables.” For more about this, see wikipedia.org/wiki/Executable.
3. To learn about the package managers I use, see Infinite Ink’s Linux Package Management and Scoop: A Windows Package Manager.
4. Repology monitors a huge number of package repositories and other sources comparing packages versions across them and gathering other information. For more about Repology, see repology.org.
5. To learn how to check your path, see www.ii.com/install-hugo-extended/#_path.

Please share & discuss 📝 👎 👍 📯