Apt-repo: различия между версиями

Материал из ALT Linux Wiki
(добавлен пример использования (подключение p8))
(update to 1.3.17)
Строка 20: Строка 20:
     apt-repo add source
     apt-repo add source
     apt-repo rm source|all [type]
     apt-repo rm source|all [type]
    apt-repo set branch
     apt-repo clean
     apt-repo clean
     apt-repo update
     apt-repo update
Строка 26: Строка 27:


DESCRIPTION
DESCRIPTION
     The apt-repo script allow to show, add and remove APT repositories speci‐
     The apt-repo script allows to show, add, and remove APT repositories
     fied by source in sources.list(5) format, URL with optional component,
     specified by a source in sources.list(5) format, an URL with optional
    branch name or task number.
    component, a branch name, or a task number.
 
    Since apt-repo relies internally on apt-config(8) to find the files which
    contain the repository lists, it can be asked to manipulate arbitrary
    non-system APT sources.list by setting APT_CONFIG, which is a standard
    environment variable looked into by APT to find its configuration.  Exam‐
    ple:
 
          APT_CONFIG=~/.hasher/apt-extra.conf apt-repo add p7
 
    will manipulate the repository lists in the files defined (if any) in
    ~/.hasher/apt-extra.conf.  This can be useful, for example, to manipulate
    a user's local hasher(7) configuration.  (Such configurations are
    described in more detail at https://www.altlinux.org/Hasher/Tips.)
 
    If --dry-run is defined in command line changes only shown, is not per‐
    formed.


