This paper lists various skills and related knowledge of the Scoop package manager under Windows; contain:
- Scoop's design and implementation concept;
- Customize the Scoop installation path;
- Scout potential error troubleshooting;
- Update or disable software updates;
- Use of Scoop alias;
- How to use aria2 for breakpoint continuation in Scoop;
- How to switch between different versions of the same program, such as switching between different versions of JDK;
- And so on
Introduction to Scoop package management tool
Common package management tools under Windows include:
- Scoop
- Chocolatey
Compared with chocolate, Scoop focuses more on open-source command-line tools. The applications installed with Scoop are usually called "portable" applications, which require less permissions and have fewer side effects on the system. Therefore, I chose to use Scoop here.
Scoop installation and configuration
requirement:
- PowerShell > = 5.0 (if it is Window10, this condition is met by default)
- Ensure that PowerShell is allowed to execute local scripts, which can be turned on using the following command:
set-executionpolicy remotesigned -scope currentuser # Or (but it's not as secure as the above command) set-executionpolicy Unrestricted -scope currentuser
Installation path:
- Programs installed at the user level and Scoop itself are installed at C: \ users \ < user > \ Scoop by default
- The globally installed program (available to all users, using the -- global or - g option) is located in the C \ programdata \ scope path.
You can change these paths by changing the corresponding environment variables.
To install Scoop to a custom Directory:
Open PowerShell, first configure the environment variable SCOP, and then run iex
$env:SCOOP='D:\Scoop' # First add the user level environment variable Scop [environment]::setEnvironmentVariable('SCOOP',$env:SCOOP,'User') ## Download and install # Then download and install Scoop (if the default installation path is used, run the following command directly) iex (new-object net.webclient).downloadstring('https://get.scoop.sh') # Or use the following command to install: iwr -useb get.scoop.sh | iex
Configure global installation path (optional, not recommended)
$env:SCOOP_GLOBAL='D:\GlobalScoopApps' [environment]::setEnvironmentVariable('SCOOP_GLOBAL',$env:SCOOP_GLOBAL,'Machine')
It is equivalent to setting: SCOP in the system variable_ GLOBAL=D:\GlobalScoopApps; The default is in C: \ programdata \ scope.
Why do I need a global installation?
For programs that require administrator privileges, a global installation is required. What I currently encounter is that when using Scoop to install fonts, I need to use global installation, because fonts need to be used by all users.
After installing Scoop for the first time, the recommended programs to install are:
# However, the sudo command is required for global installation of scoop scoop install sudo # When downloading the program, SCOP supports the use of aria2 to speed up the download scoop install aria2
We can find that the dependent 7-zip is automatically downloaded during the download process. In terms of installation, it uses 7zip to decompress the installation package / compressed package, so it is inherently friendly to green software. Moreover, the downloaded content will be automatically added to the (Path) environment variable, which is very convenient.
Add: after the initial installation, we can detect the current potential problems by running the scope checkup, and then correct them according to the prompts.
# Detect problems in my current environment $ scoop checkup
Scoop's design and implementation philosophy:
- Separate user data: by default, the user data of the program is stored in the persist directory, so that the previous user configuration is still available after the user upgrades the program in the future. (however, the support for some programs is not perfect)
- shim soft link: scoop will automatically add corresponding to the newly installed program in the shims folder under the scoop application installation PATH exe file, and the ships folder has been added to the PATH environment variable in advance, so once the program is installed, it can be run directly on the command line.
- For GUI programs, scoop will automatically add shortcuts to the start menu. The path is C: \ users \ < user > \ appdata \ roaming \ Microsoft \ windows \ start menu \ programs \ scoop apps
Scoop common commands
scoop help #view help scoop help <A command> # See the help of a command for details scoop install <app> # Install APP scoop uinstall <app> # Uninstall APP scoop list # List installed apps scoop search # Search APP scoop status # Check which software is updated scoop update # Update Scoop itself scoop update <app1> <app2> # Update some app s scoop update * # Update all apps (provided that you need to operate in the apps directory) scoop bucket known #Use this command to list all known bucket s (software sources) scoop bucket add bucketName #Add a bucket scoop cache rm <app> # Remove the cache of an app
Install uninstall software
# Before installation, search APP through search to determine the software name scoop search xxx # Install APP scoop install <app> # Install a specific version of APP; Syntax AppName@[version], example scoop install git@2.23.0.windows.1 # Uninstall APP scoop uninstall <app> #Uninstall APP
Update software
Includes: how to disable updates
scoop update # Update Scoop itself scoop update appName1 appName2 # Update some app s # Update all apps (you may need to operate in the apps directory) scoop update * # Disable a program update scoop hold <app> # Allow a program update scoop unhold <app>
Clear cache and older versions
# View all cached information for download scoop cache show # Clear the download cache of the specified program scoop cache rm <app> # Clear all caches scoop cache rm * # Delete an old version of a software scoop cleanup <app> # Delete an older version of a globally installed software scoop cleanup <app> -g # Delete expired download cache scoop cleanup <app> -k
Switch between different versions of the same program
Use command:
scoop reset [app]@[version]
scoop reset idea-ultimate-eap@201.6668.13 scoop reset idea-ultimate-eap@201.6073.9 # Switch to the latest version scoop reset idea-ultimate-eap
The corresponding version of the program needs to have been installed in the local system; So when you clear the old version of a software, consider whether you will use the old version again.
In addition, the idea ultimate EAP switching process may take longer.
other
command
# Display the information of an app scoop info <app> # Open the home page of an app in the browser scoop home <app> # such as scoop home git
Add software source Bucket
The software information that can be installed by Scoop is stored in a Bucket (translated as Bucket), which can also be called software source. The default Bucket of Scoop is main; the other Bucket officially maintained is extras, which we need to add manually.
# bucket usage scoop bucket add|list|known|rm [<args>]
Add extras:
scoop bucket add extras
We can also add third-party bucket s, for example:
scoop bucket add dorado https://github.com/h404bi/dorado
And specify the program to install in this bucket (software source):
scoop install dorado/<app_name> # The following is the specific software in dorado. Test whether it is added successfully scoop search trash
Recommended Bucket (software source):
- extras: a warehouse officially maintained by Scoop, which covers most common software that cannot be included in the main warehouse for various reasons (in my opinion, it must be added). Address: lukesampson/scoop-extras
- NirSoft: it is an installation collection of gadgets developed by NirSoft. NirSoft has produced a large number of gadgets, including system tools, network tools, password recovery, etc., which are tirelessly updated.
- Bucket address: kodybrown/scoop-nirsoft
- NirSoft official website address: NirSoft
- dorado has added some domestic app s, such as qqplayer 👍🏻 ️ ) h404bi/dorado
- ash258: Ash258/scoop-Ash258
- java: after adding, you can install various jdk and jre through it
- Nerd fonts: contains various fonts
# Add bucket first scoop bucket add extras scoop bucket add nirsoft scoop bucket add dorado https://github.com/h404bi/dorado scoop bucket add Ash258 'https://github.com/Ash258/Scoop-Ash258.git' scoop bucket add nerd-fonts # For developers, you can add the following two scoop bucket add java scoop bucket add versions