Ir al contenido

Scoop

Scoop is a command-line installer for Windows that simplifies package management. It installs programs to isolated directories, avoiding conflicts and registry pollution. Scoop is ideal for command-line tools, development utilities, and portable applications.

Installation

Prerequisites

# PowerShell 5.0+ required (check version)
$PSVersionTable.PSVersion

# Allow script execution (if needed)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

# Verify git is installed
git --version

# .NET Framework 4.5+ (for some apps)

Install Scoop

# Quick install (default to $HOME\scoop)
iwr -useb get.scoop.sh | iex

# Custom installation path
$env:SCOOP='D:\Applications\Scoop'
[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'User')
iwr -useb get.scoop.sh | iex

# Global scoop (all users)
$env:SCOOP='C:\Scoop'
$env:SCOOP_GLOBAL='C:\ProgramData\Scoop'
[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'Machine')
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine')
iwr -useb get.scoop.sh | iex

# Verify installation
scoop --version
scoop help

Basic Package Management

Search and Install

# Search for packages
scoop search git
scoop search "visual*"  # Wildcard search

# Search in specific bucket
scoop search nodejs -b main

# Get detailed package info
scoop info nodejs
scoop info git

# Install package
scoop install git

# Install specific version
scoop install nodejs@16.0.0

# Install with alternatives
scoop install git scoop-completion

# Install multiple packages
scoop install nodejs npm yarn python

# Install from URL/path
scoop install https://example.com/app.json
scoop install .\manifest.json

Update and Uninstall

# List installed packages
scoop list
scoop list | Select-Object -Property Name

# Show package status
scoop status

# Update specific package
scoop update git

# Update all packages
scoop update *

# Update scoop itself
scoop update scoop

# Uninstall package
scoop uninstall git

# Uninstall and remove data
scoop uninstall git --purge

# Uninstall multiple packages
scoop uninstall git nodejs python

# Show uninstall cache
scoop cache show
scoop cache rm git

Bucket Management

Working with Buckets

# List all buckets
scoop bucket list

# Add official buckets
scoop bucket add main
scoop bucket add extras
scoop bucket add versions
scoop bucket add nerd-fonts
scoop bucket add games

# Add community buckets
scoop bucket add java https://github.com/ScoopInstaller/Java
scoop bucket add php https://github.com/ScoopInstaller/PHP
scoop bucket add nodejs https://github.com/ScoopInstaller/Nodejs

# Search in specific bucket
scoop search powershell -b extras

# List packages in bucket
scoop bucket known  # Show all known buckets

# Remove bucket
scoop bucket rm extras

# Update all buckets
scoop bucket update -a

# Create custom bucket
scoop bucket add mybucket https://github.com/user/scoop-mybucket

Common Buckets

# Main (default, essential tools)
scoop bucket add main

# Extras (GUI apps, uncommon tools)
scoop bucket add extras

# Versions (alternative versions of packages)
scoop bucket add versions

# Nerd Fonts (icon fonts)
scoop bucket add nerd-fonts

# Games (open source games)
scoop bucket add games

# Java (JDK distributions)
scoop bucket add java

# Development tools
scoop bucket add devtools https://github.com/ScoopInstaller/DevTools

Advanced Installation

Install Modes and Options

# Standalone portable app (no installation)
scoop install portable-app

# Architecture-specific
scoop install nodejs-lts@x32  # 32-bit
scoop install nodejs@x64       # 64-bit

# Install to global scope (admin required)
scoop install -g git

# Hold package (prevent updates)
scoop hold git nodejs

# Unhold package
scoop unhold git

# Force reinstall
scoop install -f git

# Skip hash verification
scoop install --no-hash-check git

# Verbose installation
scoop install -vv git

Dependency and Alternatives

# Show package dependencies
scoop info git
# Look for "Depends on" field

# Install with dependencies
scoop install php

# Check conflicts
scoop install node-lts  # May conflict with nodejs

# Use alternatives
scoop install node-lts@16.0.0
scoop uninstall nodejs

Package Management Features

Cleanup and Maintenance

# Cleanup cached installers
scoop cache rm *
scoop cache rm git nodejs

# Remove old versions
scoop cleanup git
scoop cleanup *

# Cleanup all and remove cache
scoop cache purge
scoop cleanup --all

# Check for broken shims
scoop checkup

# Show scoop size
scoop cache list | Measure-Object -Property Size -Sum

# Remove unused dependencies
scoop update *
scoop cleanup *

Version Management

# List available versions
scoop search nodejs
scoop bucket versions-bucket/nodejs  # Show all versions

# Install specific version
scoop install nodejs@14.0.0

# Switch versions
scoop reset nodejs@14.0.0   # Downgrade to v14
scoop reset nodejs          # Use latest

# Install multiple versions
scoop install versions/python27
scoop install versions/python310

# Show installed versions
scoop list

Shims (Command Shortcuts)

# Scoop creates shims for executables
# Located in: $SCOOP\shims (or $SCOOP_GLOBAL\shims)

# View shim target
scoop which git

# List all shims
dir $env:SCOOP\shims

# Add shims to PATH (usually automatic)
$env:PATH = "$env:SCOOP\shims;$env:PATH"

# Update shims
scoop update scoop

# Resolve shim conflicts
scoop which python
scoop reset python

Creating Manifests

Manifest Structure

{
  "version": "1.0.0",
  "description": "Brief description",
  "homepage": "https://example.com",
  "license": "MIT",
  "architecture": {
    "64bit": {
      "url": "https://example.com/download/app-64bit.zip",
      "hash": "sha256:abc123..."
    },
    "32bit": {
      "url": "https://example.com/download/app-32bit.zip",
      "hash": "sha256:def456..."
    }
  },
  "bin": "app.exe",
  "shortcuts": [
    [
      "app.exe",
      "Application Name"
    ]
  ],
  "persist": [
    "config",
    "data"
  ],
  "post_install": [
    "# Post-install commands"
  ]
}

Manifest Examples

{
  "version": "2.5.0",
  "description": "Git for Windows",
  "homepage": "https://git-scm.com",
  "license": "GPL-2.0",
  "url": "https://github.com/git-for-windows/git/releases/download/v2.5.0.windows.1/Git-2.5.0-64-bit.exe",
  "hash": "sha256:f39e0a26a1bbf5a9865e7f43c9c17ee91e15a28f",
  "bin": "cmd\\git.exe",
  "checkver": {
    "github": "git-for-windows/git",
    "regex": "v([\\w.]+)"
  },
  "autoupdate": {
    "url": "https://github.com/git-for-windows/git/releases/download/v$version.windows.1/Git-$version-64-bit.exe",
    "hash": {
      "url": "$url.sha256"
    }
  }
}

Testing Manifests

# Validate manifest syntax
scoop install assume

# Test local manifest
scoop install .\my-app.json

# Test with dependencies
scoop info .\my-app.json

# Create test manifest
New-Item manifest.json -ItemType File

# Install from local path
scoop install -f C:\Users\User\manifest.json

Configuration

Config Commands

# View all settings
scoop config list

# Get specific setting
scoop config get SCOOP_REPO

# Set configuration
scoop config SCOOP_REPO https://github.com/ScoopInstaller/Scoop
scoop config SCOOP_BRANCH develop

# Reset to default
scoop config rm SCOOP_REPO

# Common configurations
scoop config proxy [IP]:[PORT]  # Set proxy
scoop config proxy_username username
scoop config proxy_password password
scoop config no_junction $true  # Use symlinks instead

# Check configuration file
$PROFILE\..\\.scoop\config.json

Environment Configuration

# Customize Scoop paths
$env:SCOOP = 'D:\Scoop'
$env:SCOOP_GLOBAL = 'C:\Program Files\Scoop'

# Persistent environment variables
[Environment]::SetEnvironmentVariable('SCOOP', 'D:\Scoop', 'User')
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', 'C:\ProgramData\Scoop', 'Machine')

# Disable automatic updates
scoop config autoupdate_interval 0

# Enable checkup on startup
scoop checkup

Integration and Automation

PowerShell Automation

#!/usr/bin/env pwsh
# Install development tools

$packages = @(
    'git'
    'nodejs'
    'python'
    'vscode'
    'docker'
    'wsl2'
)

foreach ($package in $packages) {
    Write-Host "Installing $package..."
    scoop install $package
    if ($LASTEXITCODE -ne 0) {
        Write-Error "Failed to install $package"
    }
}

# Update all
scoop update *

# Show installed versions
scoop list

Batch Installation

# Install developer environment
scoop bucket add extras
scoop bucket add java

$devTools = @(
    'git'
    'nodejs'
    'python'
    'openjdk11'
    'gradle'
    'maven'
    'vscode'
    'git-credential-manager'
)

scoop install @devTools

# Verify installations
foreach ($tool in $devTools) {
    scoop info $tool | Select-Object Name, Version
}

Troubleshooting

Common Issues

Issue: Command not found after install

# Refresh PATH
$env:PATH = [System.Environment]::GetEnvironmentVariable("PATH","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("PATH","User")

# Restart PowerShell or Terminal

# Check shim location
scoop which git

# Verify installation
scoop list | grep git

Issue: Permission denied / Admin required

# Run PowerShell as Administrator
Start-Process powershell -Verb RunAs

# Install globally (requires admin)
scoop install -g git

# Check if already installed
scoop list | Select-Object Name

# Uninstall and reinstall
scoop uninstall git
scoop install git

Issue: Hash mismatch / Download failure

# Force update hash
scoop cache rm git
scoop install -f git

# Check manifest
scoop info git

# Use specific version
scoop install git@2.35.0

# Skip hash check (risky)
scoop install --no-hash-check git

Issue: Bucket errors / Network issues

# Update buckets
scoop bucket update -a

# Resync buckets
scoop bucket list
scoop bucket rm main
scoop bucket add main

# Check connectivity
Test-Connection github.com

# Set proxy if needed
scoop config proxy [IP]:[PORT]
scoop config proxy_username user
scoop config proxy_password pass

Best Practices

Installation Strategy

  • Use buckets appropriately (main for essentials, extras for tools)
  • Hold packages when specific versions are required
  • Regularly update all packages (scoop update *)
  • Clean up old versions (scoop cleanup *)
  • Test new versions before updating critical tools
  • Use global scope (-g) sparingly, only for system-wide needs

Security

  • Verify package sources and maintainers
  • Check hash verification is enabled
  • Review manifests before installation
  • Keep Scoop and all packages updated
  • Use from official buckets when available
  • Avoid installing packages from untrusted sources
  • Regularly run scoop checkup

Organization

  • Maintain custom buckets for internal tools
  • Document custom package manifests
  • Use version pinning for production tools
  • Separate development and user environments
  • Create scripted installation profiles
  • Version control installation scripts

Maintenance

  • Run scoop update * regularly
  • Clean cache weekly: scoop cache rm *
  • Cleanup old versions: scoop cleanup *
  • Monitor disk usage
  • Check for broken shims: scoop checkup
  • Archive old application versions if needed

Last updated: 2026-03-30