An alternative solution to host a repository for APT which is more easy to maintain is using Sonatype's Nexus3 Repository Manager. Firstly install Sonatype's Nexus3:
sudo apt install openjdk-17-jdk
nexus
to run Nexus3: adduser nexus
https://help.sonatype.com/en/download.html
/opt/
: tar xzvf <downloaded-tar-package>.tar.gz -C /opt
chown nexus -R /opt/nexus-<version>
chmod +x /opt/nexus-<version>/bin/nexus
nexus.service
and copy it to /etc/systemd/system
(keep in mind to add the nexus version): [Unit] Description=nexus service After=network.target [Service] Type=forking Environment="NEXUS_SECRETS_KEY_FILE=/opt/sonatype-work/nexus3/keystores/nexus.secrets.json" LimitNPROC=65536 LimitNOFILE=65536 ExecStart=/opt/nexus-<version>/bin/nexus start ExecStop=/opt/nexus-<version>/bin/nexus stop User=nexus Restart=on-abort TimeoutSec=600 [Install] WantedBy=multi-user.target
cp nexus.service /etc/systemd/system
systemctl start nexus.service
systemctl enable nexus.service
http://<ip>:8081/
admin
is located under /opt/sonatype/sonatype-work/nexus3/admin.password
after entering the password, it's forced to be changed.cat /opt/sonatype/sonatype-work/nexus3/admin.password
The installation of Nexus is now finished!
Then add the repository:
gpg
and generate a key with gpg --gen-key
. Then export the key with to paste it under APT Settings
:
gpg --export-secret-key --armor <KEY-ID> > Key.gpg
apt
, and set the distribution e.g. to stable
gpg --armor --export <KEY-ID> > Key.gpg
echo "deb [signed-by=/usr/share/keyrings/your-repo.gpg] https://<your-repo>/repository/apt/ stable main" | sudo tee /etc/apt/sources.list.d/<your-repo>.list
curl -sS https://<your-repo>/repository/storage/ReleaseKey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/<your-repo>.gpg > /dev/null
Sourced from: