Arch Linux is one of the most popular Linux distros out there. But unfortunately, the official Arch repo has significantly fewer packages than Ubuntu or Debian. Users mostly rely on AUR for the packages not available in the official repo. AUR comes with a catch- a user must build the packages locally using makepkg
or an AUR helper. Although repo for prebuild AUR packages (like Chaotic AUR) exists. They do not contain all the packages a user wants. This program enables Arch Linux users to have their personal repo with packages they want.
-
Clone the repo
git clone https://github.com/rafiibrahim8/private-arch-repo.git && cd private-arch-repo
-
Create
gnupg.tar.gz
(see CREATING/EDITING FILES) -
Edit
internal-scripts/init-image.sh
(see CREATING/EDITING FILES) -
Run
make-image.sh
bash make-image.sh
-
Edit packages on
aur_packages.json
andnon-aur-packages
accoding to your need (see EDITING PACKAGES). -
Edit
run.sh
(see CREATING/EDITING FILES) -
Copy/Move
aur_packages.json
andnon-aur-packages
toHOST_REPO_PKG_DIR
of yourrun.sh
file. -
Run
run.sh
bash run.sh
-
Create a new file on
/etc/nginx/sites-available
namedarch-repo.conf
and paste following into it:server { listen 80; server_name arch-repo.local; location / { root <cloned repo path>/output/; autoindex on; } }
N.B: Replace
<cloned repo path>
avobe with the absolute path where you cloned this repo. -
Run the following commands:
echo "127.0.0.1 arch-repo.local" | sudo tee -a /etc/hosts sudo systemctl enable nginx sudo systemctl restart nginx
-
Add the following line at the end of
/etc/pacman.conf
:[private-arch-repo] Server = http://arch-repo.local
-
Run the following commands:
sudo pacman-key --recv-keys <Key ID> sudo pacman-key --lsign-key <Key ID>
N.B: Replace
<Key ID>
avobe with the Key ID obtained during creatinggnupg.tar.gz
.
You can add AUR and non-AUR packages to the build system.
-
To add AUR packages simply edit
aur_packages.json
file. The file is a json array of packages. -
To add non-AUR packages make a folder in
non-aur-packages
with the package name. The folder must have two filesconfigure.py
andconfig.json
.configure.py
will genaratePKGBUILD
file andconfig.json
will contain config values.
gnupg.tar.gz
contains keys to sign packages.
To create it follow the steps
-
Backup your current keys:
mv .gnupg .gnupg.bak
-
Create new key
gpg --full-generate-key
You will get output like:
pub rsa3072 2021-02-21 [SC] [expires: 2026-02-20] 410B637614A906DFAA2B26DC9AE4D939F0C017EF uid John Doe <me@example.com> sub rsa3072 2022-02-21 [E] [expires: 2027-02-20]
Here
410B637614A906DFAA2B26DC9AE4D939F0C017EF
is your Key ID. We will need this later. -
Upload Key
gpg --send-keys <Key ID>
-
Create
gnupg.tar.gz
cd tar -cvf gnupg.tar.gz .gnupg rm -r .gnupg
-
Restore backup
mv .gnupg.bak .gnupg
The lines between <Edit this values>
and </Edit this values>
on internal-scripts/init-image.sh
contains editable parameters.
The parameters are follows:
FULL_NAME
: Your full nameEMAIL
: Your email addressKEY
: Key IDREPO_NAME
: Name of your repositoryMIRRIRLIST_URL
: Pacman mirrorlist file url
The lines between <Edit this values>
and </Edit this values>
on run.sh
contains editable parameters.
The parameters are follows:
HOST_REPO_DIR
: Local Machine directory where the packages will be savedHOST_REPO_PKG_DIR
: The local directory which will containaur_packages.json
andnon-aur-packages
This is very early stage of the program. It might be very buggy. You are always welcome to create an issue or submit a pull request.