Linux Custom Repositories - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux Custom Repositories Guide
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.
Table of Contents
Creating Repository
Setup Repository
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.zst
What it does:
- Creates repository database
- Stores package metadata
- Enables package installation
Adding Packages
Add Package
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.zst
Update Repository
Update:
# 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.zst
Repository Management
Add to pacman.conf
Configure pacman:
# Edit pacman.conf
sudo vim /etc/pacman.conf
Add:
[custom]
SigLevel = Optional TrustAll
Server = file:///home/user/repo
Sync Repository
Sync:
# Update database and upgrade (recommended)
# Note: Use -Syu to avoid dependency issues
sudo pacman -Syu
# Install from custom repo
sudo pacman -S package-name
Remove Package
Remove from repository:
# Remove package
repo-remove ~/repo/custom.db.tar.zst package-name
Other Distributions
Debian/Ubuntu
Create repository:
# Install tools
sudo apt install reprepro
# Create repository
mkdir -p ~/repo/conf
vim ~/repo/conf/distributions
Fedora
Create repository:
# Install tools
sudo dnf install createrepo
# Create repository
createrepo ~/repo
Troubleshooting
Repository Errors
Check 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.zst
Package Installation Issues
Verify:
# Check repository
pacman -Ss package-name
# Check package info
pacman -Si package-name
# Verify package
pacman -Ql package-name
Summary
This guide covered creating repositories, adding packages, and repository management for Arch Linux, CachyOS, and other distributions.
Next Steps
- 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.