banner
Wayne

Wayne

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

Manage your Windows software using scoop.

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 and macOS's homebrew. It is driven by the open-source community and is possibly 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 installation of software like nodejs that require environment variable configuration extremely simple. It only requires one command to install and automatically configure, and it 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 normally, thus achieving software portability.
  3. Scoop allows users to choose specific versions of software to install. If you have installed multiple versions of Python, 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 can be changed to the directory 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, we just closed the door. It is recommended that everyone prepare a proxy tool in order to have a broader perspective 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. Clicking into any software directory, you can also see the versions of the software. The current directory is the directory of the software you are currently using.
  • buckets: Manages the repositories of software, used to 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, preventing interference between applications.

Configuration after Installation#

Setting up a Proxy#

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

scoop config proxy 127.0.0.1:7890

Change 7890 to the port of your proxy software. Clash defaults to 7890, and in V2RayN, you 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 corresponding method.

Common Commands#

scoop + command + parameters
  • search: Search if the repository has the corresponding software.
  • install: Install the corresponding software. Note: After installing the software, some software (such as VSCode, Python, etc.) may prompt 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 prompt.
  • uninstall: Uninstall the corresponding software.
  • update: Update the software. You can update all installed software by using scoop update -a.
  • hold: Lock the software to prevent it from being updated.

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

Adding 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 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. Features: Suitable for cases where specific versions of software are needed, such as testing and compatibility verification. I often use this repository to install older versions of Python.

scoop bucket add versions

Other Repositories#

Add them according to 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 poor download speed. 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

Assuming 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 extremely convenient for management. Update all software with one command:

scoop update -a

View all software installed with Scoop with one command:

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 there will be 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 with 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 highly recommend installing sudo. This software allows you to use administrator privileges to install software and perform other operations without restarting the command line as an administrator.

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 are executing the command as an administrator, which is very convenient.

Install other software according to 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.