- Arch Linux system
- sudo privileges
- AWS account with S3 access (optional, for remote hosting)
- Update your system:
sudo pacman -Syu
- Install necessary dependencies:
sudo pacman -S base-devel git
- Install createrepo_c from AUR:
git clone https://aur.archlinux.org/createrepo_c.git
cd createrepo_c
makepkg -si
- Install AWS CLI (if you plan to use S3):
sudo pacman -S aws-cli
- Create a directory for your repository:
sudo mkdir -p /var/repo/your_repo_name
-
Copy your RPM packages to this directory.
-
Generate repository metadata:
sudo createrepo_c /var/repo/your_repo_name
- Install rpm-sign:
git clone https://aur.archlinux.org/rpm-sign.git
cd rpm-sign
makepkg -si
- Generate a GPG key:
gpg --full-generate-key
- Export the public key:
gpg --armor --export Your-Key-ID > RPM-GPG-KEY-YourName
- Sign your packages:
rpm --addsign /var/repo/your_repo_name/*.rpm
- Install a web server (e.g., nginx):
sudo pacman -S nginx
- Configure nginx to serve your repository:
server {
listen 80;
server_name your_domain.com;
root /var/repo;
autoindex on;
}
- Start and enable nginx:
sudo systemctl start nginx
sudo systemctl enable nginx
- Configure AWS CLI:
aws configure
- Sync your repository to S3:
aws s3 sync /var/repo/your_repo_name s3://your-bucket-name/your-repo-path/
- Make sure to upload your GPG public key as well:
aws s3 cp RPM-GPG-KEY-YourName s3://your-bucket-name/your-repo-path/
On the client machines that will use your repository:
- Create a new .repo file:
sudo vi /etc/yum.repos.d/your-repo.repo
- Add the following content:
[your-repo]
name=Your Custom Repository
baseurl=http://your_domain.com/your_repo_name/
# or for S3: https://your-bucket-name.s3.amazonaws.com/your-repo-path/
enabled=1
gpgcheck=1
gpgkey=http://your_domain.com/your_repo_name/RPM-GPG-KEY-YourName
# or for S3: https://your-bucket-name.s3.amazonaws.com/your-repo-path/RPM-GPG-KEY-YourName
- Import the GPG key:
sudo rpm --import http://your_domain.com/your_repo_name/RPM-GPG-KEY-YourName
# or for S3: sudo rpm --import https://your-bucket-name.s3.amazonaws.com/your-repo-path/RPM-GPG-KEY-YourName
- Clean and update YUM/DNF cache:
sudo yum clean all && sudo yum makecache # for YUM
# or
sudo dnf clean all && sudo dnf makecache # for DNF
When you add new packages:
- Add the new RPMs to your repository directory.
- Update the repository metadata:
sudo createrepo_c --update /var/repo/your_repo_name
- If using S3, sync again:
aws s3 sync /var/repo/your_repo_name s3://your-bucket-name/your-repo-path/
- Ensure all necessary ports are open if hosting locally.
- Check S3 bucket permissions if using remote hosting.
- Verify GPG key import on client machines for signing issues.
- Review /var/log/yum.log or /var/log/dnf.log on client machines for detailed logs.
Remember to keep your AWS credentials and GPG keys secure. Never share them publicly or include them in configuration files.
[root@377f1d618d07 /]# cat /etc/yum.repos.d/invinsense.repo
[root@377f1d618d07 /]#