Introduction#
We all know that Linux has the concept of package management, which allows us to manage programs through a series of commands in the command line. Common use cases include searching, installing, updating, and uninstalling.
macOS also has similar package managers, such as brew
and homebrew
.
With the help of package managers, we can achieve the goal of unified management of commonly used software.
Drawbacks of Windows Platform#
The current software ecosystem on Windows is well known. Common software such as Git
, Chrome
, VS code
, 7zip
, and NetEase Cloud Music
have multiple installation methods, scattered locations, complex and time-consuming installation, update, and uninstallation processes, diverse installation paths polluting directories, and lack of unified management.
Here Comes Scoop#
Scoop is here to solve the aforementioned problems. In simple terms, it organizes various software installation directories in an orderly manner, stores user data and configuration files separately, and only updates the program itself during updates, greatly improving the efficiency of managing software on the Windows platform.
How to Install Scoop#
Please make sure you have installed:
- ①
PowerShell 5
(or higher, includingPowerShell Core
) - ②
.net Framework 4.5
(or higher).
Nowadays, most machines are running on Windows 10, and the system mostly meets the requirements, so you can directly proceed with the following steps.
Run the following commands in the terminal (recommended in the root directory of the current user, C:\Users\your_username):
# Run this command
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.Scoop.sh')
# Or this shorter command
iwr -useb get.Scoop.sh | iex
Then you can enter the Scoop
command in the terminal to check if the installation is complete.
If you encounter an error, you may need to change the execution policy. Run the following command to enable PowerShell:
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
Using Scoop#
Adding Buckets#
A bucket can be understood as a software catalog.
Only software available in the currently added bucket can be downloaded.
Use the following command to add commonly used buckets and expand the categories and number of software you can install:
# Most commonly used bucket
scoop bucket add extras
# More comprehensive bucket
scoop bucket add dorado https://github.com/chawyehsu/dorado
scoop bucket add sushi https://github.com/kidonng/sushi
...
Searching for Software#
This command searches for suitable software in the added buckets and prints them out.
scoop search neteasemusic # Search for NetEase Cloud Music
Installing Software#
scoop install <name>
The following are the installation commands for commonly used programs:
7zip
must be installed first, as it is required for extracting installation packages.
# Recommended installation of commonly used programs (requires adding the extras bucket first)
scoop install 7zip git googlechrome vscode nodejs yarn postman everything sharex quicklook telegram
# Personal software usage (requires adding the extras, dorado, and nonportable buckets first)
scoop install 7zip git googlechrome vscode yarn v2rayn sharex nodejs quicklook dismplusplus postman telegram oh-my-posh pscolor posh-git mactype-np neteasemusic everything mysql adb sudo nginx
Uninstalling Software#
scoop uninstall <name>
Updating Software#
scoop update <name>
# Usually update all, use * wildcard to match all
scoop update *
Cleaning Cache (Downloaded installation packages, etc.)#
scoop cache rm *
Cleaning Residual Old Versions of Installed Software#
After updating a program, the old versions are usually retained by default. You can manually clean them up.
scoop cleanup *
Switching Versions#
When there are multiple versions of an installed software and you need to use them simultaneously, you can refer to the following method, which is similar to setting up and switching between two versions of Node.js.
- Install the required versions first:
scoop install nodejs12
scoop install nodejs
At this point, the node -v
command will output the latest version by default.
- Set the desired version / Switch versions
Since node12
and the latest version share the node
command, you only need to execute reset
followed by the corresponding version to set the command to the specified version.
Switch to the node12
version:
scoop reset nodejs12
Switch to the latest node
version:
scoop reset nodejs
Ignoring Updates#
Usually, we use the following command to update all software downloaded through Scoop:
scoop update *
However, sometimes we don't want a particular software to be updated. In this case, we need to use the hold/unhold
command.
# Limit Postman updates when updating software
scoop hold postman
# Remove update restriction
scoop unhold postman