Skip to content

Linux Custom Repositories

Mattscreative edited this page Dec 5, 2025 · 3 revisions

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 pacman and have specific repository tools. Other distributions have different package managers and repository systems.


Table of Contents

  1. Creating Repository
  2. Adding Packages
  3. Repository Management
  4. Other Distributions
  5. Troubleshooting

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


This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.

Clone this wiki locally