5

I need to create debian repository to keep our software packages, but the main point here is to allow multiple versions of software be keep in it to rollback if needed. reprepo is unable to do that, and it seems that debarchiver is also can't

I can just use dpkg-scanpackage -m to generate packages.gz but more interesting is to create fully featured repo, with pinning and gpg signatures support

Any advice? Thanks

1
  • There is the outstanding reprepro Debian bug #570623 that requests multiple version management support. I have implemented that feature five years ago (details see Debian bug) and have been using it since then. You can find the code on Github: github.com/profitbricks/reprepro Jan 19, 2019 at 19:56

3 Answers 3

1

I do it the way the postgresql project does it http://apt.postgresql.org/pub/repos/. I add one more directory level for dist (ie. ubuntu or debian).

There is almost no mention of how to use components this way anywhere. What I am about to show is probably the most you will find on the subject in any one place.

So let's say you have your own app call foobar. My suggested directory structure would be /var/www/repos/apt/debian/ with repos being the root web folder. You could also make apt the root web folder if you only have apt and no yum or ? repos.

/conf/distributions file below that directory would be something like:

Origin: foobar project
Label: foobar project
Codename: foobar
Architectures: i386 amd64
Components: main v1 v2 3 7.1
Description: Apt repository for project foobar
SignWith: XXXXXXX

In addition to the main component that all the documentation talks about, we are adding our own custom component names v1, v2, 3, 7.1. You can use any string and add as many as you like. You are not limited to the standard ones all the documentation talks about.

If you do not use the -C flag it defaults to main. To copy into the v1 component directory and assuming those debs are located in /usr/src/

cd /var/www/repos/apt/debian
reprepro -C v1 includedeb foobar /usr/src/*.deb

Or if you want to create a 7.1 component directory and assuming we have those debs in /usr/src/7.1/(for example):

reprepro -C 7.1 includedeb foobar /usr/src/7.1/*.deb

That will create a 7.1 component directory in /var/www/apt/debian/pool/7.1

Then you add your repo in /etc/apt/sources.list.d/mycustomrepo.list

deb http://packages.mydomain.com/repos/apt/debian foobar main v2 3 7.1

Now you have access to versions in main, v2, 3, and 7.1. You can also change what versions you have access to all on that one line in mycustomrepo.list

If this is not your own project but say a repo with stock and/or custom debian OS packages, then instead of foobar you would just use the debian os name such as stretch which is how most documentation talks about it when explaining repos.

This is probably the best way but if you don't want to use components you could do the versioning in the app name. So foobar_v1, foobar_v2, foobar_3, foobar_7.1. But now your repo file would need a separate line for each version you want access to. It also changes your workflow when doing changes adds/removes.

There is also the way mariadb does it with separate root folders for versions. http://mariadb.mirror.globo.tech/repo/

But that assumes you are only using apt and the repo is only for one specific app/project. So I don't think it is as flexible.

1
  • Can the conf/distributions include multiple distributions? (i.e. bionic and jammy) Jul 16, 2022 at 2:38
0

You can keep multiple versions of a package using reprepro. They just need to be associated with different releases (e.g. wheezy vs. wheezy-backports). You can define a new release within reprepro for this purpose.

1
  • 1
    but we have a lot of builds (usually 2-3 per day) and it would be nice if we can install any build version. It seems we will need to create a lot of releases while we planned to use release as development/testing/production branches Nov 20, 2013 at 9:41
0

I'd also recommend reprepro for that.

The issue with having multiple versions available at the same time can be solved with one component per version as it's done on apt.postgresql.org instead of creating a new distribution for each release. (The PostgreSQL guys actually had the same issue and that's their solution/work-around.)

(Components are "main", "contrib", and "non-free" in Debian, and "main", "universe", "restricted" and "multiverse" in Ubuntu. They're one level below the distribution suite.)

1
  • I use that method. I add one more directory level for dist (ie. ubuntu or debian). Not very well documented though. There is almost no mention of how to use components this way anywhere. So let's say you have your own app call "blah" Directory structure would be
    – Fred Flint
    Jan 19, 2019 at 18:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .