This guide will help you host an APT repository on Github.
You need to install the following packages.
- reprepro
$ sudo apt install -y reprepro
Create a new folder containing the repo.
# Change <repo-name> to the repo folder
$ mkdir -p <repo-name>/{conf,incoming}
# Create the distributions file
$ cat <<EOF >> conf/distributions
Origin: Foo
Label: Foo Github
Suite: stable
Codename: bionic
Architectures: amd64
Components: main
Description: Debian x64 github repository
EOF
Get the key using the following command, then copy the output and add it to GPG keys in Github settings.
# List secret keys on your machine and copy your key id
$ gpg --list-secret-keys --keyid-format LONG
# Export the key and copy the output
$ gpg --armor --export <key-id>
Open the file /etc/apt/sources.list
and add the following line. Make sure to fill in the fields <repo-owner>
, <repo-name>
, <Codename>
and <Component>
with your own values.
deb [arch=amd64] https://raw.githubusercontent.com/<repo-owner>/<repo-name>/master <Codename> <Component>
Or run this command:
$ sudo add-apt-repository -y "deb [arch=amd64] https://raw.githubusercontent.com/<repo-owner>/<repo-name>/master <Codename> <Component>"
Add the key to APT using apt-key
.
$ gpg --armor --export <key-id> | sudo apt-key add -
First, copy the deb
file to incoming
folder.
$ cd <repo-name>
# You may to change the section, component and priority to the values you want.
# The deb file should follow this format: <package-name>_<version>_<architecture>.deb
$ reprepro -V \
--section utils \
--component main \
--priority 0 \
includedeb bionic incoming/<package-name>_<version>_<architecture>.deb
Push your repository to Github then update your APT cache.
$ sudo apt update
# Now you can try to install a package from your repository :)
$ sudo apt install <package-name>
Create a debian package:
http://www.king-foo.com/2011/11/creating-debianubuntu-deb-packages/