APTLY(1)

๐Ÿ“ฆ
version 1.6.2 ยท 3 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

๐ŸŽ€ APTLY(1) ๐ŸŽ€

Hey bestie! Welcome to the aptly manual โ€” yes, that aptly, the Debian repository management tool. This is part 1 of 6, and we are going to vibe through every single flag and config like the main character we are. ๐Ÿ’…โœจ


โœจ NAME โœจ

  • aptly โ€” Debian repository management tool

๐ŸŒธ SYNOPSIS ๐ŸŒธ

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

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

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.

๐Ÿ’– CONFIGURATION ๐Ÿ’–

aptly looks for configuration file first in ~/.aptly.conf then in /usr/local/etc/aptly.conf and /etc/aptly.conf. If no config file found (or they are not readable), a new one is created in the 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.

With aptly version 1.6.0, yaml configuration with inline documentation is supported and recommended (see debian/aptly.conf).

The legacy json configuration is still supported (and also supports comments):

           // vim: : filetype=json
           // json configuration file with comments
           // validate with: sed โ€™/\/\//dโ€™ aptly.conf | json_pp
           {

           // Aptly Configuration File
           ////////////////////////////

             // Root directory for:
             // - downloaded packages (`rootDir`/pool)
             // - database (`rootDir`/db)
             // - published repositories (`rootDir`/public)
             "rootDir": "~/.aptly",

             // Number of attempts to open database if itโ€™s locked by other instance
             // * -1 (no retry)
             "databaseOpenAttempts": -1,

             // Log Level
             // * debug
             // * info
             // * warning
             // * error
             "logLevel": "info",

             // Log Format
             // * default (text)
             // * json
             "logFormat": "default",

             // Default Architectures
             // empty array defaults to all available architectures
             "architectures": [],

             // Follow contents of `Suggests:` field when processing dependencies for the package
             "dependencyFollowSuggests": false,

             // Follow contents of `Recommends:` field when processing dependencies for the package
             "dependencyFollowRecommends": false,

             // When dependency looks like `package-a | package-b`, follow both variants always
             "dependencyFollowAllVariants": false,

             // Follow dependency from binary package to source package
             "dependencyFollowSource": false,

             // Log additional details while resolving dependencies (useful for debugging)
             "dependencyVerboseResolve": false,

             // Specifies paramaters for short PPA url expansion
             // empty defaults to output of `lsb_release` command
             "ppaDistributorID": "ubuntu",

             // Codename for short PPA url expansion
             "ppaCodename": "",

             // OBSOLETE
             // in aptly up to version 1.0.0, package files were stored in internal package pool
             // with MD5-dervied path, since 1.1.0 package pool layout was changed;
             // if option is enabled, aptly stops checking for legacy paths;
             // by default option is enabled for new aptly installations and disabled when
             // upgrading from older versions
             "skipLegacyPool": true,

           // Aptly Server
           ////////////////

             // Serve published repos as well as API
             "serveInAPIMode": false,

             // Enable metrics for Prometheus client
             "enableMetricsEndpoint": false,

             // Not implemented in this version.
             // Enable API documentation on /docs
             //"enableSwaggerEndpoint": false,

             // OBSOLETE: use via url param ?_async=true
             "AsyncAPI": false,

           // Database
           ////////////

             // Database backend
             // Type must be one of:
             // * leveldb (default)
             // * etcd
             "databaseBackend": {
               // LevelDB
               "type": "leveldb",
               // Path to leveldb files
               // empty dbPath defaults to `rootDir`/db
               "dbPath": ""

               // // etcd
               // "type": "etcd",
               // // URL to db server
               // "url": "127.0.0.1:2379"
             },

           // Mirroring
           /////////////

             // Downloader
             // * "default"
             // * "grab"      (more robust)
             "downloader": "default",

             // Number of parallel download threads to use when downloading packages
             "downloadConcurrency": 4,

             // Limit in kbytes/sec on download speed while mirroring remote repositories
             "downloadSpeedLimit": 0,

             // Number of retries for download attempts
             "downloadRetries": 0,

             // Download source packages per default
             "downloadSourcePackages": false,

           // Signing
           ///////////

             // GPG Provider
             // * "internal" (Go internal implementation)
             // * "gpg"      (External `gpg` utility)
             "gpgProvider": "gpg",

             // Disable signing of published repositories
             "gpgDisableSign": false,

             // Disable signature verification of remote repositories
             "gpgDisableVerify": false,

           // Publishing
           //////////////

             // Do not publish Contents files
             "skipContentsPublishing": false,

             // Do not create bz2 files
             "skipBz2Publishing": false,

           // Storage
           ///////////

             // Filesystem publishing endpoints
             //
             // 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`
             //
             "FileSystemPublishEndpoints": {
               // // Endpoint Name
               // "test1": {
               //    // Directory for publishing
               //    "rootDir": "/opt/srv/aptly_public",

               //    // File Link Method for linking files from the internal pool to the published directory
               //    // * hardlink
               //    // * symlink
               //    // * copy
               //    "linkMethod": "hardlink",

               //    // File Copare Method for comparing existing links from the internal pool to the published directory
               //    // Only used when "linkMethod" is set to "copy"
               //    // * md5 (default: compare md5 sum)
               //    // * size (compare file size)
               //    "verifyMethod": "md5"
               // }
             },

             // S3 Endpoint Support
             //
             // 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:`
             //
             "S3PublishEndpoints": {
               // // Endpoint Name
               // "test": {

               //    // Amazon region for S3 bucket
               //    "region": "us-east-1",

               //    // Bucket name
               //    "bucket": "test-bucket",

               //    // Endpoint (optional)
               //    // When using S3-compatible cloud storage, specify hostname of service endpoint here,
               //    // region is ignored if endpoint is set (set region to some human-readable name)
               //    // (should be left blank for real Amazon S3)
               //    "endpoint": "",

               //    // Prefix (optional)
               //    // publishing under specified prefix in the bucket, defaults to
               //    // no prefix (bucket root)
               //    "prefix": "",

               //    // Default ACLs (optional)
               //    // assign ACL to published files (one of the canned ACLs in Amazon
               //    // terminology). Useful values: `private` (default), `public-read` (public
               //    // repository) or `none` (donโ€™t set ACL). Public repositories could be consumed by `apt` using
               //    // HTTP endpoint (Amazon bucket should be configured for "website hosting"),
               //    // for private repositories special apt S3 transport is required.
               //    "acl": "private",

               //    // Credentials (optional)
               //    // Amazon credentials to access S3 bucket. If not supplied,
               //    // environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
               //    // are used.
               //    "awsAccessKeyID": "",
               //    "awsSecretAccessKey": "",

               //    // Storage Class (optional)
               //    // Amazon S3 storage class, defaults to `STANDARD`. Other values
               //    // available: `REDUCED_REDUNDANCY` (lower price, lower redundancy)
               //    "storageClass": "STANDARD",

               //    // Encryption Method (optional)
               //    // Server-side encryption method, defaults to none. Currently
               //    // the only available encryption method is `AES256`
               //    "encryptionMethod": "none",

               //    // Plus Workaround (optional)
               //    // Workaround misbehavior in apt and Amazon S3 for files with `+` in filename by
               //    // creating two copies of package files with `+` in filename: one original
               //    // and another one with spaces instead of plus signs
               //    // With `plusWorkaround` enabled, package files with plus sign
               //    // would be stored twice. aptly might not cleanup files with spaces when published
               //    // repository is dropped or updated (switched) to new version of repository (snapshot)
               //    "plusWorkaround": false,
               //    // Disable MultiDel (optional)
               //    // For S3-compatible cloud storages which do not support `MultiDel` S3 API,
               //    // enable this setting (file deletion would be slower with this setting enabled)
               //    "disableMultiDel": false,

               //    // ForceSig2 (optional)
               //    // Disable Signature V4 support, useful with non-AWS S3-compatible object stores
               //    // which do not support SigV4, shouldnโ€™t be enabled for AWS
               //    "forceSigV2": false,

               //    // ForceVirtualHostedStyle (optional)
               //    // Disable path style visit, useful with non-AWS S3-compatible object stores
               //    // which only support virtual hosted style
               //    "forceVirtualHostedStyle": false,

               //    // Debug (optional)
               //    // Enables detailed request/response dump for each S3 operation
               //    "debug": false
               // }
             },

             // Swift Endpoint Support
             //
             // 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:`
             //
             "SwiftPublishEndpoints": {
               // Endpoint Name
               // "test": {

               //    // Container Name
               "container": "taylor1",

               //    // Prefix (optional)
               //    // Publish under specified prefix in the container, defaults to no prefix (container root)
               "prefix": "",

               //    // Credentials (optional)
               //    // OpenStack credentials to access Keystone. If not supplied, environment variables `OS_USERNAME` and `OS_PASSWORD` are used
               "osname": "",
               "password": "",

               //    // Tenant (optional)
               //    // OpenStack tenant name and id (in order to use v2 authentication)
               "tenant": "",
               "tenantid": "",

               //    // Auth URL (optional)
               //    // Full url of Keystone server (including port, and version).
               //    // Example `http://identity.example.com:5000/v2.0`
               "authurl": ""
               // }
             },

             // Azure Endpoint Support
             //
             // aptly can be configured to publish repositories directly to Microsoft Azure Blob
             // Storage. First, publishing endpoints should be described in the aptly
             // configuration file. Each endpoint has its name and associated settings.
             "AzurePublishEndpoints": {
               // // Endpoint Name
               // "test": {

               //    // Container Name
               "container": "container1",

               //    // Prefix (optional)
               //    // Publishing under specified prefix in the container, defaults to no prefix (container root)
               "prefix": "",

               //    // Credentials
               //    // Azure storage account access key to access blob storage
               "accountName": "",
               "accountKey": "",

               //    // Endpoint URL
               //    // See: Azure documentation https://docs.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string
               //    // defaults to "https://<accountName>.blob.core.windows.net"
               "endpoint": ""
               // }
             },

             // Package Pool
             // Location for storing downloaded packages
             // Type must be one of:
             // * local
             // * azure
             "packagePoolStorage": {
               // Local Pool
               "type": "local",
               // Local Pool Path
               // empty path defaults to `rootDir`/pool
               "path": ""

               // // Azure Azure Blob Storage Pool
               // "type": "azure",
               // "container": "pool1",

               // // Prefix (optional)
               // // Publishing under specified prefix in the container, defaults to no prefix (container root)
               // "prefix": "",

               // // Credentials
               // // Azure storage account access key to access blob storage
               // "accountName": "",
               // "accountKey": "",

               // // Endpoint URL
               // // See: Azure documentation https://docs.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string
               // // defaults to "https://<accountName>.blob.core.windows.net"
               // "endpoint": ""
             }

           // End of config
           }

๐Ÿ” PACKAGE QUERY ๐Ÿ”

okay bestie listen UP because this section is the moment ๐Ÿ’… some commands let you hand over a package query to say exactly which packages you want to mess with. The syntax is almost a carbon copy of the reprepro query language, so if you've met reprepro before, this is giving dรฉjร  vu ๐Ÿซถ

A query is built out of these little simple terms:

  • direct package reference โ€” points at exactly one package. The format is identical to the way aptly lists packages in show commands with the -with-packages flag: name_version_arch, like:
libmysqlclient18_5.5.35-rel33.0-611.squeeze_amd64
  • dependency condition โ€” syntax follows the Debian dependency specification: package_name followed by an optional version specification and architecture limit, e.g.:
mysql-client (>= 3.6)
  • query against package fields โ€” same syntax as dependency conditions, but instead of the package name you use a field name, e.g. Priority (optional).

โœจ Supported fields โœจ

  • all field names from Debian package control files are supported except for Filename, MD5sum, SHA1, SHA256, Size, Files, Checksums-SHA1, Checksums-SHA256.
  • $Source is a name of source package (for binary packages)
  • $SourceVersion is a version of source package
  • $Architecture is Architecture for binary packages and source for source packages; when matching with the equal (=) operator, a package with any architecture matches all architectures but source.
  • $Version has the same value as Version, but comparison operators use Debian version precedence rules
  • $PackageType is deb for binary packages and source for source packages

โœจ Operators โœจ

  • = โ€” strict match, and this is also the default operator if you give no operator at all
  • >=, <=, =, >> (strictly greater), << (strictly less) โ€” lexicographical comparison for all fields, plus special rules when comparing package versions
  • % โ€” pattern matching, like shell patterns; supported special symbols are [^]?*, e.g.: $Version (% 3.5-*)
  • ~ โ€” regular expression matching, e.g.: Name (~ .*-dev)

Simple terms can be combined into more complex queries using the operators , (and), | (or) and ! (not), and parentheses () are used to change operator precedence. A match value can be enclosed in single (โ€™) or double (") quotes if you need to resolve ambiguity, and quotes inside a quoted string should be escaped with a slash (\).

โœจ Examples โœจ

  • mysql-client โ€” matches package mysql-client of any version and architecture (including source), and also matches packages that Provide: mysql-client.
  • mysql-client (>= 3.6) โ€” matches package mysql-client with version greater or equal to 3.6. Valid operators for version are: >=, <=, =, >> (strictly greater), << (strictly less).
  • mysql-client {i386} โ€” matches package mysql-client on architecture i386; architecture all matches all architectures but source.
  • mysql-client (>= 3.6) {i386} โ€” version and architecture conditions combined ๐Ÿ’ซ
  • libmysqlclient18_5.5.35-rel33.0-611.squeeze_amd64 โ€” direct package reference.
  • $Source (nginx) โ€” all binary packages with nginx as source package.
  • !Name (~ .*-dev), mail-transport, $Version (>= 3.5) โ€” matches all packages that provide mail-transport with a name that has no suffix -dev and with version greater or equal to 3.5.
heads up bestie ๐Ÿšจ when you specify a query on the command line, you may have to quote it according to shell rules so it stays a single argument:
aptly repo import percona stable โ€™mysql-client (>= 3.6)โ€™

๐ŸŽ€ PACKAGE DISPLAY FORMAT ๐ŸŽ€

Some aptly commands (aptly mirror search, aptly package search, ...) support the -format flag, which lets you customize how search results get printed โœจ Golang templates are used to specify the display format, and all package stanza fields are available to the template. On top of the package stanza fields, aptly gives you these extra ones:

  • Key โ€” internal aptly package ID, unique for all packages in aptly (combination of ShortKey and FilesHash).
  • FilesHash โ€” hash that includes MD5 of all packages files.
  • ShortKey โ€” package ID, which is unique in a single list (mirror, repo, snapshot, ...), but not unique in the whole aptly package collection.

For example, the 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


๐Ÿ‘‘ GLOBAL OPTIONS ๐Ÿ‘‘

  • -architectures= โ€” list of architectures to consider during (comma-separated), default to all available
  • -config= โ€” location of configuration file (default locations in order: ~/.aptly.conf, /usr/local/etc/aptly.conf, /etc/aptly.conf)
  • -db-open-attempts=10 โ€” number of attempts to open DB if itโ€™s locked by other instance
  • -dep-follow-all-variants โ€” when processing dependencies, follow a & b if dependency is โ€™a|bโ€™
  • -dep-follow-recommends โ€” when processing dependencies, follow Recommends
  • -dep-follow-source โ€” when processing dependencies, follow from binary to Source packages
  • -dep-follow-suggests โ€” when processing dependencies, follow Suggests
  • -dep-verbose-resolve โ€” when processing dependencies, print detailed logs
  • -gpg-provider= โ€” PGP implementation ("gpg", "gpg1", "gpg2" for external gpg or "internal" for Go internal implementation)

๐Ÿชž CREATE NEW MIRROR ๐Ÿชž

bestie, this is where the magic starts. The synopsis is:

aptly mirror create name archive url distribution [component1 ...]

So you're making a mirror literally named name of a remote repository. aptly is down for both regular AND flat Debian repos exported over HTTP and FTP (yes, both, we love range ๐Ÿ’…). aptly will try to download the Release file from the remote repo and verify its signature โ€” no fake releases on her watch. And the command line format? It resembles the apt utility sources.list(5), so if you already speak apt, you already speak this.

PPA urls can be given in the short format, which is giving convenience:

$ aptly mirror create name ppa:user/project

Example time, periodt:

$ aptly mirror create wheezy-main http://mirror.yandex.ru/debian/ wheezy main

โœจ Options โœจ

  • -filter= โ€” filter packages in the mirror. Use @file to read the filter from a file, or @- for stdin.
  • -filter-with-deps โ€” when filtering, also include the dependencies of the packages that matched.
  • -force-architectures โ€” (only works when you pass an architecture list) skips the check that the requested architectures are actually listed in the Release file.
  • -force-components โ€” (only with a component list) skips the check that the requested components are listed in the Release file.
  • -ignore-signatures โ€” turns off verification of Release file signatures.
  • -keyring= โ€” the gpg keyring to use when verifying the Release file. You can pass it more than once, no cap.
  • -max-tries=1 โ€” max download tries before the process fails with a download error. Default is 1.
  • -with-installer โ€” downloads the extra not-packaged installer files too.
  • -with-sources โ€” grabs source packages on top of binary packages.
  • -with-udebs โ€” downloads .udeb packages (that's Debian installer support, iconic).

๐Ÿ“‹ LIST MIRRORS ๐Ÿ“‹

aptly mirror list

This shows the full list of remote repository mirrors. All of them. Every single one.

Example:

$ aptly mirror list

โœจ Options โœจ

  • -json โ€” display the list in JSON format.
  • -raw โ€” display the list in machine-readable format.

๐Ÿ” SHOW DETAILS ABOUT MIRROR ๐Ÿ”

aptly mirror show name

Shows detailed info about the mirror. Receipts, basically.

Example:

$ aptly mirror show wheezy-main

โœจ Options โœจ

  • -json โ€” display the record in JSON format.
  • -with-packages โ€” show the detailed list of packages and versions stored in the mirror.

๐Ÿ—‘๏ธ DELETE MIRROR ๐Ÿ—‘๏ธ

aptly mirror drop name

drop deletes the information about the remote repository mirror name. Important: the package data is not deleted (because it could still be used by other mirrors or snapshots โ€” sharing is caring).

Heads up bestie: if the mirror is used as a source to create a snapshot, aptly will refuse to delete it. Use the -force flag to override that. She's just looking out for you. ๐Ÿ˜ญ

Example:

$ aptly mirror drop wheezy-main

โœจ Options โœจ

  • -force โ€” force mirror deletion even if it's used by snapshots.

๐Ÿ”„ UPDATE MIRROR ๐Ÿ”„

aptly mirror update name

Updates the remote mirror โ€” downloads package files and meta information. When a mirror is first created, you should run this command for the first time to actually fetch the mirror contents. And you can run it multiple times to get updated repository contents, so it stays fresh โœจ. If it gets interrupted, no stress โ€” the command can be safely restarted.

Example:

$ aptly mirror update wheezy-main

โœจ Options โœจ

  • -download-limit=0 โ€” limit download speed (in kbytes/sec). Default 0.
  • -downloader=default โ€” the downloader to use (e.g. grab). Default is default.
  • -force โ€” force update the mirror even if it's locked by another process.
  • -ignore-checksums โ€” ignore checksum mismatches while downloading package files and metadata.
  • -ignore-signatures โ€” disable verification of Release file signatures.
  • -keyring= โ€” the gpg keyring to use when verifying the Release file (can be specified multiple times).
  • -max-tries=1 โ€” max download tries until the process fails with a download error. Default 1.
  • -skip-existing-packages โ€” don't check file existence for packages listed in the mirror's internal database.

๐Ÿท๏ธ RENAMES MIRROR ๐Ÿท๏ธ

aptly mirror rename old-name new-name

This command changes the name of the mirror. And btw: mirror names should be unique. One name, one mirror, no duplicates.

Example:

$ aptly mirror rename wheezy-min wheezy-main

โœ๏ธ EDIT MIRROR SETTINGS โœ๏ธ

aptly mirror edit name

edit lets you change the settings of a mirror: filters, the list of architectures, all of it. Glow-up mode.

Example:

$ aptly mirror edit -filter=nginx -filter-with-deps some-mirror

โœจ Options โœจ

  • -archive-url= โ€” archive url is the root of the archive.
  • -filter= โ€” filter packages in the mirror. Use @file to read the filter from a file, or @- for stdin.
  • -filter-with-deps โ€” when filtering, include dependencies of matching packages as well.
  • -ignore-signatures โ€” disable verification of Release file signatures.
  • -keyring= โ€” the gpg keyring to use when verifying the Release file (can be specified multiple times).
  • -with-installer โ€” download the additional not-packaged installer files.
  • -with-sources โ€” download source packages in addition to binary packages.
  • -with-udebs โ€” download .udeb packages (Debian installer support).

๐Ÿ”Ž SEARCH MIRROR FOR PACKAGES MATCHING QUERY ๐Ÿ”Ž

aptly mirror search name [package-query]

search displays the list of packages in the mirror that match the package query.

If you don't specify a query, all the packages are displayed. Everything. The whole menu.

Example:

$ aptly mirror search wheezy-main '$Architecture (i386), Name (% *-dev)'

โœจ Options โœจ

  • -format= โ€” custom format for result printing.
  • -with-deps โ€” include dependencies in the search results.

๐Ÿ“ฆ ADD PACKAGES TO LOCAL REPOSITORY ๐Ÿ“ฆ

aptly repo add name (<package file.deb>|<directory>)...

This command adds packages to a local repository from .deb, .udeb (binary packages) and .dsc (source packages) files. When you import from a directory, aptly does a recursive scan looking for all files matching .[u]deb or .dsc patterns. Every file she discovers gets analyzed to extract metadata, a package gets created from it, and then it's added to the database. Files are imported into the internal package pool. For source packages, all required files are added automatically as well โ€” and any extra files for a source package should live in the same directory as the *.dsc file. iykyk.

Example:

$ aptly repo add testing myapp-0.1.2.deb incoming/

โœจ Options โœจ

  • -force-replace โ€” when adding a package that conflicts with an existing package, remove the existing one instead.
  • -remove-files โ€” remove files that have been imported successfully into the repository.

๐Ÿ“‹ COPY PACKAGES BETWEEN LOCAL REPOSITORIES ๐Ÿ“‹

aptly repo copy src-name dst-name package-query ...

copy copies packages matching package-query from the local repo src-name to the local repo dst-name. Simple as.

Example:

$ aptly repo copy testing stable 'myapp (=0.1.12)'

โœจ Options โœจ

  • -dry-run โ€” don't copy, just show what would be copied.
  • -with-deps โ€” follow dependencies when processing package-spec.

๐Ÿ†• CREATE LOCAL REPOSITORY ๐Ÿ†•

aptly repo create name [ from snapshot snapshot ]

Creates a local package repository. When created it's empty โ€” packages can then be added from files, copied or moved from another local repository, or imported from a mirror. Build it up like a playlist โœจ.

If a local package repository is created from snapshot, the repo's initial contents are copied from the snapshot's contents.

Example:

$ aptly repo create testing

$ aptly repo create mysql35 from snapshot mysql-35-2017

โœจ Options โœจ

  • -comment= โ€” any text that would be used to describe the local repository.
  • -component=main โ€” default component when publishing. Default is main.
  • -distribution= โ€” default distribution when publishing.
  • -uploaders-file= โ€” the uploaders.json to be used when including .changes into this repository.

๐Ÿ’€ DELETE LOCAL REPOSITORY ๐Ÿ’€

aptly repo drop name

Drops information about deletions from the local repo. Important, bestie: the package data is not deleted (since it could still be used by other mirrors or snapshots).

Example:

$ aptly repo drop local-repo

โœจ Options โœจ

  • -force โ€” force local repo deletion even if it's used by snapshots.

โœ๏ธ EDIT PROPERTIES OF LOCAL REPOSITORY โœ๏ธ

aptly repo edit name

edit lets you change the metadata of a local repository: comment, default distribution and component. Little makeover moment ๐ŸŽ€.

Example:

$ aptly repo edit -distribution=wheezy testing

โœจ Options โœจ

  • -comment= โ€” any text that would be used to describe the local repository.
  • -component= โ€” default component when publishing.
  • -distribution= โ€” default distribution when publishing.
  • -uploaders-file= โ€” the uploaders.json to be used when including .changes into this repository.

๐Ÿšš IMPORT PACKAGES FROM MIRROR TO LOCAL REPOSITORY ๐Ÿšš

aptly repo import src-mirror dst-repo package-query ...

import looks up packages matching package-query in the mirror src-mirror and copies them to the local repo dst-repo. Moving them from the big pond to your pond ๐ŸŸ.

Example:

$ aptly repo import wheezy-main testing nginx

โœจ Options โœจ

  • -dry-run โ€” don't import, just show what would be imported.
  • -with-deps โ€” follow dependencies when processing package-spec.

๐Ÿ“ƒ LIST LOCAL REPOSITORIES ๐Ÿ“ƒ

aptly repo list

list shows the full list of local package repositories. All of them, front to back.

Example:

$ aptly repo list

โœจ Options โœจ

  • -json โ€” display the list in JSON format.
  • -raw โ€” display the list in machine-readable format.

๐Ÿ”€ MOVE PACKAGES BETWEEN LOCAL REPOSITORIES ๐Ÿ”€

aptly repo move src-name dst-name package-query ...

move moves packages matching package-query from the local repo src-name to the local repo dst-name. And remember: use @file to read package queries from a file, or @- for stdin.

Example:

$ aptly repo move testing stable 'myapp (=0.1.12)'

โœจ Options โœจ

  • -dry-run โ€” don't move, just show what would be moved.
  • -with-deps โ€” follow dependencies when processing package-spec.

โŒ REMOVE PACKAGES FROM LOCAL REPOSITORY โŒ

aptly repo remove name package-query ...

This command removes packages matching package-query from the local repository name. And here's the tea: if the removed packages are not referenced by other repos or snapshots, they can be removed completely (files included) by running aptly db cleanup.

Again: use @file to read package queries from a file, or @- for stdin.

Example:

$ aptly repo remove testing 'myapp (=0.1.12)'

โœจ Options โœจ

  • -dry-run โ€” don't remove, just show what would be removed.

๐Ÿ‘€ SHOW DETAILS ABOUT LOCAL REPOSITORY ๐Ÿ‘€

aptly repo show name

show shows the full information about a local package repository. The whole lore.

ex:

$ aptly repo show testing

โœจ Options โœจ

  • -json โ€” display the record in JSON format.
  • -with-packages โ€” show the list of packages.

๐Ÿท๏ธ RENAMES LOCAL REPOSITORY ๐Ÿท๏ธ

aptly repo rename old-name new-name

This command changes the name of the local repo. And yes โ€” the local repo name should be unique. No two repos wearing the same name, that's not the vibe.

Example:

$ aptly repo rename wheezy-min wheezy-main

๐Ÿ” SEARCH REPO FOR PACKAGES MATCHING QUERY

aptly repo search name [package-query]

So search shows you the list of packages sitting in a local repository that match a package query. That's it. That's the whole job. ๐Ÿ’…

And if you don't pass a query at all? Every single package shows up. All of them. The whole roster. ๐ŸŒˆ

Example:

$ aptly repo search my-software '$Architecture (i386), Name (% *-dev)'

Options:

  • -format= โ€” custom format for result printing
  • -with-deps โ€” include dependencies into search results

๐Ÿ“ฅ ADD PACKAGES TO LOCAL REPOSITORIES BASED ON .CHANGES FILES

aptly repo include (<file.changes>|<directory>)...

include goes hunting for .changes files in the arguments you gave it, or in the directories you pointed at. Each .changes file gets verified, parsed, and every referenced file is dropped into its own temporary directory and added into the local repository. And here's the vibe: files that imported successfully get removed by default. Gone. Slayed. ๐Ÿ—‘๏ธโœจ

Oh and also โ€” uploads can be locked down with an uploaders.json file. The rules in that file gate uploads based on the GPG key ID of the .changes file signature, plus queries on .changes file fields. Very gatekeep-y of it, love that. ๐Ÿšช

Example:

$ aptly repo include -repo=foo-release incoming/

Options:

  • -accept-unsigned โ€” accept unsigned .changes files
  • -force-replace โ€” when adding a package that conflicts with an existing package, remove the existing package
  • -ignore-signatures โ€” disable verification of the .changes file signature
  • -keyring= โ€” gpg keyring to use when verifying the Release file (could be specified multiple times)
  • -no-remove-files โ€” don't remove files that have been imported successfully into the repository
  • -repo={{.Distribution}} โ€” which repo the files should go to; defaults to the Distribution field of the .changes file
  • -uploaders-file= โ€” path to the uploaders.json file

๐Ÿ“ธ CREATES SNAPSHOT OF MIRROR (LOCAL REPOSITORY) CONTENTS

aptly snapshot create name (from mirror mirror-name | from repo repo-name | empty)

create name from mirror makes a persistent, immutable snapshot of a remote repository mirror. Immutable, bestie. It cannot be changed. But it can be published, or further modified using merge, pull, and other aptly features. โœจ

create name from repo makes a persistent, immutable snapshot of a local repository. You can process these just like mirror snapshots, and mix them with snapshots of remote mirrors. Chaos, but organized chaos. ๐Ÿฆ‹

create name empty makes an empty snapshot โ€” perfect as a basis for snapshot pull operations, for example. And because snapshots are immutable, making one empty snapshot should be enough. You only need the one. Periodt.

Example:

$ aptly snapshot create wheezy-main-today from mirror wheezy-main

๐Ÿ“‹ LIST SNAPSHOTS

aptly snapshot list

list shows the full list of snapshots you've created. The whole collection. ๐Ÿ‘‘

Example:

$ aptly snapshot list

Options:

  • -json โ€” display list in JSON format
  • -raw โ€” display list in machine-readable format
  • -sort=name โ€” display list in 'name' or creation 'time' order

๐Ÿ‘€ SHOWS DETAILS ABOUT SNAPSHOT

aptly snapshot show name

show spills the full information about a snapshot. Everything. The whole tea. โ˜•

Example:

$ aptly snapshot show wheezy-main

Options:

  • -json โ€” display record in JSON format
  • -with-packages โ€” show list of packages

โœ… VERIFY DEPENDENCIES IN SNAPSHOT

aptly snapshot verify name [source ...]

verify does dependency resolution inside the snapshot name, and it can use additional snapshots listed as source to act as dependency sources. Every unsatisfied dependency gets printed out. Every last one. ๐Ÿ˜ญ

Example:

$ aptly snapshot verify wheezy-main wheezy-contrib wheezy-non-free

๐Ÿงฒ PULL PACKAGES FROM ANOTHER SNAPSHOT

aptly snapshot pull name source destination package-query ...

pull grabs new packages along with their dependencies into the snapshot name, pulling from snapshot source. And it can upgrade a package version in name using versions from source, following dependencies as it goes. A brand new snapshot destination is created as the result of all this. ๐ŸŽ€

Packages can be named simply as package-name, or as package queries. Your call.

Use the @file syntax to read package queries from a file, and @- to read from stdin.

Example:

$ aptly snapshot pull wheezy-main wheezy-backports wheezy-new-xorg xorg-server-server

Options:

  • -all-matches โ€” pull all the packages that satisfy the dependency version requirements
  • -dry-run โ€” don't create the destination snapshot, just show what would be pulled
  • -no-deps โ€” don't process dependencies, just pull the listed packages
  • -no-remove โ€” don't remove other package versions when pulling a package

๐Ÿ†š DIFFERENCE BETWEEN TWO SNAPSHOTS

aptly snapshot diff name-a name-b

Shows you the difference in packages between two snapshots. A snapshot is literally just a list of packages, so the difference between snapshots is a difference between package lists. A package is either completely missing from one snapshot, or it's present in both but with different versions. That's the whole drama. ๐Ÿ’€

Example:

$ aptly snapshot diff -only-matching wheezy-main wheezy-backports

Options:

  • -only-matching โ€” display diff only for matching packages (don't display missing packages)

๐Ÿงฌ MERGES SNAPSHOTS

aptly snapshot merge destination source [source...]

merge merges several source snapshots into one destination snapshot. The merge happens from left to right. By default, packages with the same name-architecture pair get replaced during the merge โ€” the package from the latest snapshot on the list wins. Winner takes all. ๐Ÿ‘‘ If you run it with only one source snapshot, merge just copies that source into destination.

Example:

$ aptly snapshot merge wheezy-w-backports wheezy-main wheezy-backports

Options:

  • -latest โ€” use only the latest version of each package
  • -no-remove โ€” don't remove duplicate arch/name packages

๐Ÿ—‘๏ธ DELETE SNAPSHOT

aptly snapshot drop name

drop removes all information about a snapshot. But heads up bestie: if the snapshot is published, it can't be dropped. Nope. Not happening. ๐Ÿ™…

Example:

$ aptly snapshot drop wheezy-main

Options:

  • -force โ€” remove snapshot even if it was used as source for other snapshots

๐Ÿท๏ธ RENAMES SNAPSHOT

aptly snapshot rename old-name new-name

Changes the name of the snapshot. And the snapshot name has to be unique. No duplicates in this house. ๐Ÿ’…

Example:

$ aptly snapshot rename wheezy-min wheezy-main

๐Ÿ” SEARCH SNAPSHOT FOR PACKAGES MATCHING QUERY

aptly snapshot search name [package-query]

search shows the list of packages in a snapshot that match a package query. ๐ŸŒธ

No query specified? Then all the packages get displayed. Every one.

Use the @file syntax to read a package query from a file, and @- to read from stdin.

Example:

$ aptly snapshot search wheezy-main '$Architecture (i386), Name (% *-dev)'

Options:

  • -format= โ€” custom format for result printing
  • -with-deps โ€” include dependencies into search results

๐ŸŽ›๏ธ FILTER PACKAGES IN SNAPSHOT PRODUCING ANOTHER SNAPSHOT

aptly snapshot filter source destination package-query ...

filter filters inside snapshot source, producing another snapshot, destination. Packages can be specified simply as package-name, or as package queries.

Use the @file syntax to read package queries from a file, and @- to read from stdin.

Example:

$ aptly snapshot filter wheezy-main wheezy-required 'Priority (required)'

Options:

  • -with-deps โ€” include dependent packages as well

๐Ÿšฎ REMOVE PUBLISHED REPOSITORY

aptly publish drop distribution [[endpoint:]prefix]

This command removes whatever has been published under the specified prefix, publishing endpoint, and distribution name. Poof. Gone. ๐Ÿซฅ

Example:

$ aptly publish drop wheezy

Options:

  • -force-drop โ€” remove the published repository even if some files could not be cleaned up
  • -skip-cleanup โ€” don't remove unreferenced files in prefix/component

๐Ÿ“œ LIST OF PUBLISHED REPOSITORIES

aptly publish list

Displays the list of snapshots that are currently published. โœจ

Example:

$ aptly publish list

Options:

  • -json โ€” display list in JSON format
  • -raw โ€” display list in machine-readable format

๐ŸŒ PUBLISH LOCAL REPOSITORY

aptly publish repo name [[endpoint:]prefix]

This one publishes the current state of a local repository, all ready to be consumed by apt tools. Published repositories appear under the rootDir/public directory. And a valid GPG key is required for publishing. Non-negotiable. ๐Ÿ”‘

You can publish a multi-component repository by specifying several components split by commas via the -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 a snapshot of the repository and publish it using the publish snapshot command. For real. Don't skip this one. ๐Ÿ˜ญ

Example:

$ aptly publish repo testing

Options:

  • -acquire-by-hash โ€” provide index files by hash
  • -batch โ€” run GPG with detached tty
  • -butautomaticupgrades= โ€” set value for the ButAutomaticUpgrades field
  • -codename= โ€” codename to publish (defaults to distribution)
  • -component= โ€” component name to publish (for multi-component publishing, separate components with commas)
  • -distribution= โ€” distribution name to publish
  • -force-overwrite โ€” overwrite files in package pool in case of mismatch
  • -gpg-key= โ€” GPG key ID to use when signing the release
  • -keyring= โ€” GPG keyring to use (instead of default)
  • -label= โ€” label to publish
  • -multi-dist โ€” enable multiple packages with the same filename in different distributions
  • -notautomatic= โ€” set value for the NotAutomatic field
  • -origin= โ€” origin name to publish
  • -passphrase= โ€” GPG passphrase for the key (warning: could be insecure)
  • -passphrase-file= โ€” GPG passphrase-file for the key (warning: could be insecure)
  • -secret-keyring= โ€” GPG secret keyring to use (instead of default)
  • -skip-bz2 โ€” don't generate bzipped indexes
  • -skip-contents โ€” don't generate Contents indexes
  • -skip-signing โ€” don't sign Release files with GPG
  • -suite= โ€” suite to publish (defaults to distribution)

๐Ÿ”Ž SHOWS DETAILS OF PUBLISHED REPOSITORY

aptly publish show distribution [[endpoint:]prefix]

show displays the full information of a published repository. All of it. ๐Ÿ’–

Example:

$ aptly publish show wheezy

Options:

  • -json โ€” display record in JSON format

๐ŸŒธ PUBLISH SNAPSHOT ๐ŸŒธ

aptly publish snapshot name [[endpoint:]prefix]

okay so this one? this one is the main character of publishing. it takes a snapshot and turns it into a real Debian repository that your apt tools can actually eat. published repos show up under rootDir/public, and bestie, you need a valid GPG key for this. no key, no publish, no exceptions ๐Ÿ’…

you can also publish a multi-component repo by listing several components split by commas via the -component flag, with multiple snapshots as the arguments:

aptly publish snapshot -component=main,contrib snap-main snap-contrib

Example:

$ aptly publish snapshot wheezy-main

โœจ Options โœจ

  • -acquire-by-hash โ€” hand out index files by hash, iconic behaviour honestly
  • -batch โ€” run GPG with a detached tty
  • -butautomaticupgrades= โ€” overwrite the value for the ButAutomaticUpgrades field
  • -codename= โ€” codename to publish (defaults to distribution)
  • -component= โ€” component name to publish (for multi-component publishing, separate components with commas)
  • -distribution= โ€” distribution name to publish
  • -force-overwrite โ€” overwrite files in the package pool when there's a mismatch
  • -gpg-key= โ€” GPG key ID to use when signing the release
  • -keyring= โ€” GPG keyring to use (instead of the default)
  • -label= โ€” label to publish
  • -multi-dist โ€” enable multiple packages with the same filename in different distributions
  • -notautomatic= โ€” overwrite the value for the NotAutomatic field
  • -origin= โ€” overwrite origin name to publish
  • -passphrase= โ€” GPG passphrase for the key (warning: could be insecure)
  • -passphrase-file= โ€” GPG passphrase-file for the key (warning: could be insecure)
  • -secret-keyring= โ€” GPG secret keyring to use (instead of the default)
  • -skip-bz2 โ€” don't generate bzipped indexes
  • -skip-contents โ€” don't generate Contents indexes
  • -skip-signing โ€” don't sign Release files with GPG
  • -suite= โ€” suite to publish (defaults to distribution)

๐Ÿฆ‹ ADD SOURCE COMPONENTS TO A PUBLISHED REPO ๐Ÿฆ‹

aptly publish source add distribution source

this command adds components of a snapshot or local repository so they get published. ๐Ÿซถ

heads up though: it does not publish the changes right away. it lowkey just schedules them for a later aptly publish update. so it's giving "not yet, bestie" energy.

the -component flag is mandatory. use a comma-separated list of components if you're modifying multiple ones. and the number of components you give has to equal the number of sources you give, like:

aptly publish source add -component=main,contrib wheezy wheezy-main wheezy-contrib

Example:

$ aptly publish source add -component=contrib wheezy ppa wheezy-contrib

this assigns the snapshot wheezy-contrib to the component contrib and adds it to the published repository revision of ppa/wheezy. slay ๐Ÿ’…

โœจ Options โœจ

  • -component= โ€” component names to add (for multi-component publishing, separate components with commas)
  • -prefix=. โ€” publishing prefix in the form of [endpoint:]prefix

๐Ÿ’€ DROP PENDING SOURCE COMPONENT CHANGES OF A PUBLISHED REPOSITORY ๐Ÿ’€

aptly publish source drop distribution

removes all the pending changes that would've been applied with a subsequent aptly publish update. it's the "never mind, forget I said anything" of commands ๐Ÿ˜ญ

Example:

$ aptly publish source drop wheezy

โœจ Options โœจ

  • -component= โ€” component names to add (for multi-component publishing, separate components with commas)
  • -prefix=. โ€” publishing prefix in the form of [endpoint:]prefix

โญ LISTS REVISION OF PUBLISHED REPOSITORY โญ

aptly publish source list distribution

lists the sources of a published repository. simple. clean. we love a list ๐Ÿ“‹

Example:

$ aptly publish source list wheezy

โœจ Options โœจ

  • -component= โ€” component names to add (for multi-component publishing, separate components with commas)
  • -json โ€” display record in JSON format
  • -prefix=. โ€” publishing prefix in the form of [endpoint:]prefix

๐ŸŒˆ REMOVE SOURCE COMPONENTS FROM A PUBLISHED REPO ๐ŸŒˆ

aptly publish source remove distribution [[endpoint:]prefix] source

this one removes source components (snapshot / local repo) from a published repository. bye felicia ๐Ÿ‘‹

again, it does not publish the changes directly โ€” it schedules them for a subsequent aptly publish update.

the -component flag is mandatory. comma-separated list when you're removing multiple components, e.g.:

Example:

$ aptly publish source remove -component=contrib,non-free wheezy filesystem:symlink:debian

โœจ Options โœจ

  • -component= โ€” component names to remove (for multi-component publishing, separate components with commas)
  • -prefix=. โ€” publishing prefix in the form of [endpoint:]prefix

๐ŸŽ€ REPLACE THE SOURCE COMPONENTS OF A PUBLISHED REPOSITORY ๐ŸŽ€

aptly publish source replace distribution source

replaces the source components of a snapshot or local repository to be published. out with the old, in with the new โœจ

yep, you guessed it โ€” it does not publish the changes directly, it schedules them for a subsequent aptly publish update.

the -component flag is mandatory. comma-separated list if you're modifying multiple components, and the number of components must equal the number of sources, e.g.:

aptly publish source replace -component=main,contrib wheezy wheezy-main wheezy-contrib

Example:

$ aptly publish source replace -component=contrib wheezy ppa wheezy-contrib

โœจ Options โœจ

  • -component= โ€” component names to add (for multi-component publishing, separate components with commas)
  • -prefix=. โ€” publishing prefix in the form of [endpoint:]prefix

๐Ÿงš UPDATE THE SOURCE COMPONENTS OF A PUBLISHED REPOSITORY ๐Ÿงš

aptly publish source update distribution source

updates the source components of a snapshot or local repository to be published. glow-up but for components ๐Ÿ’–

and yes, same deal: it does not publish the changes directly, it schedules them for a subsequent aptly publish update.

the -component flag is mandatory. comma-separated list for multiple components, number of components must equal number of sources, e.g.:

aptly publish source update -component=main,contrib wheezy wheezy-main wheezy-contrib

Example:

$ aptly publish source update -component=contrib wheezy ppa wheezy-contrib

โœจ Options โœจ

  • -component= โ€” component names to add (for multi-component publishing, separate components with commas)
  • -prefix=. โ€” publishing prefix in the form of [endpoint:]prefix

๐Ÿ‘‘ UPDATE PUBLISHED REPOSITORY BY SWITCHING TO NEW SOURCE ๐Ÿ‘‘

aptly publish switch distribution [[endpoint:]prefix] new-source

this command switches in-place published snapshots with new source contents. all the publishing parameters are preserved (architecture list, distribution, component). nothing else changes, just the source โ€” periodt ๐Ÿ’…

for multiple component repositories, the -component flag should be given with the list of components to update, and the corresponding sources 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 the published repository (with one component) named ppa/wheezy (prefix ppa, dsitribution wheezy) to the new snapshot wheezy-7.5. iconic switch-up โœจ

โœจ Options โœจ

  • -batch โ€” run GPG with a detached tty
  • -component= โ€” component names to update (for multi-component publishing, separate components with commas)
  • -force-overwrite โ€” overwrite files in package pool in case of mismatch
  • -gpg-key= โ€” GPG key ID to use when signing the release
  • -keyring= โ€” GPG keyring to use (instead of default)
  • -multi-dist โ€” enable multiple packages with the same filename in different distributions
  • -passphrase= โ€” GPG passphrase for the key (warning: could be insecure)
  • -passphrase-file= โ€” GPG passphrase-file for the key (warning: could be insecure)
  • -secret-keyring= โ€” GPG secret keyring to use (instead of default)
  • -skip-bz2 โ€” don't generate bzipped indexes
  • -skip-cleanup โ€” don't remove unreferenced files in prefix/component
  • -skip-contents โ€” don't generate Contents indexes
  • -skip-signing โ€” don't sign Release files with GPG

๐Ÿ’œ UPDATE PUBLISHED REPOSITORY ๐Ÿ’œ

aptly publish update distribution [[endpoint:]prefix]

this command updates updates a published repository after applying pending changes to the sources. yes it says "updates updates", we're all just vibing fr fr ๐Ÿ˜ญ

for published local repositories:

  • update to match local repository contents

for published snapshots:

  • switch components to new snapshot

the update happens in-place with the minimum possible downtime for the published repository โ€” like a smooth transition, no glitching ๐Ÿซถ

for multiple component published repositories, all local repositories are updated.

Example:

$ aptly publish update wheezy ppa

โœจ Options โœจ

  • -batch โ€” run GPG with a detached tty
  • -force-overwrite โ€” overwrite files in package pool in case of mismatch
  • -gpg-key= โ€” GPG key ID to use when signing the release
  • -keyring= โ€” GPG keyring to use (instead of default)
  • -multi-dist โ€” enable multiple packages with the same filename in different distributions
  • -passphrase= โ€” GPG passphrase for the key (warning: could be insecure)
  • -passphrase-file= โ€” GPG passphrase-file for the key (warning: could be insecure)
  • -secret-keyring= โ€” GPG secret keyring to use (instead of default)
  • -skip-bz2 โ€” don't generate bzipped indexes
  • -skip-cleanup โ€” don't remove unreferenced files in prefix/component
  • -skip-contents โ€” don't generate Contents indexes
  • -skip-signing โ€” don't sign Release files with GPG

๐Ÿ”ฅ SEARCH FOR PACKAGES MATCHING QUERY ๐Ÿ”ฅ

aptly package search [package-query]

this command searches and displays a list of packages in the whole DB that match the package query. it's giving detective energy ๐Ÿ”

use '@file' to read the query from a file, or '@-' for stdin. and if you don't specify a query at all? every single package gets displayed. all of them. no cap.

Example:

$ aptly package search '$Architecture (i386), Name (% *-dev)'

โœจ Options โœจ

  • -format= โ€” custom format for result printing

โœจ SHOW DETAILS ABOUT PACKAGES MATCHING QUERY โœจ

aptly package show package-query

Bestie, this one is the deep-dive ๐Ÿ’… โ€” it shows you detailed meta-information about packages matching your query. All that good stuff straight out of the Debian control file. And if you want even more, you can optionally also see info about package files and which mirrors / snapshots / local repos the package is included in. ๐Ÿ‘‘

Need to feed it a query from somewhere else? Use @file to read the query from a file, or @- for stdin. ๐Ÿซถ

Example, because we love a visual:

$ aptly package show 'nginx-light_1.2.1-2.2+wheezy2_i386'

Options, let's go:

  • -with-files โ€” display information about files from the package pool
  • -with-references โ€” display information about mirrors, snapshots and local repos referencing this package

๐Ÿงน CLEANUP DB AND PACKAGE POOL ๐Ÿงน

aptly db cleanup

Spring cleaning era ๐ŸŒธ โ€” the database cleanup removes information about unreferenced packages and removes files in the package pool that aren't used by packages anymore. Like, it literally gets rid of the dead weight, no cap.

Example:

$ aptly db cleanup

Options:

  • -dry-run โ€” don't delete anything
  • -verbose โ€” be verbose when loading objects/removing them

๐Ÿš‘ RECOVER DB AFTER CRASH ๐Ÿš‘

aptly db recover

This one does its absolute best to recover the database after a crash. ๐Ÿ˜ญ It's giving emergency room energy.

Okay so real talk: it is recommended to backup the DB before running recover. Do not skip this. Please.

Example:

$ aptly db recover

๐ŸŒ HTTP SERVE PUBLISHED REPOSITORIES ๐ŸŒ

aptly serve

The serve command starts an embedded HTTP server to serve contents of the public/ subdirectory of aptly's root that contains published repositories. ๐ŸŽ€

Not suitable for real production usage, bestie. This is a vibe, not a load balancer. ๐Ÿ’€

Example:

$ aptly serve -listen=:8080

Options:

  • -listen=:8080 โ€” host:port for HTTP listening

๐Ÿ›ฐ๏ธ START API HTTP SERVICE ๐Ÿ›ฐ๏ธ

aptly api serve

Start an HTTP server with the aptly REST API, periodt. โœจ The server can listen to either a port or a Unix domain socket. When you're using a socket, aptly will fully manage the socket file for you. And this command also supports taking over from systemd file descriptors, which enables systemd socket activation. iconic behaviour honestly.

Example:

$ aptly api serve -listen=:8080
$ aptly api serve -listen=unix:///tmp/aptly.sock

Options:

  • -listen=:8080 โ€” host:port for HTTP listening or unix://path to listen on a Unix domain socket
  • -no-lock โ€” don't lock the database

๐Ÿ“Š RENDER GRAPH OF RELATIONSHIPS ๐Ÿ“Š

aptly graph

The graph command displays the relationship between mirrors, local repositories, snapshots and published repositories, using the graphviz package to render the graph as an image. The way this maps out your whole setupโ€ฆ main character energy fr fr. ๐ŸŒˆ

Example:

$ aptly graph

Options:

  • -format=png โ€” render graph to specified format (png, svg, pdf, etc.)
  • -layout=horizontal โ€” create a more 'vertical' or a more 'horizontal' graph layout
  • -output= โ€” specify output filename, default is to open result in viewer

โš™๏ธ SHOW CURRENT APTLY'S CONFIG โš™๏ธ

aptly config show

The show command displays the current aptly configuration. Simple, clean, slay. ๐Ÿ’–

Example:

$ aptly config show

Options:

  • -yaml โ€” show yaml config

๐ŸŽ€ RUN APTLY TASKS ๐ŸŽ€

aptly task run (-filename=filename | commands...)

This command helps you organise multiple aptly commands into one single aptly task, running as a single thread. ๐Ÿงš Group-chat but for commands.

Example:

$ aptly task run
> repo create local
> repo add local pkg1
> publish repo local
> serve
>

Options:

  • -filename= โ€” specifies the filename that contains the commands to run

โš™๏ธ SHOW CURRENT APTLY'S CONFIG โš™๏ธ

Okay bestie I know, we're back here again โ€” and yes, it really is listed twice. Not me gaslighting you, this is literally what the page says. ๐Ÿ™ˆ

aptly config show

The show command displays the current aptly configuration.

Example:

$ aptly config show

Options:

  • -yaml โ€” show yaml config

๐ŸŒ ENVIRONMENT ๐ŸŒ

If environment variable HTTP_PROXY is set, aptly would use its value to proxy all HTTP requests. ๐Ÿ’œ


๐Ÿ”ข RETURN VALUES ๐Ÿ”ข

aptly exists with:

  • 0 โ€” success
  • 1 โ€” general failure
  • 2 โ€” command parse failure

๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

List of contributors, in chronological order (look at this lineup, actual legends only):


And that's a wrap on the whole page, bestie!! ๐ŸŽ‰ This version is dated December 2024 and it's APTLY(1) โ€” go forth and mirror, snapshot, publish and slay. ๐Ÿ’–โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from