APTLY(1) | APTLY(1) |
aptly - Debian repository management tool
Common command format:
aptly [global options...] command subcommand [options...] arguments
aptly has integrated help that matches contents of this manual page, to get help, prepend help to command name:
aptly help mirror create
aptly is a tool to create partial and full mirrors of remote repositories, manage local repositories, filter them, merge, upgrade individual packages, take snapshots and publish them back as Debian repositories.
aptly’s goal is to establish repeatability and controlled changes in a package-centric environment. aptly allows one to fix a set of packages in a repository, so that package installation and upgrade becomes deterministic. At the same time aptly allows one to perform controlled, fine-grained changes in repository contents to transition your package environment to new version.
aptly looks for configuration file first in ~/.aptly.conf then in /etc/aptly.conf and, if no config file found, new one is created in home directory. If -config= 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 ~/.aptly, it will be created if missing.
Configuration file is stored in JSON format (default values shown below):
{ "rootDir": "$HOME/.aptly", "downloadConcurrency": 4, "downloadSpeedLimit": 0, "downloadRetries": 0, "downloader": "default", "databaseOpenAttempts": 10, "architectures": [], "dependencyFollowSuggests": false, "dependencyFollowRecommends": false, "dependencyFollowAllVariants": false, "dependencyFollowSource": false, "dependencyVerboseResolve": false, "gpgDisableSign": false, "gpgDisableVerify": false, "gpgProvider": "gpg", "downloadSourcePackages": false, "skipLegacyPool": true, "ppaDistributorID": "ubuntu", "ppaCodename": "", "skipContentsPublishing": false, "FileSystemPublishEndpoints": { "test1": { "rootDir": "/opt/srv1/aptly_public", "linkMethod": "symlink" }, "test2": { "rootDir": "/opt/srv2/aptly_public", "linkMethod": "copy", "verifyMethod": "md5" }, "test3": { "rootDir": "/opt/srv3/aptly_public", "linkMethod": "hardlink" } }, "S3PublishEndpoints": { "test": { "region": "us-east-1", "bucket": "repo", "endpoint": "", "awsAccessKeyID": "", "awsSecretAccessKey": "", "prefix": "", "acl": "public-read", "storageClass": "", "encryptionMethod": "", "plusWorkaround": false, "disableMultiDel": false, "forceSigV2": false, "debug": false } }, "SwiftPublishEndpoints": { "test": { "container": "repo", "osname": "", "password": "", "prefix": "", "authurl": "", "tenant": "", "tenantid": "" } }, "AzurePublishEndpoints": { "test": { "accountName": "", "accountKey": "", "container": "repo", "prefix": "" "endpoint": "blob.core.windows.net" } } }
Options:
aptly defaults to publish to a single publish directory under rootDir/public. For a more advanced publishing strategy, you can define one or more filesystem endpoints in the FileSystemPublishEndpoints list of the aptly configuration file. Each endpoint has a name and the following associated settings:
In order to publish to such an endpoint, specify the endpoint as filesystem:endpoint-name with endpoint-name as the name given in the aptly configuration file. For example:
aptly publish snapshot wheezy-main filesystem:test1:wheezy/daily
aptly could be configured to publish repository directly to Amazon S3 (or S3-compatible cloud storage). First, publishing endpoints should be described in aptly configuration file. Each endpoint has name and associated settings:
In order to publish to S3, specify endpoint as s3:endpoint-name: before publishing prefix on the command line, e.g.:
aptly publish snapshot wheezy-main s3:test:
aptly could be configured to publish repository directly to OpenStack Swift. First, publishing endpoints should be described in aptly configuration file. Each endpoint has name and associated settings:
In order to publish to Swift, specify endpoint as swift:endpoint-name: before publishing prefix on the command line, e.g.:
aptly publish snapshot jessie-main swift:test:
Some commands accept package queries to identify list of packages to process. Package query syntax almost matches reprepro query language. Query consists of the following simple terms:
Supported fields:
Operators:
Simple terms could be combined into more complex queries using operators , (and), | (or) and ! (not), parentheses () are used to change operator precedence. Match value could be enclosed in single (’) or double (") quotes if required to resolve ambiguity, quotes inside quoted string should escaped with slash (\).
Examples:
When specified on command line, query may have to be quoted according to shell rules, so that it stays single argument:
aptly repo import percona stable ’mysql-client (>= 3.6)’
Some aptly commands (aptly mirror search, aptly package search, ...) support -format flag which allows to customize how search results are printed. Golang templates are used to specify display format, with all package stanza fields available to template. In addition to package stanza fields aptly provides:
For example, default aptly display format could be presented with the following template: {{.Package}}_{{.Version}}_{{.Architecture}}. To display package name with dependencies: {{.Package}} | {{.Depends}}. More information on Golang template syntax: http://godoc.org/text/template
aptly mirror create name archive url distribution [component1 ...]
Creates mirror name of remote repository, aptly supports both regular and flat Debian repositories exported via HTTP and FTP. aptly would try download Release file from remote repository and verify its’ signature. Command line format resembles apt utlitily sources.list(5).
PPA urls could specified in short format:
$ aptly mirror create name ppa:user/project
Example:
$ aptly mirror create wheezy-main http://mirror.yandex.ru/debian/ wheezy main
Options:
aptly mirror list
List shows full list of remote repository mirrors.
Example:
$ aptly mirror list
Options:
aptly mirror show name
Shows detailed information about the mirror.
Example:
$ aptly mirror show wheezy-main
Options:
aptly mirror drop name
Drop deletes information about remote repository mirror name. Package data is not deleted (since it could still be 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 -force to override.
Example:
$ aptly mirror drop wheezy-main
Options:
aptly mirror update name
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 can be run multiple times to get updated repository contents. If interrupted, command can be safely restarted.
Example:
$ aptly mirror update wheezy-main
Options:
aptly mirror rename old-name new-name
Command changes name of the mirror.Mirror name should be unique.
Example:
$ aptly mirror rename wheezy-min wheezy-main
aptly mirror edit name
Command edit allows one to change settings of mirror: filters, list of architectures.
Example:
$ aptly mirror edit -filter=nginx -filter-with-deps some-mirror
Options:
aptly mirror search name [package-query]
Command search displays list of packages in mirror that match package query
If query is not specified, all the packages are displayed.
Example:
$ aptly mirror search wheezy-main ’$Architecture (i386), Name (% *-dev)’
Options:
aptly repo add name
Command adds packages to local repository from .deb, .udeb (binary packages) and .dsc (source packages) files. When importing from directory aptly would do recursive scan looking for all files matching .[u]deb or.dsc patterns. Every file discovered would be analyzed to extract metadata, package would then be created and added to the database. Files would be imported to internal package pool. For source packages, all required files are added automatically as well. Extra files for source package should be in the same directory as *.dsc file.
Example:
$ aptly repo add testing myapp-0.1.2.deb incoming/
Options:
aptly repo copy src-name dst-name package-query ...
Command copy copies packages matching package-query from local repo src-name to local repo dst-name.
Example:
$ aptly repo copy testing stable ’myapp (=0.1.12)’
Options:
aptly repo create name [ from snapshot snapshot ]
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.
If local package repository is created from snapshot, repo initial contents are copied from snapsot contents.
Example:
$ aptly repo create testing
$ aptly repo create mysql35 from snapshot mysql-35-2017
Options:
aptly repo drop name
Drop information about deletions from local repo. Package data is not deleted (since it could be still used by other mirrors or snapshots).
Example:
$ aptly repo drop local-repo
Options:
aptly repo edit name
Command edit allows one to change metadata of local repository: comment, default distribution and component.
Example:
$ aptly repo edit -distribution=wheezy testing
Options:
aptly repo import src-mirror dst-repo package-query ...
Command import looks up packages matching package-query in mirror src-mirror and copies them to local repo dst-repo.
Example:
$ aptly repo import wheezy-main testing nginx
Options:
aptly repo list
List command shows full list of local package repositories.
Example:
$ aptly repo list
Options:
aptly repo move src-name dst-name package-query ...
Command move moves packages matching package-query from local repo src-name to local repo dst-name.
Example:
$ aptly repo move testing stable ’myapp (=0.1.12)’
Options:
aptly repo remove name package-query ...
Commands removes packages matching package-query from local repository name. If removed packages are not referenced by other repos or snapshots, they can be removed completely (including files) by running ’aptly db cleanup’.
Example:
$ aptly repo remove testing ’myapp (=0.1.12)’
Options:
aptly repo show name
Show command shows full information about local package repository.
ex: $ aptly repo show testing
Options:
aptly repo rename old-name new-name
Command changes name of the local repo. Local repo name should be unique.
Example:
$ aptly repo rename wheezy-min wheezy-main
aptly repo search name [package-query]
Command search displays list of packages in local repository that match package query
If query is not specified, all the packages are displayed.
Example:
$ aptly repo search my-software ’$Architecture (i386), Name (% *-dev)’
Options:
aptly repo include <file.changes>|directory ...
Command include looks for .changes files in list of arguments or specified directories. Each .changes file is verified, parsed, referenced files are put into separate temporary directory and added into local repository. Successfully imported files are removed by default.
Additionally uploads could be restricted with <uploaders.json> file. Rules in this file control uploads based on GPG key ID of .changes file signature and queries on .changes file fields.
Example:
$ aptly repo include -repo=foo-release incoming/
Options:
aptly snapshot create name from mirror mirror-name | from repo repo-name | empty
Command create name from mirror makes persistent immutable snapshot of remote repository mirror. Snapshot could be published or further modified using merge, pull and other aptly features.
Command create name from repo makes persistent immutable snapshot of local repository. Snapshot could be processed as mirror snapshots, and mixed with snapshots of remote mirrors.
Command create name empty creates empty snapshot that could be used as a basis for snapshot pull operations, for example. As snapshots are immutable, creating one empty snapshot should be enough.
Example:
$ aptly snapshot create wheezy-main-today from mirror wheezy-main
aptly snapshot list
Command list shows full list of snapshots created.
Example:
$ aptly snapshot list
Options:
aptly snapshot show name
Command show displays full information about a snapshot.
Example:
$ aptly snapshot show wheezy-main
Options:
aptly snapshot verify name [source ...]
Verify does dependency resolution in snapshot name, possibly using additional snapshots source as dependency sources. All unsatisfied dependencies are printed.
Example:
$ aptly snapshot verify wheezy-main wheezy-contrib wheezy-non-free
aptly snapshot pull name source destination package-query ...
Command pull pulls new packages along with its’ dependencies to snapshot name from snapshot source. Pull can upgrade package version in name with versions from source following dependencies. New snapshot destination is created as a result of this process. Packages could be specified simply as ’package-name’ or as package queries.
Example:
$ aptly snapshot pull wheezy-main wheezy-backports wheezy-new-xorg xorg-server-server
Options:
aptly snapshot diff name-a name-b
Displays difference in packages between two snapshots. Snapshot is a list of packages, so difference between snapshots is a difference between package lists. Package could be either completely missing in one snapshot, or package is present in both snapshots with different versions.
Example:
$ aptly snapshot diff -only-matching wheezy-main wheezy-backports
Options:
aptly snapshot merge destination source [source...]
Merge command merges several source snapshots into one destination snapshot. Merge happens from left to right. By default, packages with the same name-architecture pair are replaced during merge (package from latest snapshot on the list wins). If run with only one source snapshot, merge copies source into destination.
Example:
$ aptly snapshot merge wheezy-w-backports wheezy-main wheezy-backports
Options:
aptly snapshot drop name
Drop removes information about a snapshot. If snapshot is published, it can’t be dropped.
Example:
$ aptly snapshot drop wheezy-main
Options:
aptly snapshot rename old-name new-name
Command changes name of the snapshot. Snapshot name should be unique.
Example:
$ aptly snapshot rename wheezy-min wheezy-main
aptly snapshot search name [package-query]
Command search displays list of packages in snapshot that match package query
If query is not specified, all the packages are displayed.
Example:
$ aptly snapshot search wheezy-main ’$Architecture (i386), Name (% *-dev)’
Options:
aptly snapshot filter source destination package-query ...
Command filter does filtering in snapshot source, producing another snapshot destination. Packages could be specified simply as ’package-name’ or as package queries.
Example:
$ aptly snapshot filter wheezy-main wheezy-required ’Priority (required)’
Options:
aptly publish drop distribution [[endpoint:]prefix]
Command removes whatever has been published under specified prefix, publishing endpoint and distribution name.
Example:
$ aptly publish drop wheezy
Options:
aptly publish list
Display list of currently published snapshots.
Example:
$ aptly publish list
Options:
aptly publish repo name [[endpoint:]prefix]
Command publishes current state of local repository ready to be consumed by apt tools. Published repostiories appear under rootDir/public directory. Valid GPG key is required for publishing.
Multiple component repository could be published by specifying several components split by commas via -component flag and multiple local repositories as the arguments:
aptly publish repo -component=main,contrib repo-main repo-contrib
It is not recommended to publish local repositories directly unless the repository is for testing purposes and changes happen frequently. For production usage please take snapshot of repository and publish it using publish snapshot command.
Example:
$ aptly publish repo testing
Options:
aptly publish snapshot name [[endpoint:]prefix]
Command publishes snapshot as Debian repository ready to be consumed by apt tools. Published repostiories appear under rootDir/public directory. Valid GPG key is required for publishing.
Multiple component repository could be published by specifying several components split by commas via -component flag and multiple snapshots as the arguments:
aptly publish snapshot -component=main,contrib snap-main snap-contrib
Example:
$ aptly publish snapshot wheezy-main
Options:
aptly publish switch distribution [[endpoint:]prefix] new-snapshot
Command switches in-place published snapshots with new snapshot contents. All publishing parameters are preserved (architecture list, distribution, component).
For multiple component repositories, flag -component should be given with list of components to update. Corresponding snapshots should be given in the same order, e.g.:
aptly publish switch -component=main,contrib wheezy wh-main wh-contrib
Example:
$ aptly publish switch wheezy ppa wheezy-7.5
This command would switch published repository (with one component) named ppa/wheezy (prefix ppa, dsitribution wheezy to new snapshot wheezy-7.5).
Options:
aptly publish update distribution [[endpoint:]prefix]
Command re-publishes (updates) published local repository. distribution and prefix should be occupied with local repository published using command aptly publish repo. Update happens in-place with minimum possible downtime for published repository.
For multiple component published repositories, all local repositories are updated.
Example:
$ aptly publish update wheezy ppa
Options:
aptly publish show distribution [[endpoint:]prefix]
Command show displays full information of a published repository.
Example:
$ aptly publish show wheezy
Options:
aptly package search [package-query]
Command search displays list of packages in whole DB that match package query.
If query is not specified, all the packages are displayed.
Example:
$ aptly package search ’$Architecture (i386), Name (% *-dev)’
Options:
aptly package show package-query
Command shows displays detailed meta-information about packages matching query. Information from Debian control file is displayed. Optionally information about package files and inclusion into mirrors/snapshots/local repos is shown.
Example:
$ aptly package show ’nginx-light_1.2.1-2.2+wheezy2_i386’
Options:
aptly db cleanup
Database cleanup removes information about unreferenced packages and removes files in the package pool that aren’t used by packages anymore
Example:
$ aptly db cleanup
Options:
aptly db recover
Database recover does its’ best to recover the database after a crash. It is recommended to backup the DB before running recover.
Example:
$ aptly db recover
aptly serve
Command serve starts embedded HTTP server (not suitable for real production usage) to serve contents of public/ subdirectory of aptly’s root that contains published repositories.
Example:
$ aptly serve -listen=:8080
Options:
aptly api serve
Start HTTP server with aptly REST API. The server can listen to either a port or Unix domain socket. When using a socket, Aptly will fully manage the socket file. This command also supports taking over from a systemd file descriptors to enable systemd socket activation.
Example:
$ aptly api serve -listen=:8080 $ aptly api serve -listen=unix:///tmp/aptly.sock
Options:
aptly graph
Command graph displays relationship between mirrors, local repositories, snapshots and published repositories using graphviz package to render graph as an image.
Example:
$ aptly graph
Options:
aptly config show
Command show displays the current aptly configuration.
Example:
$ aptly config show
aptly task run -filename=filename | command1, command2, ...
Command helps organise multiple aptly commands in one single aptly task, running as single thread.
Example:
$ aptly task run > repo create local > repo add local pkg1 > publish repo local > serve >
Options:
aptly config show
Command show displays the current aptly configuration.
Example:
$ aptly config show
If environment variable HTTP_PROXY is set aptly would use its value to proxy all HTTP requests.
aptly exists with:
List of contributors, in chronological order:
January 2022 |