Scoop: A Windows Package Manager (Featuring Hugo, Figlet, & Ruby Examples)
Updated 2021-June-6

Page contents

News

2021-April-19  In this article, created Example 5: Install and update Ruby and Ruby gems.

2020-November-27  Published this evolving⁠[1] article.

What is scoop

Scoop is a Windows package manager that is run at a command line. You can use it to install, update, and uninstall Windows apps. Details are at https://scoop.sh.

 

Alternatives to Scoop

Other Windows package managers include…

 

Installing scoop

To install Scoop, follow the instructions at github.com/lukesampson/scoop/wiki/Quick-Start.

💡
Before your system allows you to install scoop, you may need to disable anti-virus software. For example, on my new computer,⁠[2] I had to uninstall McAfee LiveSafe (which I was planning to do anyway).

 

Running scoop commands

To run a scoop command, such as scoop update *, you need to be at a command-line prompt. Since scoop is fundamentally a PowerShell script, I recommend running it from a PowerShell prompt (rather than a CMD⁠[3] or Git Bash prompt).⁠[4]

 

Example 1: Install hugo

To find out what, if any, variations of an app are available through scoop, you can use scoop’s search command. For example, you can use the following to search for the string hugo. (Hugo is the command-line static site generator used by Infinite Ink.)

scoop search hugo

This displays something like this:

'main' bucket:
    hugo-extended
    hugo

 

2. Install

To install hugo-extended, run this:

scoop install hugo-extended

Or, to install hugo (unextended), run this:

scoop install hugo
💡

Both extended Hugo and unextended Hugo are named hugo.exe on Windows.[5]

 

3. Shim and executable paths

Thanks to scoop’s magic the hugo command (which is actually a shim) will now be on your path and ready to use. To find out which directory the hugo shim is in, run one of the following commands.

  • In PowerShell, run:

  • In a Unix-like shell such as Git Bash, run:

    • which hugo

  • In CMD⁠[3] or Git Bash, run:

    • where hugo

 

To find out which directory the actual hugo.exe is in, run this if you installed hugo-extended:

scoop prefix hugo-extended

Or, this if you installed hugo:

scoop prefix hugo

 

In order for hugo to be on your path after using scoop install hugo or scoop install hugo-extended, you may need to relaunch your terminal emulator.

If you run scoop commands from a PowerShell prompt, this should not be an issue. But, be aware that needing to relaunch your terminal (and other weird things) can happen if you run scoop at a CMD⁠[3] or Git Bash prompt.

 

Example 2: Update hugo

1. Search

Before you use scoop to update an app, make sure scoop knows about the latest version by running this:

scoop search hugo

On 2020-November-27, this was displayed on my system:

'main' bucket:
    hugo-extended (0.78.2)
    hugo (0.78.2)

Thanks to discourse.gohugo.io, I knew that v0.79.0 had been released so I did the following.

2. Update scoop and scoop’s app manifests

To update scoop’s app manifests (and scoop itself), run this:

scoop update

On 2020-November-27, my system displayed something like this:

Updating Scoop…​
⋮
Updating 'extras' bucket…​
⋮
Updating 'main' bucket…​
⋮
* e6f097b4c hugo: Update to version 0.79.0                              2 hours ago
* 11f48741c hugo-extended: Update to version 0.79.0                     2 hours ago
⋮

3. Search again

To make sure scoop is ready to install the latest version, search again:

scoop search hugo

After running the above scoop update command, my system displayed this:

'main' bucket:
    hugo-extended (0.79.0)
    hugo (0.79.0)

4. Update

To update, run this:

scoop update hugo-extended

This displays something like this:

hugo-extended: 0.78.2 -> 0.79.0
Updating one outdated app:
Updating 'hugo-extended' (0.78.2 -> 0.79.0)
Downloading new version
Downloading https://github.com/gohugoio/hugo/releases/download/v0.79.0/hugo_extended_0.79.0_windows-64bit.zip (38.5 MB)...
Checking hash of hugo_extended_0.79.0_windows-64bit.zip ... ok.
Uninstalling 'hugo-extended' (0.78.2)
Removing shim for 'hugo'.
Unlinking ~\scoop\apps\hugo-extended\current
Installing 'hugo-extended' (0.79.0) [64bit]
Loading hugo_extended_0.79.0_windows-64bit.zip from cache
Extracting hugo_extended_0.79.0_windows-64bit.zip ... done.
Linking ~\scoop\apps\hugo-extended\current => ~\scoop\apps\hugo-extended\0.79.0
Creating shim for 'hugo'.
'hugo-extended' (0.79.0) was installed successfully!

5. Test

To make sure you’ve got the latest version installed, run:

hugo version

On 2020-November-27, the following was displayed on my system.

Hugo Static Site Generator v0.79.0/extended windows/amd64 BuildDate: unknown

👏

Example 3: Uninstall hugo

If you want to uninstall a scoop-installed app, use a command like one of the following.

scoop uninstall hugo-extended
scoop uninstall -p hugo-extended

The -p option removes any of the app’s persistent data, such as configuration settings, that are installed in the scoop/persist/ directory. Hugo does not use the persist directory, but I mention it here so you know about this option. It does not hurt to use -p, assuming you want to remove everything related to a scoop-installed app.

 

Learn about more scoop commands

To view a list of scoop comands and brief help on each, run either of the following equivalent commands:

scoop help
scoop

This will display something like this:

Usage: scoop <command> [<args>]

Some useful commands are:

alias       Manage scoop aliases
bucket      Manage Scoop buckets
cache       Show or clear the download cache
checkup     Check for potential problems
cleanup     Cleanup apps by removing old versions
config      Get or set configuration values
create      Create a custom app manifest
depends     List dependencies for an app
export      Exports (an importable) list of installed apps
help        Show help for a command
hold        Hold an app to disable updates
home        Opens the app homepage
info        Display information about an app
install     Install apps
list        List installed apps
prefix      Returns the path to the specified app
reset       Reset an app to resolve conflicts
search      Search available apps
status      Show status and check for new app versions
unhold      Unhold an app to enable updates
uninstall   Uninstall an app
update      Update apps, or Scoop itself
virustotal  Look for app's hash on virustotal.com
which       Locate a shim/executable (similar to 'which' on Linux)


Type 'scoop help <command>' to get help for a specific command.

 

Example 4: Research and install figlet

1. Update scoop and scoop’s app manifests

Before you use scoop to research an app, it’s usually a good idea to update scoop and its app manifests with this command:

scoop update

Figlet is a nix-nux command that was created in 1991 (~30 years ago). For details, see FIGstory. To see if it’s been ported to Windows and is available through scoop, run:

scoop search figlet

This displays:

'main' bucket:
    figlet (1.0-go)

3. Home

To open the home page of this figlet (1.0-go) in your default browser, run:

scoop home figlet

Cool, it turns out that this is by Luke Sampson, scoop’s creator. This makes sense since I saw Windows figlet in action in Luke’s “Scoop Demo” video on Scoop’s home page.

4. Info

To find out more about this app, run:

scoop info figlet

This displays something like this:

Name: figlet
Description: Create large letters using ASCII art out of ordinary text.
Version: 1.0-go
Website: https://github.com/lukesampson/figlet
License: BSD-3-Clause (https://spdx.org/licenses/BSD-3-Clause.html)
Manifest:
  C:\Users\username\scoop\buckets\main\bucket\figlet.json
Installed: No
Binaries:
  figlet.exe

5. Depends

To see if it has any dependencies, run:

scoop depends figlet

This responds with a blank line, which means it has no dependencies.

6. Install

To install, run:

scoop install figlet

7. Test

To test it, run:

figlet "Scoop Rocks!"

This displays:

 ____                          ____            _        _
/ ___|  ___ ___   ___  _ __   |  _ \ ___   ___| | _____| |
\___ \ / __/ _ \ / _ \| '_ \  | |_) / _ \ / __| |/ / __| |
 ___) | (_| (_) | (_) | |_) | |  _ < (_) | (__|   <\__ \_|
|____/ \___\___/ \___/| .__/  |_| \_\___/ \___|_|\_\___(_)
                      |_|

It worked!🎉

 

Example 5: Install and update Ruby and Ruby gems

Nowadays I write most Infinite Ink articles in the AsciiDoc markup language. The source of these articles are rendered to HTML by Hugo, with the help of the Asciidoctor Ruby gem. Here are the steps I use to install Ruby and Asciidoctor.

  1. scoop update

  2. scoop install ruby

  3. gem install asciidoctor

💡

Scoop’s Ruby manifest includes this line:

"notes": "Install MSYS2 via 'scoop install msys2' and then run 'ridk install' to install the toolchain!",

On my system, neither MYSYS2 nor ridk seem to be needed for the way that I use Ruby and Asciidoctor so I do not run these suggested commands.⁠🤷

 

Below are the steps I use to update Ruby and Ruby gems.

Before running scoop uninstall -p ruby, look at, and possibly backup, scoop/persist/ruby/. Make note of the gems you’ve installed because you will reinstall them in steps 7 and 8 below.
  1. scoop uninstall -p ruby  ← this uninstalls Ruby and its persistent data, which includes all installed gems

  2. scoop update

  3. scoop install ruby

  4. gem install asciidoctor

  5. Install any other Ruby gem(s) that you use.

After installing Ruby, I run ruby -v, which displays something like this:

ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x64-mingw32]

After installing the Asciidoctor gem, I run asciidoctor -v, which displays something like this:

Asciidoctor 2.0.15 [https://asciidoctor.org]
Runtime Environment (ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x64-mingw32]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)

 

💡
  • I think of steps 4-8 above as the “nuclear option”⁠💥 for updating Ruby and Asciidoctor. I do it this way because I use Ruby only for Asciidoctor, but if you use Ruby for more complicated things, you may want to use a less nuclear way of updating Ruby and its gems.

  • If you want to update the Asciidoctor gem — and not update Ruby — you can use the following two commands.

    1. gem install asciidoctor

    2. gem cleanup asciidoctor

 

More apps

Apps I manage with scoop

I use scoop to install and update:

Thanks to my preferred shell, Git Bash, a lot of Unix-like tools — for example curl, od (octal dump), and sed — are already installed on my Windows devices.

 

App I wish I managed with scoop

Someday maybe I’ll be able to install and update rsync with scoop. If you would like to be able to do this too, please up vote Scoop’s Issue #4163: Free rsync client is available again.⁠👍

Endnotes


1. Many Infinite Ink articles, including this one, are evergreen and regularly updated.
2. My new computer is what inspired me to write this article.🆕💻
3. CMD is also known as “Command Prompt” and cmd.exe.
4. The Scoop package manager includes shims called scoop.ps1 for PowerShell, scoop.cmd for CMD, and scoop for Bourne Shell (which is part of Git Bash). Which shim is invoked depends on which Windows command-line shell you are using.
5. The Hugo executable is named hugo.exe on Windows and hugo on non-Windows systems.

Comments & reactions 👍 👎 📝

To comment or react, you must be signed in to GitHub.