Introduction
The Scoop package manager is a convenient tool for managing software packages on Windows systems. Similar to package managers on other operating systems, this allows users to easily install, update, and remove software packages from the command line, simplifying the software management process.
With Scoop, you can quickly set up your development environment, install command-line tools, and keep your applications up to date. It provides a curated collection of packages from various sources, making it easy to find and install popular software packages and utilities.
This guide will walk you through the steps to install and use the Scoop package manager on your Windows system. By following these instructions, you’ll be able to harness the power of Scoop to streamline your software installation and management workflow.
Let’s get started with the installation and configuration of Scoop on your Windows machine.Installing Scoop Windows Package Manager
Before using Scoop, you need to install it on your Windows machine:
- Open PowerShell as administrator, and run the below Set-ExecutionPolicy command to set your execution policy to RemoteSigned. Doing so ensures you can run PowerShell scripts you wrote or downloaded from the Internet.
Go to start, in the search box, type powershell , Click on powershell to open it as shown in the below snapshot
Right-click on powershell and select run as administrator to open powershell as administrator as shown in the below image
2. After powershell opens up with admin right, type the below command to set the execution policy
Input Y and press Enter when prompted, as shown below, to confirm the execution policy change
3. Next, run the following command to download Scoop’s installer script (get.scoop.sh) and run that script to install Scoop on your system with elevated privileges (-RunAsAdmin).
Invoke-Expression “& {$(Invoke-RestMethod get.scoop.sh)} -RunAsAdmin”
Now, run
Below scoop command displays a list of available commands for Scoop.
scoop -h
The output below confirms that you’ve successfully installed Scoop on your system
Finding and Installing Packages with Scoop
Scoop lets you search packages available to install with the bucket command
The bucket command lists all repositories (or buckets) containing Scoop packages. These buckets are like the package repositories used in Linux that contain a list of available packages and their dependencies.
To find and install packages with Scoop:
- Run the below scoop command to list locally available buckets.
The output below indicates that the main bucket contains 1083 packages you can install.
Each Scoop bucket has manifest files, which are updated periodically to add new packages and remove old ones. These files describe how to install a package and its dependencies.
2. Now, run the command below to search for a specific package, like 7zip, in all available buckets.
The output below shows two packages that match the search term 7zip (7zip and 7zip19.00-helper) from the primary bucket. You can also see the version number of each package.
3. Once you’ve found a package, run the following command to install the 7zip package
At this point, 7zip should be installed and ready to use!
With Scoop, a one-liner command is enough to install a package when you know the name of the package
4. Now, run the 7z command below to verify your 7zip installation, which should display a list of available options for the 7z command.
The output below confirms that 7z has been successfully installed
5. Why install them one by one when you can install them all in one go?
Scoop lets you install multiple packages specified and separated by spaces. This feature is helpful when you already have a list of packages to install.
Updating Packages with Scoop
Keeping your packages updated is one way to keep your system healthy. Once your package is installed, Scoop helps you get the latest features or bug fixes.
No worries, updating packages is just like installing them.
- Run the scoop update command to update Scoop itself to its latest version and app manifests.
- Next, run the following command to check the status of other packages if they’re outdated.
The output below shows it’s up to date.
- Now, run the command below to update a specific package you have in mind, in this case, the 7zip package.
Adding Extra Bucket/Versions and Installing Multiple Versions of a Package
As you’ve seen, Scoop installs package from buckets. And by default, Scoop comes with a handful of useful buckets such as main, versions, and extras.
If you wish to install packages from other buckets besides the main one, you must configure Scoop to know about the bucket.
- Run the following scoop command to list known available buckets by the community.
- Next, run the below command to add the Java bucket.
After adding a new bucket, you can install packages with Scoop from that bucket.
- Now, run the command below to install the openjdk package from the java bucket.
- Installing different version of openjdk
Switching Between Package Versions
Perhaps you’ve installed different versions of Java, as previously demonstrated. But suppose you have one program that requires Java 18 and another that requires Java 12. How do you switch between those versions?
- Run the below reset command to switch to Java 12 (openjdk12).
- Next, run the following Java command to check the current active Java –version.
The conclusion is that you can install and use this package manager on Windows by following these steps:
- Open a PowerShell or Command Prompt window with administrator privileges.
- Check if your system has PowerShell 5 or later installed.
- Install Scoop using the installation script: iex (new-object net.webclient).downloading(‘https://get.scoop.sh’)
- Add Scoop’s installation directory to your system’s PATH environment variable using the scoop bin-path command.
- Open the System Properties window, go to Environment Variables, and add the Scoop directory to the PATH variable.
- Start a new PowerShell or Command Prompt window and use Scoop commands like scoop install <package-name> to install packages.
For more articles related to software engineering, follow here.