-
-
Notifications
You must be signed in to change notification settings - Fork 2
Linux Custom Repositories
Complete beginner-friendly guide to custom repositories on Linux, covering Arch Linux, CachyOS, and other distributions including creating repositories, adding packages, and repository management.
Note: This guide focuses on Arch-based distributions (Arch Linux, CachyOS) as they use
pacmanand have specific repository tools. Other distributions have different package managers and repository systems.
Create repository:
# Create directory
mkdir -p ~/repo
# Initialize repository
repo-add ~/repo/custom.db.tar.gz
# Or use repo-add with package
repo-add ~/repo/custom.db.tar.gz package.pkg.tar.zstWhat it does:
- Creates repository database
- Stores package metadata
- Enables package installation
Add to repository:
# Add package
repo-add ~/repo/custom.db.tar.gz package.pkg.tar.zst
# Add multiple
repo-add ~/repo/custom.db.tar.zst *.pkg.tar.zst
# Update existing
repo-add ~/repo/custom.db.tar.zst package.pkg.tar.zstUpdate:
# Update database
repo-add ~/repo/custom.db.tar.zst package.pkg.tar.zst
# Or rebuild
repo-add -n ~/repo/custom.db.tar.zst ~/repo/*.pkg.tar.zstConfigure pacman:
# Edit pacman.conf
sudo vim /etc/pacman.confAdd:
[custom]
SigLevel = Optional TrustAll
Server = file:///home/user/repo
Sync:
# Update database and upgrade (recommended)
# Note: Use -Syu to avoid dependency issues
sudo pacman -Syu
# Install from custom repo
sudo pacman -S package-nameRemove from repository:
# Remove package
repo-remove ~/repo/custom.db.tar.zst package-nameCreate repository:
# Install tools
sudo apt install reprepro
# Create repository
mkdir -p ~/repo/conf
vim ~/repo/conf/distributionsCreate repository:
# Install tools
sudo dnf install createrepo
# Create repository
createrepo ~/repoCheck repository:
# Check database
tar -tzf ~/repo/custom.db.tar.gz
# Rebuild repository
repo-add -n ~/repo/custom.db.tar.zst ~/repo/*.pkg.tar.zst
# Verify packages
ls -lh ~/repo/*.pkg.tar.zstVerify:
# Check repository
pacman -Ss package-name
# Check package info
pacman -Si package-name
# Verify package
pacman -Ql package-nameThis guide covered creating repositories, adding packages, and repository management for Arch Linux, CachyOS, and other distributions.
- Package Management - Package management
- Arch Build System - Building packages
- ArchWiki Custom Repositories: https://wiki.archlinux.org/title/Pacman/Tips_and_tricks#Custom_local_repository
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.