/
index.html
2488 lines (1899 loc) · 114 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<title>aptly - Debian repository management tool</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/aptly.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<link rel="icon" type="image/png" href="favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="favicon-32x32.png" sizes="32x32">
</head>
<body data-spy="scroll" data-target=".navbar-default">
<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"><img src="favicon-16x16.png" alt="aptly logo"> aptly</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="https://github.com/smira/aptly/">GitHub</a></li>
<li><a href="#examples">Examples</a></li>
<li><a href="#download">Download</a></li>
<li><a href="#usage">Usage</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">mirror <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#aptly-mirror-create">aptly mirror create</a></li>
<li><a href="#aptly-mirror-update">aptly mirror update</a></li>
<li><a href="#aptly-mirror-list">aptly mirror list</a></li>
<li><a href="#aptly-mirror-show">aptly mirror show</a></li>
<li><a href="#aptly-mirror-drop">aptly mirror drop</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">repo <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#aptly-repo-create">aptly repo create</a></li>
<li><a href="#aptly-repo-add">aptly repo add</a></li>
<li><a href="#aptly-repo-import">aptly repo import</a></li>
<li><a href="#aptly-repo-show">aptly repo show</a></li>
<li><a href="#aptly-repo-list">aptly repo list</a></li>
<li><a href="#aptly-repo-copy">aptly repo copy</a></li>
<li><a href="#aptly-repo-move">aptly repo move</a></li>
<li><a href="#aptly-repo-remove">aptly repo remove</a></li>
<li><a href="#aptly-repo-edit">aptly repo edit</a></li>
<li><a href="#aptly-repo-drop">aptly repo drop</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">snapshot <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#aptly-snapshot-create">aptly snapshot create</a></li>
<li><a href="#aptly-snapshot-list">aptly snapshot list</a></li>
<li><a href="#aptly-snapshot-show">aptly snapshot show</a></li>
<li><a href="#aptly-snapshot-verify">aptly snapshot verify</a></li>
<li><a href="#aptly-snapshot-pull">aptly snapshot pull</a></li>
<li><a href="#aptly-snapshot-diff">aptly snapshot diff</a></li>
<li><a href="#aptly-snapshot-merge">aptly snapshot merge</a></li>
<li><a href="#aptly-snapshot-drop">aptly snapshot drop</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">publish <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#aptly-publish-snapshot">aptly publish snapshot</a></li>
<li><a href="#aptly-publish-repo">aptly publish repo</a></li>
<li><a href="#aptly-publish-update">aptly publish update</a></li>
<li><a href="#aptly-publish-switch">aptly publish switch</a></li>
<li><a href="#aptly-publish-list">aptly publish list</a></li>
<li><a href="#aptly-publish-drop">aptly publish drop</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">other <b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="dropdown-header">db</li>
<li><a href="#aptly-db-cleanup">aptly db cleanup</a></li>
<li><a href="#aptly-db-info">aptly db info</a></li>
<li class="divider"></li>
<li class="dropdown-header">misc</li>
<li><a href="#aptly-serve">aptly serve</a></li>
<li><a href="#aptly-graph">aptly graph</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container">
<div class="jumbotron">
<h1><img src="logo.png" alt="aptly logo"> aptly</h1>
<p>aptly is a swiss army knife for Debian repository management: it allows to mirror remote
repositories, manage local package repositories, take snapshots, pull new versions of packages
along with dependencies, publish snapshots as Debian repositories.</p>
<p>aptly is free <a href="https://github.com/smira/aptly">open-source</a> software licensed under MIT license.</p>
<div id="carousel-ss" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-ss" data-slide-to="0" class="active"></li>
<li data-target="#carousel-ss" data-slide-to="1"></li>
<li data-target="#carousel-ss" data-slide-to="2"></li>
<li data-target="#carousel-ss" data-slide-to="3"></li>
<li data-target="#carousel-ss" data-slide-to="4"></li>
<li data-target="#carousel-ss" data-slide-to="5"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="1.png" class="img-responsive" alt="aptly snapshot diff">
<div class="carousel-caption">
<h3>Difference between snapshots</h3>
<p>aptly snapshot diff matches package versions in snapshots</p>
</div>
</div>
<div class="item">
<img src="2.png" class="img-responsive" alt="aptly snapshot pull">
<div class="carousel-caption">
<h3>Pulling packages</h3>
<p>Pull from snapshot to selectively upgrade packages</p>
</div>
</div>
<div class="item">
<img src="3.png" class="img-responsive" alt="aptly mirror update">
<div class="carousel-caption">
<h3>Mirroring remote repos</h3>
<p>Download packages from remote mirror to take stable snapshot</p>
</div>
</div>
<div class="item">
<img src="aptlylocal.png" class="img-responsive" alt="aptly repo">
<div class="carousel-caption">
<h3>Managing local repos</h3>
<p>Create, import and move packages in local package repositories</p>
</div>
</div>
<div class="item">
<img src="aptlyserve.png" class="img-responsive" alt="aptly repo">
<div class="carousel-caption">
<h3>Serving published repositories</h3>
<p>Quickly serve published snapshots over HTTP</p>
</div>
</div>
<div class="item">
<img src="aptlygraph.png" class="img-responsive" alt="aptly repo">
<div class="carousel-caption">
<h3>Visualize dependencies</h3>
<p>Render relationships between mirrors, repos, snapshots and published repositories</p>
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-ss" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#carousel-ss" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
<p></p>
<p><a class="btn btn-primary btn-lg" href="#download">Download →</a></p>
</div>
<div id="fb-root"></div>
<div id="sharing-links">
<a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal">Tweet</a>
<div class="g-plusone" data-size="medium" data-count="true"></div>
<div class="fb-share-button" data-type="button_count"></div>
<iframe src="http://ghbtns.com/github-btn.html?user=smira&repo=aptly&type=watch&count=true" height="20" width="118" frameborder="0" scrolling="0" style="width:118px; height: 20px; margin-left: 20px" allowTransparency="true"></iframe>
</div>
<h2>Features <small><span class="glyphicon glyphicon-asterisk"></span> means planned features</small></h2>
<div class="row">
<div class="col-lg-6">
<h4>Mirror repository</h4>
<p>Take and update mirrors of any Debian/Ubuntu remote repository.</p>
<h4>Take snapshot</h4>
<p>At any point in time, take snapshot of the mirror to fix current set of packages.</p>
<h4>Merge snapshots</h4>
<p>Merge two or more snapshots into one snapshot: e.g. merge wheezy and wheezy-updates.</p>
<h4>Publish your packages</h4>
<p>Manage your own repositories of packages, merge them with offical and publish the result.</p>
<h4>Mirror repositories as-is <span class="glyphicon glyphicon-asterisk"></span></h4>
<p>Mirror official Debian repositories (as snapshots) without resigning by your own key.</p>
</div>
<div class="col-lg-6">
<h4>Publish snapshot</h4>
<p>Any snapshot could be published back as repository (only HTTP server is required).</p>
<h4>Upgrade package versions</h4>
<p>New package version available in backports? Pull only single package with dependencies from
backports into snapshot of stable repository.</p>
<h4>Filter repository <span class="glyphicon glyphicon-asterisk"></span></h4>
<p>Remove packages that are not required, controlling dependencies between packages.</p>
<h4>Package search <span class="glyphicon glyphicon-asterisk"></span></h4>
<p>Search for specific packages, their inclusion into snapshots, etc.</p>
<h4>Support for yum repositories <span class="glyphicon glyphicon-asterisk"></span></h4>
<p>Manage packages for CentOS, RHEL, Fedora.</p>
</div>
</div>
<div class="alert alert-warning">
aptly doesn't yet support
debian-installer packages (udebs) and translations
</div>
<!-- ================ examples ============== -->
<div class="target-spacer" id="examples"><a name="examples"></a> </div>
<h2>Examples</h2>
<p class="lead">Mirror Debian repository distribution squeeze only for architectures <code>i386</code>,
<code>amd64</code> and publish the result:</p>
<p><a href="#aptly-mirror-create">Create</a> mirror:</p>
<pre><span class="greeting">$</span> <span class="command">aptly -architectures="amd64,i386" mirror create debian-main http://ftp.ru.debian.org/debian/ squeeze main</span>
2013/12/28 19:44:45 Downloading http://ftp.ru.debian.org/debian/dists/squeeze/Release...
...
Mirror [debian-main]: http://ftp.ru.debian.org/debian/ squeeze successfully added.
You can run 'aptly mirror update debian-main' to download repository contents.
</pre>
<p><a href="#aptly-mirror-update">Download</a> mirror contents:</p>
<pre><span class="greeting">$</span> <span class="command">aptly mirror update debian-main</span>
2014/01/15 16:50:50 Downloading http://ftp.ru.debian.org/debian/dists/squeeze/Release...
Downloading & parsing release files...
2014/01/15 16:50:50 Downloading http://ftp.ru.debian.org/debian/dists/squeeze/main/binary-amd64/Packages.bz2...
Saving packages to database...
Building download queue...
Download queue: 27960 items, 30.68 GiB size</pre>
<p><a href="#aptly-snapshot-create">Take</a> snapshot:</p>
<pre><span class="greeting">$</span> <span class="command">aptly snapshot create debian-3112 from mirror debian-main</span>
Snapshot debian-3112 successfully created.
You can run 'aptly publish snapshot debian-3112' to publish snapshot as Debian repository.
</pre>
<p><a href="#aptly-publish-snapshot">Publish</a> snapshot (requires generated GPG key):</p>
<pre><span class="greeting">$</span> <span class="command">aptly publish snapshot debian-3112</span>
...
Snapshot debian-3112 has been successfully published.
Please setup your webserver to serve directory '/home/example/.aptly/public' with autoindexing.
Now you can add following line to apt sources:
deb http://your-server/ squeeze main
Don't forget to add your GPG key to apt with apt-key.
</pre>
<p>Set up webserver (e.g. nginx):</p>
<pre>server {
root /home/example/.aptly/public;
server_name mirror.local;
location / {
autoindex on;
}
}
</pre>
<p>Add new repository to apt's sources:</p>
<pre>deb http://mirror.local/ squeeze main
</pre>
<p>Alternatively, you can <a href="#aptly-serve">serve</a> published repositories with aptly itself:</p>
<pre><span class="greeting">$</span> <span class="command">aptly serve</span>
Serving published repositories, recommended apt sources list:
# ./squeeze (main) [amd64, i386] publishes [debian-3112]: Snapshot from mirror [debian-main]: http://ftp.ru.debian.org/debian/ squeeze
deb http://localhost:8080/ squeeze main
Starting web server at: :8080 (press Ctrl+C to quit)...
</pre>
<p>Run apt-get to fetch repository metadata:</p>
<pre><span class="greeting">$</span> <span class="command">apt-get update</span></pre>
<p class="lead">Pulling new version of <code>nginx</code> from <code>backports</code>:</p>
<p><a href="#aptly-mirror-create">Create</a> <code>backports</code> mirror, <a href="#aptly-mirror-update">download</a> it
and <a href="#aplty-snapshot-create">take</a> snapshot:</p>
<pre><span class="greeting">$</span> <span class="command">aptly -architectures="amd64,i386" mirror create backports http://mirror.yandex.ru/backports.org/ squeeze-backports</span>
...
<span class="greeting">$</span> <span class="command">aptly mirror update backports</span>
...
<span class="greeting">$</span> <span class="command">aptly snapshot create back from mirror backports</span>
...
</pre>
<p><a href="#aptly-snapshot-pull">Pull</a> new version of <code>nginx</code> from <code>backports</code> to main Debian snapshot and save result as <code>snap-deb-w-nginx</code>.</p>
<pre><span class="greeting">$</span> <span class="command">aptly snapshot pull debian-3112 back snap-deb-w-nginx nginx</span>
Dependencies would be pulled into snapshot:
[debian-3112]: Snapshot from mirror [debian-main]: http://ftp.ru.debian.org/debian/ squeeze
from snapshot:
[back]: Snapshot from mirror [backports]: http://mirror.yandex.ru/backports.org/ squeeze-backports
and result would be saved as new snapshot snap-deb-w-nginx.
Loading packages (49476)...
Building indexes...
<span class="red">[-]</span> nginx-0.7.67-3+squeeze3_i386 removed
<span class="green">[+]</span> nginx-1.2.1-2.2~bpo60+2_all added
<span class="green">[+]</span> nginx-full-1.2.1-2.2~bpo60+2_i386 added
<span class="green">[+]</span> nginx-light-1.2.1-2.2~bpo60+2_i386 added
<span class="green">[+]</span> nginx-common-1.2.1-2.2~bpo60+2_all added
<span class="red">[-]</span> nginx-1.2.1-2.2~bpo60+2_all removed
<span class="red">[-]</span> nginx-0.7.67-3+squeeze3_amd64 removed
<span class="green">[+]</span> nginx-1.2.1-2.2~bpo60+2_all added
<span class="green">[+]</span> nginx-full-1.2.1-2.2~bpo60+2_amd64 added
<span class="green">[+]</span> nginx-light-1.2.1-2.2~bpo60+2_amd64 added
Snapshot snap-deb-w-nginx successfully created.
You can run 'aptly publish snapshot snap-deb-w-nginx' to publish snapshot as Debian repository.
</pre>
<p>Snapshot <code>snap-deb-w-nginx</code> can be <a href="#aptly-publish-snapshot">published</a> as a separate repository.</p>
<!-- ================ download ============== -->
<div class="target-spacer" id="download"><a name="download"></a> </div>
<h2>Download</h2>
<p class="lead">Currently released aptly version is <strong>0.6</strong> (<a href="#history">what's new?</a>).
</p>
<p>Roadmap:</p>
<ul>
<li>0.7 (end of June): searching, S3 publishing</li>
<li>0.8 (end of July): mirroring as is, yum repositories support</li>
</ul>
<p><strong>For Debian/Ubuntu</strong> aptly could be installed from by adding new repository
to <code>/etc/apt/sources.list</code>:</p>
<pre>deb http://repo.aptly.info/ squeeze main</pre>
<p>And importing key that is used to sign the release:</p>
<pre><span class="greeting">$</span> <span class="command">gpg --keyserver keys.gnupg.net --recv-keys 2A194991</span>
<span class="greeting">$</span> <span class="command">gpg -a --export 2A194991 | sudo apt-key add -</span></pre>
<p>After that you can install aptly as any other software package:</p>
<pre><span class="greeting">$</span> <span class="command">apt-get update</span>
<span class="greeting">$</span> <span class="command">apt-get install aptly</span></pre>
<p>Don't worry about <code>squeeze</code> part in repo name: aptly package should work on Debian squeeze+, Ubuntu 10.0+. Package
contains aptly binary, man page and bash completion.</p>
<p><strong>Binary</strong> executables (depends almost only on libc) for Debian, CentOS, MacOS X & FreeBSD are available for
download from <a href="http://dl.bintray.com/smira/aptly/0.6/">Bintray</a>. Linux executables should run on almost any
recent Linux distribution.</p>
<div class="row">
<div class="col-lg-6">
<div class="pull-left">
<img src="debian.png" alt="Debian" class="logo">
</div>
<h4>Debian (Ubuntu)</h4>
<p><strong>see part on installation from .deb package above</strong></p>
<p>squeeze+: <a href="http://dl.bintray.com/smira/aptly/0.6/debian-squeeze-x32/aptly">32-bit</a> |
<a href="http://dl.bintray.com/smira/aptly/0.6/debian-squeeze-x64/aptly">64-bit</a></p>
</div>
<div class="col-lg-6">
<div class="pull-left">
<img src="centos.png" alt="CentOS" class="logo">
</div>
<h4>CentOS (RedHat, Fedora)</h4>
<p>6.5+: <a href="http://dl.bintray.com/smira/aptly/0.6/centos-6.5-x32/aptly">32-bit</a> |
<a href="http://dl.bintray.com/smira/aptly/0.6/centos-6.5-x64/aptly">64-bit</a></p>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="pull-left">
<img src="freebsd.png" alt="FreeBSD" class="logo">
</div>
<h4>FreeBSD</h4>
<p>9.2+: <a href="http://dl.bintray.com/smira/aptly/0.6/freebsd-9.2-x32/aptly">32-bit</a> |
<a href="http://dl.bintray.com/smira/aptly/0.6/freebsd-9.2-x64/aptly">64-bit</a></p>
</div>
<div class="col-lg-6">
<div class="pull-left">
<img src="macosx.png" alt="Mac OS X" class="logo">
</div>
<h4>Mac OS X</h4>
<p>10.9: <a href="http://dl.bintray.com/smira/aptly/0.6/osx/aptly">64-bit</a></p>
</div>
</div>
<div class="row">
<div class="col-lg-4">
</div>
<div class="col-lg-4">
<p>
<a href='http://www.bintray.com/smira/aptly/aptly'>
<img src='http://www.bintray.com/docs/images/poweredByBintray_ColorTransparent.png' width="100" height="55" alt="BinTray logo">
</a>
</p>
</div>
<div class="col-lg-4">
</div>
</div>
<p>Just copy binary to your machine, make it executable and run it:</p>
<pre><span class="greeting">$</span> <span class="command">chmod +x aptly</span>
<span class="greeting">$</span> <span class="command">./aptly</span></pre>
<p><strong>Bash completion</strong> for aptly is available as <a href="https://github.com/aptly-dev/aptly-bash-completion">separate repo</a>.</p>
<p>If you have Go environment set up (go 1.1+ required), you can build aptly from <strong>source</strong> by
cloning it and building with gom:</p>
<pre><span class="greeting">$</span> <span class="command">go get -u github.com/mattn/gom</span>
<span class="greeting">$</span> <span class="command">mkdir -p $GOPATH/src/github.com/smira/aptly</span>
<span class="greeting">$</span> <span class="command">git clone https://github.com/smira/aptly $GOPATH/src/github.com/smira/aptly</span>
<span class="greeting">$</span> <span class="command">cd $GOPATH/src/github.com/smira/aptly</span>
<span class="greeting">$</span> <span class="command">gom -production install</span>
<span class="greeting">$</span> <span class="command">gom build -o $GOPATH/bin/aptly</span>
<span class="greeting">$</span> <span class="command">aptly</span>
</pre>
<!-- ================ support ============== -->
<div class="target-spacer" id="support"><a name="support"></a> </div>
<h2>Support</h2>
<p>If you have trouble using aptly, you can find community support from
<a href="https://groups.google.com/forum/#!forum/aptly-discuss">aptly-discuss mailing list</a> or file
an <a href="https://github.com/smira/aptly/issues">issue on GitHub</a>.</p>
<p>Please following me (<a href="https://twitter.com/smira/">@smira</a>) to get updates about aptly.
<!-- ================ usage ============== -->
<div class="target-spacer" id="usage"><a name="usage"></a> </div>
<h2>Usage</h2>
<p>
aptly goal is to establish repeatiblity and controlled changes in package environment. aptly allows
to fix set of packages in repository, so that package installation and upgrade becomes deterministic.
At the same time aptly allows to perform controlled, fine-grained changes in repository contents to
transition your package environment to new version.</p>
<div class="target-spacer" id="usage"><a name="core-concepts"></a> </div>
<h3>Core Concepts</h3>
<dl class="dl-horizontal">
<dt>mirror</dt>
<dd>mirror of remote repository, consists of metadata, list of packages and package files</dd>
<dt>local repo</dt>
<dd>local package repository, consists of metadata, packages and files, packages could be easily added and removed</dd>
<dt>snapshot</dt>
<dd>immutable list of packages, basic block to implement repeatability and controlled changes</dd>
<dt>published repository</dt>
<dd>published representation of snapshot or local repository, ready to be consumed by apt tools</dd>
</dl>
<p>The schema of aptly's commands and transitions between entities:</p>
<p><img src="schema.png" class="img-responsive" alt="aptly snapshot diff"></p>
<p>We can start with creating <a href="#aptly-mirror-create">mirrors of remote repositories</a>. Also
you can create <a href="#aptly-repo-create">local package repositories</a> and import there packages
as files. Local repos could be modified by <a href="#aptly-repo-copy">copying</a> and <a href="#aptly-repo-move">moving</a>
packages between local repositories and <a href="#aptly-repo-import">importing</a> them from mirrors.
Snapshot could be <a href="#aptly-snapshot-create">created</a> from remote repository
(official Debain repositories, backports, 3rd party repos, etc.) or your local repository (custom built
packages, your own software). Snapshots
can be used to produce new snapshots by <a href="#aptly-snapshot-pull">pulling</a> packages with dependencies between snapshots
and by <a href="#aptly-snapshot-merge">merging</a> snapshots. Any snapshot can be
<a href="#aptly-publish-snapshot">published</a> to location
(distribution name, prefix) and consumed by <code>apt</code> tools on your Debian systems. Local repositories
could be <a href="#aptly-publish-repo">published directly</a> bypassing snapshot step.</p>
<div class="target-spacer" id="commands"><a name="commands"></a> </div>
<h3>Commands</h3>
<p>Aptly supports commands in three basic categories:</p>
<ul>
<li> <code>mirror</code>: manage, update mirrors of remote repositories
</li>
<li> <code>repo</code>: manage local package repositories, add, remove, move, copy packages
</li>
<li> <code>snapshot</code>: create, merge, manage snapshots
</li>
<li> <code>publish</code>: publish snapshot or local repository
</li>
<li> <code>serve</code>: quickly export published repositories via HTTP
</li>
</ul>
<!-- ================ configuration ============== -->
<div class="target-spacer" id="configuration"><a name="configuration"></a> </div>
<h3>Configuration</h3>
<p>aptly looks for configuration file in <code>/etc/aptly.conf</code> and
<code>~/.aptly.conf</code>, if no config file found, new one is created. If <code>-config=</code> flag is
specified, aptly would use config file at specified location. Also aptly
needs root directory for database, package and published repository
storage. If not specified, directory defaults to <code>~/.aptly</code>, it will be
created if missing.</p>
<p>Configuration file is stored in JSON format (default values shown below):</p>
<pre>{
"rootDir": "$HOME/.aptly",
"downloadConcurrency": 4,
"downloadSpeedLimit": 0,
"architectures": [],
"dependencyFollowSuggests": false,
"dependencyFollowRecommends": false,
"dependencyFollowAllVariants": false,
"dependencyFollowSource": false,
"gpgDisableSign": false,
"gpgDisableVerify": false,
"downloadSourcePackages": false,
"ppaDistributorID": "ubuntu",
"ppaCodename": ""
}
</pre>
<p>Options:</p>
<ul>
<li> <code>rootDir</code> is root of directory storage to store database
(<code>rootDir/db</code>), downloaded packages (<code>rootDir/pool</code>) and published
repositories (<code>rootDir/public</code>)</li>
<li> <code>downloadConcurrency</code> is a number of parallel download threads to
use when downloading packages</li>
<li> <code>downloadSpeedLimit</code> is a limit on download bandwidth used by aptly in
kbytes per second, 0 means unlimited</li>
<li> <code>architectures</code> is a list of architectures to process; if left empty
defaults to all available architectures; could be overridden with
option <code>-architectures</code>
</li>
<li> <code>dependencyFollowSuggests</code>: follow contents of <code>Suggests:</code> field
when processing dependencies for the package</li>
<li> <code>dependencyFollowRecommends</code>: follow contents of <code>Recommends:</code> field
when processing dependencies for the package</li>
<li> <code>dependencyFollowAllVariants</code>: when dependency looks like
<code>package-a | package-b</code>, follow both variants always</li>
<li> <code>dependencyFollowSource</code>: follow dependency from binary package to source package</li>
<li> <code>gpgDisableSign</code>: don't sign published repositories with <code>gpg</code>, also can be
disabled on per-repo basis using <code>-skip-signing</code> flag when publishing</li>
<li> <code>gpgDisableVerify</code>: don't verify remote mirrors with <code>gpg</code>, also can be
disabled on per-mirror basis using <code>-ignore-signatures</code> flag when creating and updating mirrors</li>
<li>
<code>downloadSourcePackages</code>:
if enabled, all mirrors created would have flag set to download source packages; this setting could be controlled
on per-mirror basis with <code>-with-sources</code> flag
</li>
<li><code>ppaDistributorID</code> & <code>ppaCodename</code> specifies paramaters for short PPA url expansion,
if left blank they default to output of <code>lsb_release</code> command
</ul>
<div class="alert alert-warning"><strong>Warning:</strong> <code>rootDir</code> contains all the downloaded packages from remote mirrors,
so it should have enough space. For example. mirror of Debian wheezy (amd64 and i386) requires 70 GiB of disk space.
</div>
<p>aptly would use HTTP proxy configured in <code>HTTP_PROXY</code> environment variable automatically.</p>
<!-- ================ common options ============== -->
<div class="target-spacer" id="common-options"><a name="common-options"></a> </div>
<h3>Global Flags</h3>
<p>There are several flags that should be specfied right before command
name:</p>
<pre><span class="greeting">$</span> <span class="command">aptly --option1 command ...</span></pre>
<p>These flags are:</p>
<ul>
<li>
<code>-architectures=""</code>: list of architectures to consider during
(comma-separated), default to all available
</li>
<li>
<code>-config=""</code>: location of configuration file (default locations are
<code>/etc/aptly.conf</code>, <code>~/.aptly.conf</code>)
</li>
<li>
<code>-dep-follow-all-variants=false</code>: when processing dependencies,
follow a & b if depdency is 'a|b'
</li>
<li>
<code>-dep-follow-recommends=false</code>: when processing dependencies, follow
Recommends
</li>
<li>
<code>-dep-follow-source=false</code>: when processing dependencies, follow
from binary package to source package
</li>
<li>
<code>-dep-follow-suggests=false</code>: when processing dependencies, follow
Suggests</li>
</ul>
<p>Global flags override configuration parameters with similar names.</p>
<!-- ================ package-spec ============== -->
<div class="target-spacer" id="package-spec"><a name="package-spec"></a> </div>
<h3>Package Spec</h3>
<p>Some commands accept package specs to identify list of packages to process. Package spec is a list of
following search conditions:</p>
<ul>
<li><strong>direct package reference</strong>: reference to exaclty one package. Format is identical to the way
aptly lists packages in <code>show</code> commands with <code>-with-packages</code> flag: <code>name_version_arch</code>, e.g.:
<code>libmysqlclient18_5.5.35-rel33.0-611.squeeze_amd64</code> </li>
<li><strong>dependency condition</strong>: syntax follows Debian dependency specification: <code>package_name</code> followed by
optional version specification and architecture limit.<br/> Examples:
<ul>
<li>
<code>mysql-client</code>: matches package <code>mysql-client</code> of any version and
architecture (including <code>source</code>)
</li>
<li>
<code>mysql-client (>= 3.6)</code>: matches package <code>mysql-client</code> with version greater or equal to <code>3.6</code>.
Valid operators for version are: <code>>=</code>, <code><=</code>, <code>=</code>, <code>>></code> (strictly greater),
<code><<</code> (strictly less).
</li>
<li>
<code>mysql-client {i386}</code>: matches package <code>mysql-client</code> on architecture <code>i386</code>, architecture
<code>all</code> matches all architectures but source.
</li>
<li>
<code>mysql-client (>= 3.6) {i386}</code>: version and architecture conditions combined.
</li>
</ul>
When specified on command line, condition may have to be quoted according to shell rules, so that it stays single argument:
<code>aptly repo import percona stable 'mysql-client (>= 3.6)'</code>.
</li>
</ul>
<!-- ================ duplicate-packages ============== -->
<div class="target-spacer" id="duplicate-packages"><a name="duplicate-packages"></a> </div>
<h3>On duplicate packages</h3>
<p>In ideal world, tuple <code>(architecture, name, version)</code> should identify unique package.
That holds true (well, almost true) with Debian-based distributions. If two packages with the same
architecture, name and version are coming from different sources, they should be identical.</p>
<p>Debian <a href="https://wiki.debian.org/RepositoryFormat">documentation on repository format</a> explicitly
forbids duplicate packages with different content in one repository or in set of repositories for one
distribution:</p>
<blockquote>A repository must not include different packages (different content) with the same package name, version, and architecture. When a repository is meant to be used as a supplement to another repository this should hold for the joint main+supplement repository as well.</blockquote>
<p>aptly deduplicates packages with identical <code>(architecture, name, version)</code> tuple and contents into
one single package record and treats them as single package. But if two packages share architecture, name and version,
but have different content, aptly would treat them as different packages. Such packages should never be placed
into one list in aptly (into one local repo, snapshot, mirror, etc.) When such thing happens, aptly would
complain about conflict in packages. Usually such duplicate packages with different content represent some
software packaged for different Debian distribution, so they should never be in the same list.</p>
<!-- ================ integrations ============== -->
<div class="target-spacer" id="integrations"><a name="integrations"></a> </div>
<h3>Integrations</h3>
<p>With configuration management systems:</p>
<ul>
<li><a href="https://github.com/hw-cookbooks/aptly">Chef cookbook</a> by Aaron Baer (Heavy Water Operations, LLC)</li>
<li><a href="https://github.com/alphagov/puppet-aptly">Puppet module</a> by Government Digital Services</li>
</ul>
<!-- ================ aptly mirror ============== -->
<div class="target-spacer" id="aptly-mirror"><a name="aptly-mirror"></a> </div>
<h3>Command <code>mirror</code></h3>
<p>Mirror subcommands manage mirrors of remote Debian repositories.</p>
<!-- ================ aptly mirror create ============== -->
<div class="target-spacer" id="aptly-mirror-create"><a name="aptly-mirror-create"></a> </div>
<h4>Command <code>aptly mirror create</code></h4>
<p>Creates mirror of remote repository, aptly supports both regular and flat Debian repositories exported via HTTP. aptly would try download
Release file from remote repository and verify its signature.</p>
<p>Usage:</p>
<pre><span class="greeting">$</span> <span class="command"> aptly mirror create <name> <archive url> <distribution> [<component1> ...]</span></pre>
<p>For Launchpad PPAs:</p>
<pre><span class="greeting">$</span> <span class="command"> aptly mirror create <name> <ppa:user/project></span></pre>
<p>Params are:</p>
<ul>
<li> <code>name</code> is a name that would be used in aptly to reference this
mirror</li>
<li> <code>archive url</code> is a root of archive, e.g.
<a href="http://ftp.ru.debian.org/debian/">http://ftp.ru.debian.org/debian/</a>
</li>
<li> <code>distribution</code> is a distribution name, e.g. <code>squeeze</code>, for flat repositories use <code>./</code> instead of distribution name
</li>
<li> <code>component1</code> is an optional list of components to download, if not
specified aptly would fetch all components, e.g. <code>main</code>
</li>
</ul>
<p>Flags:</p>
<ul>
<li>
<code>-ignore-signatures=false</code>: disable verification of Release file signatures
</li>
<li>
<code>-keyring=trustedkeys.gpg</code>: gpg keyring to use when verifying Release file (could be specified multiple times)
</li>
<li>
<code>-with-sources=false</code>: download source packages in addition to binary packages (could be enabled by default with config
option <code>downloadSourcePackages</code>)
</li>
</ul>
<p>By default aptly would download packages for all available architectures.
If architectures are limited (with config <code>architectures</code> or option
<code>-architectures</code>), only packages for those architectures are downloaded</p>
<div class="alert alert-info">If components are not specified, aptly will download packages from all
components and merge it into one when publishing. If components should be left separate, please
create separate mirror for each component.</div>
<p>If PPA url is specified, aptly would expand it to HTTP url using configuration options <code>ppaDistributorID</code> &
<code>ppaCodename</code>. If you're running aptly on Ubuntu, defaults should work (aptly would figure out codename using
<code>lsb_release</code> command).</p>
<p>aptly would try to verify signature of Release files using GnuPG. By default, keyring <code>~/.gnupg/trustedkeys.gpg</code>
would be used. If you would like to use different keyring(s), specify them using <code>-keyring</code> flag. aptly would
advise <code>gpg</code> commands to import keys into trusted keys keyring in order to successfully verify repository signature.
</p>
<p>If aptly is running on Debian/Ubuntu machine, it would be good to import archive signing keys shipped with the operating system:</p>
<pre><span class="greeting">$</span> <span class="command">gpg --keyring /usr/share/keyrings/debian-archive-keyring.gpg --export | gpg --no-default-keyring --keyring trustedkeys.gpg --import</span></pre>
<p class="small">If you're running Ubuntu, use <code>/usr/share/keyrings/ubuntu-archive-keyring.gpg</code></p>
<p>If GnuPG is complaining that required key to verify signature is missing, it would report key ID, e.g. <code>46925553</code>. Keys
could be downloaded from public keyserver and imported into trusted keyring using command:</p>
<pre><span class="greeting">$</span> <span class="command">gpg --no-default-keyring --keyring trustedkeys.gpg --keyserver keys.gnupg.net --recv-keys 46925553</span></pre>
<p class="small">Replace <code>46925553</code> with the key ID GnuPG is complaining about.</p>
<p>If you're mirroring flat repository, sometimes repository key is located near release files, so you can download it and import into
your trusted keychain:</p>
<pre><span class="greeting">$</span> <span class="command">wget -O - http://some.repo/repository/Release.key | gpg --no-default-keyring --keyring trustedkeys.gpg --import</span></pre>
<p>You can learn about signed Debian repositories in <a href="https://wiki.debian.org/SecureApt">Debian wiki</a>. If you would like to disable
signature checks, you can use flag <code>-ignore-signatures</code> or configuration setting <code>gpgDisableVerify</code>.</p>
<div class="alert alert-info">aplty deduplicates all downloaded files, so if two mirrors are created one with source packages enabled
and another with source packages disabled, they would consume only space required to store all binary and source packages (not twice
the space required to store binary packages).</div>
<p>Example:</p>
<pre><span class="greeting">$</span> <span class="command">aptly -architectures="amd64" mirror create debian-main http://ftp.ru.debian.org/debian/ squeeze main</span>
2013/12/28 19:44:45 Downloading http://ftp.ru.debian.org/debian/dists/squeeze/Release...
...
Mirror [debian-main]: http://ftp.ru.debian.org/debian/ squeeze successfully added.
You can run 'aptly mirror update debian-main' to download repository contents.
</pre>
<!-- ================ aptly mirror update ============== -->
<div class="target-spacer" id="aptly-mirror-update"><a name="aptly-mirror-update"></a> </div>
<h4>Command <code>aptly mirror update</code></h4>
<p>Updates remote mirror (downloads package files and meta information). When mirror is
created, this command should be run for the first time to fetch mirror contents.
This command could be run many times to get updated repository contents.
If interrupted, command could be restarted safely.</p>
<p>Usage:</p>
<pre><span class="greeting">$</span> <span class="command">aptly mirror update <name></span></pre>
<p>Params are:</p>
<ul>
<li> <code>name</code> is a mirror name (given when mirror was created)</li>
</ul><p>All packages would be stored under aptly's root dir (see section on
<a href="#configuration">Configuration</a>).</p>
<p>Flags:</p>
<ul>
<li>
<code>-download-limit=0</code>: limit download speed (kbytes/sec)
</li>
<li>
<code>-ignore-checksums=false</code>: ignore checksum mismatches for downloaded items (packages file, metadata)
</li>
<li>
<code>-ignore-signatures=false</code>: disable verification of Release file signatures
</li>
<li>
<code>-keyring=trustedkeys.gpg</code> gpg keyring to use when verifying Release file (could be specified multiple times)
</li>
</ul>
<p>While updating mirror, aptly would verify signature of Release file using GnuPG. Please read information about signature verification
in <a href="#aptly-mirror-create">aptly mirror create</a> command description.</p>
<p>Example:</p>
<pre><span class="greeting">$</span> <span class="command">aptly mirror update debian-main</span>
2013/12/29 18:32:34 Downloading http://ftp.ru.debian.org/debian/dists/squeeze/Release...
2013/12/29 18:32:37 Downloading http://ftp.ru.debian.org/debian/dists/squeeze/main/binary-amd64/Packages.bz2...
2013/12/29 18:37:19 Downloading http://ftp.ru.debian.org/debian/pool/main/libg/libgwenhywfar/libgwenhywfar47-dev_3.11.3-1_amd64.deb...
....
</pre>
<!-- ================ aptly mirror list ============== -->
<div class="target-spacer" id="aptly-mirror-list"><a name="aptly-mirror-list"></a> </div>
<h4>Command <code>aptly mirror list</code></h4>
<p>Shows list of registered repository mirrors.</p>
<p>Usage:</p>
<pre><span class="greeting">$</span> <span class="command">aptly mirror list</span></pre>
<p>Flags:</p>
<ul>
<li>
<code>-raw=false</code>: display list in machine-readable format
</li>
</ul>
<p>Examples:</p>
<pre><span class="greeting">$</span> <span class="command">aptly mirror list</span>
List of mirrors:
* [backports]: http://mirror.yandex.ru/backports.org/ squeeze-backports
* [debian-main]: http://ftp.ru.debian.org/debian/ squeeze
To get more information about repository, run `aptly mirror show <name>`.
</pre>
<pre><span class="greeting">$</span> <span class="command">aptly mirror list -raw</span>
backports
debian-main
</pre>
<!-- ================ aptly mirror show ============== -->
<div class="target-spacer" id="aptly-mirror-show"><a name="aptly-mirror-show"></a> </div>
<h4>Command <code>aptly mirror show</code></h4>
<p>Shows detailed information about mirror.</p>
<p>Usage:</p>
<pre><span class="greeting">$</span> <span class="command">aptly mirror show <name></span></pre>
<p>Params are:</p>
<ul>
<li> <code>name</code> is a mirror name (given when mirror was created)</li>
</ul>
<p>Flags:</p>
<ul>
<li> <code>-with-packages=false</code>: show detailed list of packages and versions stored in the mirror</li>
</ul>
<p>Example:</p>
<pre><span class="greeting">$</span> <span class="command">aptly mirror show backports2</span>
Name: backports2
Archive Root URL: http://mirror.yandex.ru/backports.org/
Distribution: squeeze-backports
Components: main, contrib, non-free
Architectures: i386, amd64
Last update: 2013-12-27 19:30:19 MSK
Number of packages: 3898
Information from release file:
...
</pre>
<p>In detailed information basic information about mirror is displayed:
filters by component & architecture, timestamp of last successful
repository fetch and number of packages.</p>
<!-- ================ aptly mirror drop ============== -->
<div class="target-spacer" id="aptly-mirror-drop"><a name="aptly-mirror-drop"></a> </div>
<h4>Command <code>aptly mirror drop</code></h4>
<p>Drop deletes information about remote repository mirror. Package data is not deleted
(it could be still used by other mirrors or snapshots). If mirror is used as source to create a snapshot,
aptly would refuse to delete such mirror, use flag <code>-force</code> to override.
</p>
<p>Usage:</p>
<pre><span class="greeting">$</span> <span class="command">aptly mirror drop <name></span></pre>
<p>Params:</p>
<ul>
<li> <code>name</code> is mirror name which has been given during mirror
creation</li>
</ul>
<p>Flags:</p>
<ul>
<li> <code>-force=false</code>: drop mirror even if it used as source of some snapshot</li>
</ul>
<div class="alert alert-info">Dropping mirror only removes metadata about the mirror, in order to cleanup the disk
space occupied by package files you might need to run <a href="#aptly-db-cleanup"><code>aptly db cleanup</code></a> command.</div>
<p>Example:</p>
<pre><span class="greeting">$</span> <span class="command">aptly mirror drop -force wheezy-main</span>
Mirror `wheezy-main` has been removed.</pre>
<!-- ================ aptly repo ============== -->
<div class="target-spacer" id="aptly-repo"><a name="aptly-repo"></a> </div>
<h3>Command <code>repo</code></h3>
<p>Repo subcommands manage local package repositories.</p>
<!-- ================ aptly repo create ============== -->
<div class="target-spacer" id="aptly-repo-create"><a name="aptly-repo-create"></a> </div>
<h4>Command <code>aptly repo create</code></h4>
<p>Create local package repository. Repository would be empty when created, packages could be added from files,
copied or moved from another local repository or imported from the mirror.</p>
<p>Usage:</p>
<pre><span class="greeting">$</span> <span class="command"> aptly repo create <name></span></pre>
<p>Params are:</p>
<ul>