timochan

timochan

Installation and Usage of Scoop

I have always wanted to find a package manager that works well on Windows. Although chocolatey / winget meets some of my expectations for a package manager, there are some areas where it falls short. For example, winget cannot configure environment variables on its own and often freezes. Chocolatey always requires unnecessary permission elevation and the installation and upgrades are not very satisfactory. What I want is a feeling similar to using Homebrew on Mac, and Scoop has caught my attention.

Start#

Install#

Modify the script execution policy for the user.

Set-ExecutionPolicy RemoteSigned -scope CurrentUser

Execute the installation script.

Github source:

iwr -useb get.scoop.sh | iex

If you can't connect, please set up a proxy or use a mirror in China.

iwr -useb https://gitee.com/RubyKids/scoop-cn/raw/master/install.ps1 | iex

Now you have the Scoop package manager, but please be patient, we still need to set up the bucket.

Note: Scoop is installed by default in the user directory. If you have other requirements, please refer to the Scoop documentation to define the necessary environment variables for Scoop.

What you need to know is that Scoop will configure the environment variables for you, so you don't need to worry about it. Generally, there shouldn't be any major issues with configuring the environment variables.

Use#

Bucket#

Predefined repository list, you need to manually add them.

scoop bucket known

You will often get the following output:

~ ❯ scoop bucket known
main
extras
versions
nirsoft
php
nerd-fonts
nonportable
java
games

Obviously, we need to add main and extras which are commonly used repositories. PHP is obviously for PHP developers, and if you need it, you can set it up yourself.

Add repositories:

scoop bucket add main
scoop bucket add extras

Now we have completed adding the repositories and can use Scoop to manage your apps.

Install or Uninstall#

scoop install {program name}

scoop uninstall {program name}

Cache#

Manage download cache.

# View cache
scoop cache

# Remove a specific cache
scoop cache rm {package name}

# Remove all cache
scoop cache rm *

Status#

Scoop checks if there are new updates available for apps.

scoop status

Update#

Scoop updates a specific app.

scoop update {app name}

Of course, you can simplify it and update all packages directly.

scoop update *

Which#

The function of which is similar to which in Linux, but it can only search within its own apps. So, to be able to search all apps, you can install a which.

scoop install which

This way, you can use which directly to achieve the same effect as which in Linux.

For example:

which cmd

You should see the following result:

~ ❯ which cmd
C:\Windows\System32\cmd.EXE

This is used to find the package name of an app. Often, you need to match it based on the description.

scoop search {app package name}

For example:

scoop search which

After configuring the repositories, you should get the following result:

~ ❯ scoop search which
'extras' bucket:
    gtools (4.2) --> includes 'which.exe'

'main' bucket:
    busybox (4621-gf3c5e8bc3) --> includes 'which'
    gow (0.8.0) --> includes 'which.exe'
    unxutils (2007.03.01) --> includes 'which.exe'
    which (2.20)

Proxy#

If you feel that the direct connection is too slow, you can also set up a proxy.

scoop config proxy {address}

For example, an HTTP proxy:

scoop config proxy 127.0.0.1:20171

Of course, you can also remove it.

scoop config rm proxy

End#

With this, there shouldn't be any major issues with daily use. The rest is up to you to explore, right?

image

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