OPTIONS
OPTIONS
     list    Show active repositories in sources.list(5) format. If -a is
     list    Show active repositories in sources.list(5) format. If -a is
             specified all available repositories are displayed (inactive are
             specified, all available repositories are displayed (inactive
             commended by ‘#’ ).
             ones are commented by ‘#’).


     list [task] id
     list [task] id
             Show names of all available packages (except *-debuginfo) in
             Show names of all available packages (except *-devel*, *-checkin‐
            specified by id task repository.
            stall and *-debuginfo) in a task repository specified by id.


     add source
     add source
Строка 49: Строка 66:
             all tasks sources, ‘cdrom’ or ‘cdroms’ removes all cdrom sources.
             all tasks sources, ‘cdrom’ or ‘cdroms’ removes all cdrom sources.


    set branch
            Removes all exising sources and adds branch branch
   
     clean  Removes all cdrom and task sources.
     clean  Removes all cdrom and task sources.


Строка 56: Строка 76:


     test [task] id
     test [task] id
             Install all available packages (except *-debuginfo) from speci‐
             Install all available packages (except *-devel*, *-checkinstall
             fied by id task repository.
            and *-debuginfo) from the task repository specified by id.
 
    test [task] id pkg1 pkg2
             Install the given packages from the task repository specified by
            id.
 
    test [task] '' pkg1 pkg2
            Install the given packages (without modifying APT repos).


     -h --help
     -h --help
Строка 74: Строка 101:
     specify source as separate words. If trailing architecture and component
     specify source as separate words. If trailing architecture and component
     are missed two lines will be added (current system architecture and
     are missed two lines will be added (current system architecture and
     ‘noarch’ ) with component ‘classic’
     ‘noarch’) with component ‘classic’


   URL
   URL
     APT supports file://, copy://, http://, ftp://, rsync:// and cdrom://
     APT supports file://, copy://, http://, ftp://, rsync:// and cdrom://
     protocols.  URL with required protocol may trail optional architecture
     protocols.  URL with required protocol may be followed by an optional
     and one or more components. If architecture and component are missed two
     architecture and one or more components. If architecture and component
    lines will be added (current system architecture and ‘noarch’ ) with com‐
    are missing, two lines will be added (current system architecture and
    ponent ‘classic’.  This form is useful to add branch on mirror server.
    ‘noarch’) with component ‘classic’.  This form is useful to add a branch
    on a mirror server.


     Example:
     Example:
Строка 88: Строка 116:


   Absolute Path
   Absolute Path
     Local directory beginning with ‘/’ added as hasher repository: with cur‐
     Local directory beginning with ‘/’ added as a hasher(7) repository: with
     rent system architecture and hasher component.
     current system architecture and ‘hasher’ component.


           apt-repo add /opt/repo
           apt-repo add /opt/repo


   Branch
   Branch
     Branch is named repository consist from two parts (current system archi‐
     Branch is a named repository consisting of two parts (current system
     tecture and 'noarch'). By default official server is used. Full form:
     architecture and 'noarch'). By default, the official server is used. Full
    form:


           apt-repo add branch <name of branch>
           apt-repo add branch <name of branch> [<archive_date>]


     Keyword ‘branch’ may be omitted. Example:
     Keyword ‘branch’ may be omitted. Example:


           apt-repo add p7
           apt-repo add p7
     Run
     Running
           apt-repo add branch
           apt-repo add branch


     without name of branch displays all available branch names.
     without the name of a branch displays all available branch names.
    ‘archive_date’ allows to add archive of branch. Date of archive should be
    in form YYYYMMDD or YYYY/MM/DD.


   Task
   Task
Строка 117: Строка 148:


           apt-repo add 39115
           apt-repo add 39115
FILES
    /etc/apt/sources.list
              The main list of repositories which APT reads. New repositiories
              are added here (and, in this case, if it doesn't exist, then it
              is created).
    /etc/apt/sources.list.d/*.list
              The additional lists which APT reads.
    /etc/apt/apt.conf
    /etc/apt/apt.conf.d/*.conf
              The system APT configuration which may override the above
              default paths for sources.list(.d).
ENVIRONMENT VARIABLES
    APT_CONFIG
              This value overrides the default place where APT looks for
              apt.conf.  Setting it allows one to manipulate arbitrary user's
              non-system sources.list by preparing a custom apt.conf (e.g.,
              for hasher).


SEE ALSO
SEE ALSO

Версия от 11:50, 22 сентября 2021

apt-repo -- Script for manipulation APT repository list

Утилита существует с 2011 года. В дистрибутивы она попадает, начиная с поздних выпусков дистрибутивов на бранче p7, однако была помещена в бранчи p5/5.1 и p6/t6. Если утилита оказалась у Вас не установлена, установите её из соответствующего репозитория.

Типичный пример использования:

apt-repo rm all
apt-repo add p8

Первая команда удаляет абсолютно все источники без разбора, вторая добавляет исключительно необходимое для бранча p8. Архитектура выбирается автоматически.

Документация

NAME
     apt-repo — Manipulate APT repository list

SYNOPSIS
     apt-repo [list] [-a]
     apt-repo list [task] id
     apt-repo add source
     apt-repo rm source|all [type]
     apt-repo set branch
     apt-repo clean
     apt-repo update
     apt-repo test [task] id
     apt-repo [-h] [-v]

DESCRIPTION
     The apt-repo script allows to show, add, and remove APT repositories
     specified by a source in sources.list(5) format, an URL with optional
     component, a branch name, or a task number.

     Since apt-repo relies internally on apt-config(8) to find the files which
     contain the repository lists, it can be asked to manipulate arbitrary
     non-system APT sources.list by setting APT_CONFIG, which is a standard
     environment variable looked into by APT to find its configuration.  Exam‐
     ple:

           APT_CONFIG=~/.hasher/apt-extra.conf apt-repo add p7

     will manipulate the repository lists in the files defined (if any) in
     ~/.hasher/apt-extra.conf.  This can be useful, for example, to manipulate
     a user's local hasher(7) configuration.  (Such configurations are
     described in more detail at https://www.altlinux.org/Hasher/Tips.)

     If --dry-run is defined in command line changes only shown, is not per‐
     formed.

OPTIONS
     list    Show active repositories in sources.list(5) format. If -a is
             specified, all available repositories are displayed (inactive
             ones are commented by ‘#’).

     list [task] id
             Show names of all available packages (except *-devel*, *-checkin‐
             stall and *-debuginfo) in a task repository specified by id.

     add source
             Add source to list of active repositories.

     rm source [<type>]
             Remove or comment source if it is active. Special keyword all
             removes all active sources. The all keyword followed by optional
             <type> removes all sources of specified type: ‘branch’ or
             ‘branches’ removes all branch sources, ‘task’ or ‘tasks’ removes
             all tasks sources, ‘cdrom’ or ‘cdroms’ removes all cdrom sources.

     set branch
             Removes all exising sources and adds branch branch
     
     clean   Removes all cdrom and task sources.

     update  Run
                   apt-get update
             to update APT cache from active repositories.

     test [task] id
             Install all available packages (except *-devel*, *-checkinstall
             and *-debuginfo) from the task repository specified by id.

     test [task] id pkg1 pkg2
             Install the given packages from the task repository specified by
             id.

     test [task] '' pkg1 pkg2
             Install the given packages (without modifying APT repos).

     -h --help
             Print usage information and quit.

     -v --version
             Print version and quit.

SOURCE FORMAT
   APT Source
     Source can be specified in sources.list(5) format:

           apt-repo add "rpm http://git.altlinux.org/repo/39115/ i586 task"

     Recognized repository types: rpm, rpm-dir and rpm-src. It is allowed to
     specify source as separate words. If trailing architecture and component
     are missed two lines will be added (current system architecture and
     ‘noarch’) with component ‘classic’

   URL
     APT supports file://, copy://, http://, ftp://, rsync:// and cdrom://
     protocols.  URL with required protocol may be followed by an optional
     architecture and one or more components. If architecture and component
     are missing, two lines will be added (current system architecture and
     ‘noarch’) with component ‘classic’.  This form is useful to add a branch
     on a mirror server.

     Example:

           apt-repo add ftp://mirror.yandex.ru/altlinux/p7/branch

   Absolute Path
     Local directory beginning with ‘/’ added as a hasher(7) repository: with
     current system architecture and ‘hasher’ component.

           apt-repo add /opt/repo

   Branch
     Branch is a named repository consisting of two parts (current system
     architecture and 'noarch'). By default, the official server is used. Full
     form:

           apt-repo add branch <name of branch> [<archive_date>]

     Keyword ‘branch’ may be omitted. Example:

           apt-repo add p7
     Running
           apt-repo add branch

     without the name of a branch displays all available branch names.
     ‘archive_date’ allows to add archive of branch. Date of archive should be
     in form YYYYMMDD or YYYY/MM/DD.

   Task
     Task is small repository for one or more subtask built in
     http://git.altlinux.org infrastructure. This source is used to install
     software for test purpose.  Any task has unique number. Full form:

           apt-repo add task <number of task>

     Keyword ‘task’ may be omitted. Example:

           apt-repo add 39115

FILES
     /etc/apt/sources.list
              The main list of repositories which APT reads. New repositiories
              are added here (and, in this case, if it doesn't exist, then it
              is created).
     /etc/apt/sources.list.d/*.list
              The additional lists which APT reads.
     /etc/apt/apt.conf
     /etc/apt/apt.conf.d/*.conf
              The system APT configuration which may override the above
              default paths for sources.list(.d).

ENVIRONMENT VARIABLES
     APT_CONFIG
              This value overrides the default place where APT looks for
              apt.conf.  Setting it allows one to manipulate arbitrary user's
              non-system sources.list by preparing a custom apt.conf (e.g.,
              for hasher).

SEE ALSO
     sources.list(5), apt-cache(8), apt-get(8)

AUTHORS
     Andrey Cherepanov cas@altlinux.org

Хаки

Скачать

http://git.altlinux.org/people/cas/packages/apt-repo.git