How To Create a Debian/Ubuntu Repository for DEB Packages
Initial Setup
Required Debian packages: reprepro- Create a directory for the repository and its configuration:
$ mkdir -p repo/conf
- Create a conf/distributions configuration file like this:
- Put my putinrepo script into the repo or next to it:
- "Export" the repo to create the metadata files for the empty repo:
$ repo/putinrepo.sh $ tree repo repo ├── putinrepo.sh ├── conf │ └── distributions ├── db │ ├── checksums.db │ ├── contents.cache.db │ ├── packages.db │ ├── references.db │ ├── release.caches.db │ └── version └── dists ├── precise │ ├── main │ │ ├── binary-amd64 │ │ │ ├── Packages │ │ │ ├── Packages.gz │ │ │ └── Release │ │ ├── binary-armel │ │ │ ├── Packages │ │ │ ├── Packages.gz │ │ │ └── Release │ │ └── binary-i386 │ │ ├── Packages │ │ ├── Packages.gz │ │ └── Release │ └── Release ├── quantal │ ├── main │ │ ├── binary-amd64 │ │ │ ├── Packages │ │ │ ├── Packages.gz │ │ │ └── Release │ │ ├── binary-armel │ │ │ ├── Packages │ │ │ ├── Packages.gz │ │ │ └── Release │ │ └── binary-i386 │ │ ├── Packages │ │ ├── Packages.gz │ │ └── Release │ └── Release └── raring ├── main │ ├── binary-amd64 │ │ ├── Packages │ │ ├── Packages.gz │ │ └── Release │ ├── binary-armel │ │ ├── Packages │ │ ├── Packages.gz │ │ └── Release │ └── binary-i386 │ ├── Packages │ ├── Packages.gz │ └── Release └── Release 18 directories, 37 files
$ sudo tee /etc/apt/sources.list.d/my_repo.list <<EOF deb file:///$(pwd)/repo quantal main EOF
Adding Packages
putinrepo.sh <deb-files>
is used to add packages to a distribution in the repo. It will automatically add the package to all codenames. Set REPREPRO_CODENAMES
to an array of codenames if you want to select the targets.Signing the Repository
apt complains if you don't sign the repo. Luckily that is really simple: Just add SignWith: yes to each section in the conf/distributions file to sign the repo with your default GPG key.
Adding a new Distribution
Adding a new distribution, e.g. wheezy, is simple:
- Create a new block in conf/distributions
- Run reprepro copymatched wheezy raring \* to copy all packages from raring to wheezy or use one of the other copy* functions to populate the new codename with content
- Run putinrepo.sh to export and sign the repo
Comments
Post a Comment