aptly: Debian repository management tool

3,022 views
2,563 views

Published on

aptly is a swiss army knife for Debian repository management: it allows to mirror remote repositories, take snapshots, pull new versions of packages along with dependencies, publish snapshots.

http://www.aptly.info/

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,022
On SlideShare
0
From Embeds
0
Number of Embeds
285
Actions
Shares
0
Downloads
20
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

aptly: Debian repository management tool

  1. 1. aptly - Debian repository management tool Andrey Smirnov,
 DevOps Meetup Moscow Jan’14
  2. 2. Repeatability!
  3. 3. Change!
  4. 4. Environment
  5. 5. Repeatable Environment
  6. 6. Environment Change
  7. 7. Repetable Environment Change
  8. 8. Environment is 
 a set of packages
  9. 9. Environment Versions development staging testing production
  10. 10. Environment Control Debian
 repo apt-sources apt-get backports aptpreferences 3rd-party
 repo
  11. 11. Wrong Version!
  12. 12. apt pinning should help!
  13. 13. No…
  14. 14. Our Goal • Fixed set of packages (repeatability) • Update packet versions in controlled way (change)
  15. 15. aptly * isn’t a replacement for apt, dpkg!
  16. 16. Core Concepts mirror – remote repository mirror snapshot – immutable set of packages published
 repo – snapshot published as package repo
  17. 17. mirror take snapshot pull snapshot snapshot update diff take snapshot local
 repo verify published
 repo snapshot publish merge snapshot
  18. 18. aptly mirror $ aptly mirror create wheezy-main http://mirror.yandex.ru/ debian/ wheezy main Downloading http://mirror.yandex.ru/debian/dists/wheezy/ Release... ! Mirror [mirror1]: http://mirror.yandex.ru/debian/ wheezy successfully added. You can run 'aptly mirror update mirror1' to download repository contents.
  19. 19. aptly mirror $ aptly mirror update wheezy-main Downloading http://mirror.yandex.ru/debian/dists/wheezy/ Release... Downloading & parsing package files... Downloading http://mirror.yandex.ru/debian/dists/wheezy/ main/binary-i386/Packages.bz2... Downloading http://mirror.yandex.ru/debian/dists/wheezy/ main/binary-amd64/Packages.bz2... Saving packages to database... Building download queue... Download queue: 0 items, 0.00 GiB size ! Mirror `wheezy-main` has been successfully updated.
  20. 20. mirror update
  21. 21. aptly snapshot $ aptly snapshot create deb-main-250114 from mirror wheezymain ! Snapshot deb-main-250114 successfully created. You can run 'aptly publish snapshot deb-main-250114' to publish snapshot as Debian repository.
  22. 22. mirror update take snapshot snapshot
  23. 23. aptly snapshot pull $ aptly snapshot pull deb-main-250114 percona-250114 deb-wpercona 'percona-server-server (>=5.5)’ … [+] [+] [+] [+] [-] [+] [+] [+] [+] [+] [-] [+] percona-server-server-5.5.35-rel33.0-611.wheezy_amd64 added percona-server-server-5.5-5.5.35-rel33.0-611.wheezy_amd64 added percona-server-client-5.5-5.5.35-rel33.0-611.wheezy_amd64 added percona-server-common-5.5-5.5.35-rel33.0-611.wheezy_amd64 added libmysqlclient18-5.5.31+dfsg-0+wheezy1_amd64 removed libmysqlclient18-5.5.35-rel33.0-611.wheezy_amd64 added percona-server-server-5.5.35-rel33.0-611.wheezy_i386 added percona-server-server-5.5-5.5.35-rel33.0-611.wheezy_i386 added percona-server-client-5.5-5.5.35-rel33.0-611.wheezy_i386 added percona-server-common-5.5-5.5.35-rel33.0-611.wheezy_i386 added libmysqlclient18-5.5.31+dfsg-0+wheezy1_i386 removed libmysqlclient18-5.5.35-rel33.0-611.wheezy_i386 added
  24. 24. aptly snapshot pull $ aptly snapshot pull aptly snapshot pull deb-main-250114 back-250114 deb-w-xorg rsyslog … [-] [+] [-] [+] [+] [-] [+] [-] [+] rsyslog-5.8.11-3_amd64 removed rsyslog-7.4.4-1~bpo70+1_amd64 added libestr0-0.1.1-2_amd64 removed libestr0-0.1.9-1~bpo70+1_amd64 added init-system-helpers-1.11~bpo70.1_all added rsyslog-5.8.11-3_i386 removed rsyslog-7.4.4-1~bpo70+1_i386 added libestr0-0.1.1-2_i386 removed libestr0-0.1.9-1~bpo70+1_i386 added
  25. 25. mirror take snapshot pull update snapshot snapshot snapshot
  26. 26. aptly snapshot diff $ aptly snapshot diff deb-main-250114 deb-w-percona ! + + + + ! + + + + Arch amd64 amd64 amd64 amd64 amd64 i386 i386 i386 i386 i386 | | | | | | | | | | | Package libmysqlclient18 percona-server-client-5.5 percona-server-common-5.5 percona-server-server percona-server-server-5.5 libmysqlclient18 percona-server-client-5.5 percona-server-common-5.5 percona-server-server percona-server-server-5.5 | | | | | | | | | | | Version in A 5.5.31+dfsg-0+wheezy1 5.5.31+dfsg-0+wheezy1 - | | | | | | | | | | | Version in B 5.5.35-rel33.0-611.wheezy 5.5.35-rel33.0-611.wheezy 5.5.35-rel33.0-611.wheezy 5.5.35-rel33.0-611.wheezy 5.5.35-rel33.0-611.wheezy 5.5.35-rel33.0-611.wheezy 5.5.35-rel33.0-611.wheezy 5.5.35-rel33.0-611.wheezy 5.5.35-rel33.0-611.wheezy 5.5.35-rel33.0-611.wheezy
  27. 27. mirror take snapshot pull snapshot update diff snapshot snapshot
  28. 28. aptly snapshot verify $ aptly snapshot verify deb-w-percona Missing dependencies (13): fenix [amd64] fenix-plugins-system [amd64] ia32-libs-i386 [amd64] ia32-libs-gtk-i386 [amd64] vidcontrol [amd64] kbdcontrol [amd64] libmysqlclient18 (= 5.5.31+dfsg-0+wheezy1) [amd64] scsh-0.6 (>= 0.6.6) [amd64] scsh-0.6 [amd64] mozart (>= 1.4.0) [amd64] libmysqlclient18 (= 5.5.31+dfsg-0+wheezy1) [i386] vidcontrol [i386] kbdcontrol [i386]
  29. 29. mirror take snapshot pull snapshot update diff snapshot snapshot verify
  30. 30. aptly snapshot merge $ aptly snapshot merge deb-w-percona-250114 deb-main-250114 percona-250114 ! Snapshot deb-w-percona-250114 successfully created. You can run 'aptly publish snapshot deb-w-percona-250114' to publish snapshot as Debian repository.
  31. 31. mirror take snapshot pull snapshot snapshot update diff snapshot merge snapshot verify
  32. 32. aptly publish snapshot $ aptly publish snapshot -distribution=wheezy percona-250114 Signing file '/Users/smira/.aptly/public/dists/wheezy/ Release' with gpg, please enter your passphrase when prompted: ! … ! Snapshot percona-250114 has been successfully published. Please setup your webserver to serve directory '/Users/ smira/.aptly/public' with autoindexing. Now you can add following line to apt sources: deb http://your-server/ wheezy main Don't forget to add your GPG key to apt with apt-key.
  33. 33. mirror take snapshot pull snapshot verify snapshot update diff published
 repo snapshot publish merge snapshot
  34. 34. Plans • Searching • Filtering • Managing your own package repositories • Support for source packages and translations • Verifying remote repositories
  35. 35. What doesn’t work yet • deletion • bash-completion • flat-repositories • download progress
  36. 36. Competition • mirror: ftpsync, reprepro, debmirror, apt-mirror, aptcache… • archive generation: dak, mini-dak, reprepro, …
  37. 37. Internals • Written in Go • Embedded database - LevelDB • Package files are stored only once
  38. 38. Internals • ~/.aptly.conf - configuration file • ~/.aptly/ - default work directory • db/ - database • pool/ - package file storage • public/ - published repositories
  39. 39. Links • http://www.aptly.info/ • https://github.com/smira/aptly/ • @smira • me@smira.ru • Skype: smirnov.andrey

×