Skip to content

Installation Guide

Mikhail Deynekin edited this page Dec 22, 2025 · 1 revision

Installation Guide

This guide provides comprehensive instructions for installing sr-search-replace across multiple platforms and environments.

System Requirements

Minimum Requirements

  • RAM: 256 MB
  • Disk Space: 50 MB for application + dependencies
  • .NET Framework: 4.6.1 or higher (Windows)
  • Perl: 5.8+ (Unix-like systems)

Recommended Requirements

  • RAM: 2+ GB
  • CPU: Multi-core processor
  • SSD: For optimal performance with large files
  • .NET Framework: 4.8+ (Windows)
  • Perl: 5.20+ with additional modules

Supported Platforms

Linux Distributions

  • Ubuntu: 18.04 LTS, 20.04 LTS, 22.04 LTS
  • Debian: 10, 11, 12
  • CentOS/RHEL: 7, 8, 9
  • Fedora: 35+
  • Arch Linux: Current release
  • Alpine Linux: 3.13+

macOS

  • Intel-based: macOS 10.13+
  • Apple Silicon: macOS 11.0+ (ARM64)

Windows

  • Windows Server: 2012 R2, 2016, 2019, 2022
  • Windows Desktop: Windows 7 SP1, 8.1, 10, 11

Other Unix-like Systems

  • BSD: FreeBSD 11+, OpenBSD 6.5+
  • WSL2: Windows Subsystem for Linux 2

Installation Methods

Method 1: Direct Download (Windows)

# Download the latest release
$DownloadUrl = "https://github.com/paulmann/sr-search-replace/releases/download/latest/sr.exe"
$OutputPath = "$env:ProgramFiles\sr-search-replace\sr.exe"

New-Item -ItemType Directory -Path "$env:ProgramFiles\sr-search-replace" -Force
Invoke-WebRequest -Uri $DownloadUrl -OutFile $OutputPath

# Add to PATH
$env:Path += ";$env:ProgramFiles\sr-search-replace"
[Environment]::SetEnvironmentVariable(
    "Path",
    $env:Path,
    "User"
)

Method 2: Git Clone (Development)

# Clone the repository
git clone https://github.com/paulmann/sr-search-replace.git
cd sr-search-replace

# Build from source
make build
make install

# Verify installation
sr --version

Method 3: Package Manager (Linux)

Ubuntu/Debian

sudo add-apt-repository ppa:paulmann/sr-search-replace
sudo apt-get update
sudo apt-get install sr-search-replace

Fedora/CentOS

sudo dnf install sr-search-replace
# or for CentOS 7
sudo yum install sr-search-replace

Arch Linux

git clone https://aur.archlinux.org/sr-search-replace.git
cd sr-search-replace
makepkg -si

Method 4: Docker Installation

# Pull Docker image
docker pull paulmann/sr-search-replace:latest

# Create container
docker run -v /path/to/files:/data \\
  paulmann/sr-search-replace:latest \\
  sr --help

Method 5: Kubernetes Deployment

apiVersion: v1
kind: ConfigMap
metadata:
  name: sr-config
data:
  sr-config.json: |
    {
      "enableBackup": true,
      "binaryDetection": true,
      "sessionTracking": true
    }
---
apiVersion: batch/v1
kind: Job
metadata:
  name: sr-search-replace-job
spec:
  template:
    spec:
      containers:
      - name: sr
        image: paulmann/sr-search-replace:latest
        volumeMounts:
        - name: data
          mountPath: /data
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: data-pvc
      restartPolicy: Never

Post-Installation Configuration

Verify Installation

# Check version
sr --version

# Display help information
sr --help

# Run diagnostic
sr --diagnose

Initial Setup

1. Create Configuration Directory

mkdir -p ~/.config/sr-search-replace
cd ~/.config/sr-search-replace

2. Initialize Configuration File

sr --init-config

3. Set Permissions

# Unix-like systems
chmod 755 ~/.config/sr-search-replace
chmod 644 ~/.config/sr-search-replace/config.json

Environment Variables

# Set configuration path
export SR_CONFIG_PATH="$HOME/.config/sr-search-replace/config.json"

# Enable verbose logging
export SR_LOG_LEVEL="DEBUG"

# Set backup directory
export SR_BACKUP_DIR="$HOME/.local/share/sr-search-replace/backups"

# Make permanent (add to ~/.bashrc or ~/.zshrc)
echo 'export SR_CONFIG_PATH="$HOME/.config/sr-search-replace/config.json"' >> ~/.bashrc
source ~/.bashrc

Troubleshooting Installation

Common Issues

Issue: Command not found

# Solution 1: Add to PATH
export PATH="$PATH:/opt/sr-search-replace/bin"

# Solution 2: Create symbolic link
sudo ln -s /opt/sr-search-replace/bin/sr /usr/local/bin/sr

# Solution 3: Verify installation
which sr

Issue: Permission Denied

# Fix permissions
sudo chown -R $(whoami) ~/.config/sr-search-replace
sudo chmod -R 755 ~/.config/sr-search-replace

Issue: Missing Dependencies

# Install required Perl modules
sudo cpan install Text::Xslate
sudo cpan install JSON::PP
sudo cpan install File::Find::Rule

Uninstallation

Windows

# Remove application directory
Remove-Item -Path "$env:ProgramFiles\sr-search-replace" -Recurse -Force

# Remove from PATH (if needed)

Linux/macOS

# Via package manager
sudo apt-get remove sr-search-replace  # Debian/Ubuntu
sudo dnf remove sr-search-replace      # Fedora/CentOS

# Via manual installation
sudo rm -rf /opt/sr-search-replace
sudo rm /usr/local/bin/sr

Remove Configuration

rm -rf ~/.config/sr-search-replace
rm -rf ~/.local/share/sr-search-replace

Next Steps

After successful installation, proceed to:

Clone this wiki locally