User:Fstirlitz/maintaining a private repo

From ArchWiki

useful for having lots of AUR packages installed

creating the repo

  1. create a signing key (you can skip this step and use an existing key if you wish)
    $ gpg --gen-key
  2. add it to your pacman keyring
    $ gpg --export -a $KEYID | sudo pacman-key --add -
    $ sudo pacman-key --edit $KEYID
    gpg> trust
    ? 4
    gpg> lsign
    gpg> save
  3. create a dedicated directory for your packages
    $ mkdir -p ~/packages/repo
  4. configure makepkg to use it in ~/.makepkg.conf
    GPGKEY=... # put your key id here
  5. add it as your repository in /etc/pacman.conf
    SigLevel = Required
    Server = file:///.../packages/repo

updating packages

  1. build all the packages you want to update
  2. update the package index
    $ cd ~/packages/repo
    $ repo-add -q -k "$KEYID" -s custom.db.tar.xz ${package_names[@]}

    to regenerate the index from scratch, use

    $ cd ~/packages/repo
    $ rm custom.db.tar.xz
    $ repo-add -q -k "$KEYID" -s custom.db.tar.xz *.pkg.tar.xz
  3. update packages with pacman
    # pacman -Suy

there should be a script to automate this.