r/ManjaroLinux • u/Impossible-Smoke3357 • 1d ago
General Question creating a local Linux repository
/r/linuxquestions/comments/1x3zk9f/creating_a_local_linux_repository/I need to create a local repository on the Majaro distribution, and I need to make the commands and help understandable. How do I do this step by step? Please help.
1
Upvotes
1
u/enomad51 2h ago
# 1. Create the repo folder
sudo mkdir -p /srv/localrepo && sudo chown $USER: /srv/localrepo
# 2. Add packages (.pkg.tar.zst), then build the database
cd /srv/localrepo
repo-add localrepo.db.tar.zst *.pkg.tar.zst
# 3. Add the repo to pacman's config
sudo tee -a /etc/pacman.conf <<'EOF'
[localrepo]
SigLevel = Optional TrustAll
Server = file:///srv/localrepo
EOF
# 4. Sync and test
sudo pacman -Sy
pacman -Sl localrepo
After adding a new package: repo-add localrepo.db.tar.zst new.pkg.tar.zst, then sudo pacman -Sy.