How to serve multiple debian package repositories mirror via Aptly?

1,219 views
Skip to first unread message

Aydin Doyak

unread,
Feb 26, 2016, 7:24:11 PM2/26/16
to aptly-discuss
Hello Everyone,

I searched in e-mail lists and aptly docs about serving more than one package repository mirrors in same server
but I could not clarify about this and need help.

I have 3 different debian based package repositories with different packages in their components
and I want to mirror all of these 3 packages into one server via aptly + apache web server like this :

http://mirror-hostname-or-ip/package-repository1
http://mirror-hostname-or-ip/package-repository2
http://mirror-hostname-or-ip/package-repository3 

But aptly does not allow me to publish more than one snapshots.
Is it possible to do this via aptly? What do you suggest about it?

Thanks for your help,

Andrey Smirnov

unread,
Mar 1, 2016, 3:51:47 AM3/1/16
to Aydin Doyak, aptly-discuss
Aydin, most probably what you need is "publishing prefix" which is last argument to all publish commands.

--
You received this message because you are subscribed to the Google Groups "aptly-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aptly-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Lang

unread,
Mar 22, 2016, 1:30:59 PM3/22/16
to aptly-discuss
What you want to do is merge the mirrors into a snapshot.

aptly snapshot merge --latest <new snapshot name> <list of mirrors to merge>

I do:


/usr/bin/aptly mirror list --raw |while read mirror
  do
    echo "$mirror"
    /usr/bin/aptly mirror update $mirror
  done
/usr/bin/aptly repo list --raw|while read repo
  do
    echo $repo
    /usr/bin/aptly snapshot create $repo-$date from repo $repo
  done
/usr/bin/aptly mirror list --raw |while read repo
  do
    echo $repo
    /usr/bin/aptly snapshot create $repo-$date from mirror $repo
  done
/usr/bin/aptly snapshot merge --latest company-$date `(/usr/bin/aptly mirror list --raw
 /usr/bin/aptly repo list --raw)| while read snapshot
  do
    echo "$snapshot-$date"
  done`

This creates a repo company-$date that I can then publish that contains updates from every repo I mirror plus any local repos I create.

Aydin Doyak

unread,
Mar 23, 2016, 3:57:23 AM3/23/16
to aptly-discuss
Hello,

22 Mar 2016 Sal, 19:31 tarihinde, David Lang <david.eu...@gmail.com> şunu yazdı:
What you want to do is merge the mirrors into a snapshot.

aptly snapshot merge --latest <new snapshot name> <list of mirrors to merge>


Actually i was trying to publish more than 1 package repositories in the same aptly server, merging snapshots is cool but it was not actually the one that i want.

For example; I have one debian package repository to mirror and I want all of its components in the same published snapshot.

So, here's my mirror definitions via aptly :
$ aptly mirror list
List of mirrors:
 * [debian-contrib]: http://ftp.tr.debian.org/debian/ jessie
 * [debian-main]: http://ftp.tr.debian.org/debian/ jessie
 * [debian-nonfree]: http://ftp.tr.debian.org/debian/ jessie
 * [jessie-security]: http://security.debian.org/ jessie/updates

Taking snapshots for each component like this :

$ aptly snapshot create jessie-main-8.3 from mirror debian-main
$ aptly snapshot create jessie-contrib-8.3 from mirror debian-contrib
and so on...
And publish these snapshots in one :

$ aptly publish snapshot -component=main,contrib,non-free -distribution=jessie jessie-main-8.3 jessie-contrib-8.3 jessie-nonfree-8.3 my-debian

  distribution prefix is so important if you want to publish another package repository in the same server so I could publish my jessie-security mirror snapshot
like this :

$ aptly publish snapshot -distribution=jessie jessie-security-8.3 my-debian-security

And finally i can use these package repositories with these /etc/apt/sources.list definitions in my clients :
deb http://hostname.example.com/my-debian jessie main contrib non-free
deb http://hostname.example.com/my-debian-security jessie main

 Thank you for your answers btw, I appreciate it.

--
Aydin Doyak
Linux System Engineer @ TUBITAK - ULAKBIM
http://aydintd.net
Reply all
Reply to author
Forward
0 new messages