{
    "mode": "man",
    "parameter": "apt-transport-mirror",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/apt-transport-mirror/1/json",
    "generated": "2026-06-14T12:49:24Z",
    "sections": {
        "NAME": {
            "content": "apt-transport-mirror - APT transport for more automated mirror selection\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This APT transport isn't implementing a protocol to access local or remote repositories on\nits own, but acquires a mirrorlist and redirects all requests to the mirror(s) picked from\nthis list, accessing them via other transports like apt-transport-http(1). The basic\nfunctionality has been available since apt 0.7.24, but was undocumented until apt 1.6 which\ncontained a complete rework of the transport and its supported features. Note that a\ntransport is never called directly by a user but used by APT tools based on user\nconfiguration.\n\nIf the acquisition of a file via a mirror fails, the method ensures that another possible\nmirror from the list is automatically tried until either the file is retrieved or no mirror\nis left in the list, transparently handling server downtimes and similar problems.\n\nThe security implications of the transport depend on the security considerations associated\nwith the transport used to acquire the mirrorlist and the transports involved in accessing\nthe chosen mirror(s) by the transport.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "This transport has no configuration options at present. The mirror selection is based\nentirely on the mirrors offered in the mirrorlist and the files APT needs to acquire.\n",
            "subsections": [
                {
                    "name": "Mirrorlist format",
                    "content": "A mirrorlist contains one or more lines each specifying a URI for a mirror. Empty lines and\nthose starting with a hash character (#) are ignored. A URI always starts with a URI scheme\nwhich defines the transport used for this mirror. If for example the URI starts with http:,\nthe responsible transport is apt-transport-http(1) which might have specific requirements for\nthe format of the remaining part of the URI.\n\nMetadata about a mirror can be given on the same line, separated from the URI by a tab.\nMultiple items of metadata can themselves be separated by either tabs or spaces. (This is an\nadvanced feature only available with apt >= 1.6. Earlier apt versions will fail to parse\nmirrorlists using this feature.)\n\nSince apt 1.6 the use of compressed mirrorlists is also supported. Note that the filename of\nthe mirrorlist must specify the compression algorithm used; there is no auto-detection based\non file contents.\n"
                },
                {
                    "name": "Mirror selection by metadata",
                    "content": "As specified in the format, a mirror can have additional metadata attached to prevent a\nmirror from being selected for acquiring a file not matching this metadata. This way the\nmirrorlist can e.g. contain partial mirrors serving only certain architectures and APT will\nautomatically choose a different mirror for files requiring an unlisted architecture.\nSupported are limits for the architecture (arch), codename of the release (codename),\ncomponent of the repository the file is in (component), language the file applies to (lang),\nsuite name of the release (suite) and type of the file (type).\n"
                },
                {
                    "name": "Fallback order for mirrors",
                    "content": "If no priority is given for a mirror via the metadata key priority, the order in which\nmirrors are contacted is random. If a certain set of mirrors should be tried first before any\nof another set is tried, a priority can be explicitly set. The mirrors with the lowest number\nare tried first. Mirrors which have no explicit priority set default to the highest possible\nnumber and are therefore tried last. The choice between mirrors with the same priority is\nagain random.\n"
                },
                {
                    "name": "Allowed transports in a mirrorlist",
                    "content": "The availability and choice of transports in a mirrorlist is limited by how the APT client is\naccessing the mirrorlist. If a local transport like file or copy is used, the mirrorlist can\nalso include local sources, while a mirrorlist accessed via http can not. Additionally, a\nmirrorlist can not contain a mirrorlist or other wrapping transports (like\napt-transport-tor). See the documentation of these transports on how to use them with the\nmirror method.\n\nNote that apt versions before 1.6 do not support any other transport than http.\n"
                }
            ]
        },
        "EXAMPLES": {
            "content": "",
            "subsections": [
                {
                    "name": "Basic example",
                    "content": "A basic mirrorlist example supported by all apt versions with a mirror method (>= 0.7.24) in\nwhich the client will pick any of the three mirrors:\n\nhttp://ftp.de.debian.org/debian/\nhttp://ftp.us.debian.org/debian/\nhttp://deb.debian.org/debian/\n\nAssuming a file with this content is stored as /etc/apt/mirrorlist.txt on your machine it can\nbe used like this in sources.list(5) (since apt 1.6):\n\ndeb mirror+file:/etc/apt/mirrorlist.txt bullseye main\n\nAll versions of the mirror method support a mirrorlist accessible via HTTP, so assuming it is\navailable at http://apt.example.org/mirror.lst the sources.list entry from above could\ninstead be written as:\n\ndeb mirror://apt.example.org/mirror.lst bullseye main\n\nNote that since apt 1.6 the use of mirror+http should be preferred over mirror for\nuniformity. The functionality is the same.\n"
                },
                {
                    "name": "Example with metadata-enhanced mirror selection",
                    "content": "As explained in the format definition apt versions before 1.6 do not support this and will\nfail parsing the mirrorlist. The example mirrorlist is intentionally complicated to show some\naspects of the selection. The following setup is assumed: The first mirror is a local mirror\naccessible via the file method, but potentially incomplete. The second mirror has a great\nconnection, but is a partial mirror insofar as it only contains files related to the\narchitectures amd64 and all. The remaining mirrors are average mirrors which should be\ncontacted only if the earlier ones didn't work.\n\nfile:/srv/local/debian/mirror/     priority:1 type:index\nhttp://partial.example.org/mirror/ priority:2 arch:amd64 arch:all type:deb\nhttp://ftp.us.debian.org/debian/   type:deb\nhttp://ftp.de.debian.org/debian/   type:deb\nhttps://deb.debian.org/debian/\n\nIn this setup with this mirrorlist the first mirror will be used to download all index files\nassuming the mirrorlist itself is accessed via a local transport like file. If it isn't, if\nthe mirror is otherwise inaccessible or if it does not contain the requested file another\nmirror will be used to acquire the file, chosen depending on the type of the file: An index\nfile will be served by the last mirror in the list, while a package of architecture amd64 is\nserved by the second and those of e.g. architecture i386 by one of the last three.\n"
                }
            ]
        },
        "BUGS": {
            "content": "APT bug page[1]. If you wish to report a bug in APT, please see\n/usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "",
            "subsections": [
                {
                    "name": "APT team",
                    "content": ""
                }
            ]
        },
        "NOTES": {
            "content": "1. APT bug page\nhttp://bugs.debian.org/src:apt\n\n\n\nAPT 2.4.14                                09 December 2017                     APT-TRANSPORT-MIRR(1)",
            "subsections": []
        }
    },
    "summary": "apt-transport-mirror - APT transport for more automated mirror selection",
    "flags": [],
    "examples": [
        "A basic mirrorlist example supported by all apt versions with a mirror method (>= 0.7.24) in",
        "which the client will pick any of the three mirrors:",
        "http://ftp.de.debian.org/debian/",
        "http://ftp.us.debian.org/debian/",
        "http://deb.debian.org/debian/",
        "Assuming a file with this content is stored as /etc/apt/mirrorlist.txt on your machine it can",
        "be used like this in sources.list(5) (since apt 1.6):",
        "deb mirror+file:/etc/apt/mirrorlist.txt bullseye main",
        "All versions of the mirror method support a mirrorlist accessible via HTTP, so assuming it is",
        "available at http://apt.example.org/mirror.lst the sources.list entry from above could",
        "instead be written as:",
        "deb mirror://apt.example.org/mirror.lst bullseye main",
        "Note that since apt 1.6 the use of mirror+http should be preferred over mirror for",
        "uniformity. The functionality is the same.",
        "As explained in the format definition apt versions before 1.6 do not support this and will",
        "fail parsing the mirrorlist. The example mirrorlist is intentionally complicated to show some",
        "aspects of the selection. The following setup is assumed: The first mirror is a local mirror",
        "accessible via the file method, but potentially incomplete. The second mirror has a great",
        "connection, but is a partial mirror insofar as it only contains files related to the",
        "architectures amd64 and all. The remaining mirrors are average mirrors which should be",
        "contacted only if the earlier ones didn't work.",
        "file:/srv/local/debian/mirror/     priority:1 type:index",
        "http://partial.example.org/mirror/ priority:2 arch:amd64 arch:all type:deb",
        "http://ftp.us.debian.org/debian/   type:deb",
        "http://ftp.de.debian.org/debian/   type:deb",
        "https://deb.debian.org/debian/",
        "In this setup with this mirrorlist the first mirror will be used to download all index files",
        "assuming the mirrorlist itself is accessed via a local transport like file. If it isn't, if",
        "the mirror is otherwise inaccessible or if it does not contain the requested file another",
        "mirror will be used to acquire the file, chosen depending on the type of the file: An index",
        "file will be served by the last mirror in the list, while a package of architecture amd64 is",
        "served by the second and those of e.g. architecture i386 by one of the last three."
    ],
    "see_also": []
}