banner
Wayne

Wayne

Do what you love, love what you do
github
bilibili
telegram

Use scoop to manage your Windows software.

Preface#

Scoop is a Windows package management tool that allows you to install, manage, and update applications with a single command, similar to Ubuntu's apt or macOS's homebrew. It is driven by the open-source community and is arguably the best among all Windows package management tools in terms of user experience. You can think of it as a software store on your phone, where you can install and use software without any configuration after installation.

In my opinion, Scoop has the following advantages:

  1. Software installed using the scoop method automatically sets up environment variables, making the installation of many software packages such as Node.js extremely simple. You only need one command to install and automatically configure them, and they can be uninstalled cleanly.
  2. Software installed by Scoop is located in separate directories, making it easy to copy them to other computers and run them without any issues, thus achieving software portability.
  3. Scoop allows users to choose specific versions of software to install. If you have multiple versions of Python installed, for example, you can easily switch between different versions.

In future tutorials, I will use this method as much as possible to install software because it is incredibly convenient and easy to use.

Installation of Scoop#

Open the built-in PowerShell in Windows and enter the following command to customize the installation location (D:\Scoop should be changed to the directory where you want to install):

$env:SCOOP='D:\Scoop'
[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'User')

Set PowerShell to allow execution of local scripts:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Install Scoop (requires a proxy tool):

iwr -useb get.scoop.sh | iex

If you don't have a proxy tool:

irm https://ghproxy.com/https://raw.githubusercontent.com/duzyn/scoop-cn/master/install.ps1 | iex

This is an open-source project I recently discovered on GitHub, aimed at providing a better experience for Chinese users of Scoop.

GitHub address: https://github.com/duzyn/scoop-cn

The world is open, but we have closed the door. I recommend that everyone prepare a proxy tool in order to have a broader vision and learn more knowledge.

After completion, a scoop folder will be generated in the corresponding location, which mainly includes the following parts:

  • apps: All software installed through Scoop is located here. If you enter any software's directory, you can also see the software's version. The current directory is the directory of the software you are currently using.
  • buckets: Manages software repositories, which record information such as which software can be installed and updated. The main repository is added by default, and you can manually add other repositories or create your own.
  • cache: Temporary storage directory for downloaded installation packages. The files here can be deleted.
  • persist: Used to store some user data, which will not be replaced when the software is updated.
  • shims: Used to create symbolic links for applications to prevent interference between applications.

Configuration after Installation#

Set Proxy#

Since most software sources for Scoop are on GitHub, use the following command to set the proxy:

scoop config proxy 127.0.0.1:7890

Change 7890 to the port of your proxy software. Clash defaults to 7890, while V2RayN can find the local SOCKS listening port in Settings-Parameter Settings-Core: Basic Settings. The port that needs to be changed is the original port + 1. For other proxy software, please find the method yourself.

Common Commands#

scoop + command + parameters
  • search: Search the repository for corresponding software.
  • install: Install the corresponding software. Note: After installing some software (such as VSCode and Python), there may be prompts asking you to execute commands to associate file types or allow other programs to call them. Execute the commands according to your needs, but it is generally recommended to execute the commands in the prompts.
  • uninstall: Uninstall the corresponding software.
  • update: Update software. You can use scoop update -a to update all installed software.
  • hold: Lock software to prevent it from being updated.

For more command usage help, you can use scoop -h to check.

Add Common Repositories#

extras#

This repository covers almost all the software we use in our daily lives. It is a community-maintained repository that includes some software not included in the official repositories. Most of the software in this repository has a GUI. As you can see from the previous list, most of the software on my computer is installed from this repository. Use the following command to add it:

scoop bucket add extras

versions#

This repository allows users to install older versions of software. It is suitable for situations where specific versions of software are needed, such as testing and compatibility verification. I often use this repository to install older versions of Python. Use the following command to add it:

scoop bucket add versions

Other Repositories#

Add them according to your personal needs. Before each installation, use the command:

scoop search software_name

to search for the software you want to install. This will return the search results and the repository to which the software belongs. If you haven't added this repository, you need to add it before installation:

scoop bucket add repository_name
scoop install software_name

If you don't have a proxy tool, you will experience very poor download speeds. However, due to the existence of the aforementioned open-source project, you can add scoop-cn/ in front of the software you want to install. For example, if you originally installed VSCode, the command would be:

scoop install vscode

Now it becomes:

scoop install scoop-cn/vscode

This is based on the assumption that you installed scoop using this command:

irm https://ghproxy.com/https://raw.githubusercontent.com/duzyn/scoop-cn/master/install.ps1 | iex

Tips and Tricks#

Common Commands#

Using software installed with Scoop is very convenient. Update all software with one command:

scoop update -a

View all software installed with Scoop:

scoop list

Uninstall a specific software with one command:

scoop uninstall software_name

When you reinstall your computer, you can install the software from your old computer with one command (data needs to be migrated separately). It is not recommended to directly copy the Scoop root directory to the new computer because it will cause problems with environment variables, associated menus, and software compatibility. First, export the list of software installed with Scoop:

scoop export > D:\Download\installed_apps.txt

This will generate a file named installed_apps.txt in the specified path. Copy it to the corresponding path on the new computer, and then execute:

scoop import < D:\Download\installed_apps.txt

to install the software from your old computer with one command.

Here are the software I installed using Scoop:

Name                 Version      Source   Updated               Info
----                 -------      ------   -------               ----
7zip                 23.01        main     2023-07-20 15:27:09
adb                  34.0.4       main     2023-07-20 15:48:24
alist                3.24.0       main     2023-07-31 18:09:34
bitwarden            2023.7.1     extras   2023-07-27 10:06:10
discord              1.0.9010-15  extras   2023-07-20 16:56:54
dopamine             2.0.9        extras   2023-07-31 15:19:29
everything           1.4.1.1024   extras   2023-07-20 16:58:18
git                  2.41.0.3     main     2023-07-26 16:11:51
idea-ultimate        2023.2-232.8660.185 extras 2023-07-27 10:09:34
memreduct            3.4          extras   2023-07-28 13:16:40
nodejs               20.5.0       main     2023-07-23 10:45:07
obsidian             1.3.5        extras   2023-07-20 16:58:45
openjdk17            17.0.2-8     java     2023-07-21 12:43:19
Picgo                2.3.1        extras   2023-07-20 17:19:28
qbittorrent-enhanced 4.5.4.10     extras   2023-07-20 17:23:31
renamer              7.5          extras   2023-07-31 13:11:09
snipaste             1.16.2       extras   2023-07-20 17:23:11
sophiapp             1.0.97       extras   2023-07-27 10:10:03
sudo                 0.2020.01.26 main     2023-07-20 17:19:59
telegram             4.8.10       extras   2023-07-31 18:10:28
vlc                  3.0.18       extras   2023-07-21 10:45:24
vscode               1.80.2       extras   2023-07-28 13:17:39
dark                 3.11.2       main     2023-07-20 17:20:14 Global install
python               3.11.4       main     2023-07-20 17:20:57 Global install

I especially recommend installing sudo. This software allows you to use administrator privileges in the command line without restarting as an administrator to install software or perform other operations.

After installing Scoop, open the command line with administrator privileges and execute:

scoop install sudo

After that, if you encounter a "permission denied" prompt when operating the command line, use:

sudo + original_command

This way, you can execute the command as an administrator, which is very convenient.

Install other software according to your personal needs. In the future, when installing software, first check if Scoop has the corresponding software, and then consider installing from the official website.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.