Страница 1 из 3

пакетная система DEB

Добавлено: 28 апр 2019, 10:32
Olej
Вот такое обширное описание ... чтоб к предмету больше не обращаться:
Воззрения кота Manual’а на deb-пакеты
13/12/2017 от alv
Алексей Федорчук
PPA-репозитории
Кроме официального репозитория, для Ubuntu существует централизованное хранилище репозиториев дополнительных, объединяемых понятием PPA — Personal Packages Archive, то есть входящих в персональный архив пакетов, пополняемый сторонними разработчиками и майнтайнерами. А их, вследствие популярности дистрибутива, очень немало. И поэтому свежие версии многих программ, как популярных (что важно для начинающих применителей), так и весьма экзотических (что часто критично для применителей многоопытных), в первую очередь появляются как бинарники в PPA-репозиториях Ubuntu.

Re: пакетная система DEB

Добавлено: 09 июл 2019, 17:49
Olej
Возникли задачи:
1. посмотреть текущие использующиеся репозитории ... когда их много
2. как управлять приоритетами репозиториев, когда пакеты в них перекрываются?

Re: пакетная система DEB

Добавлено: 09 июл 2019, 18:02
Olej
Olej писал(а):Возникли задачи:
Для этих дел удобно мне использовать, в качестве примера, дистрибутив Astra Linux, где у меня репозиториев прописано много по разным .list файлам

Код: Выделить всё

olej@astra:/etc/apt$ tree /etc/apt | grep \.list$ 
├── sources.list
│   ├── debian.list
│   ├── mint.list
│   └── opera-stable.list

Код: Выделить всё

olej@astra:/etc/apt/sources.list.d$ cat /etc/apt/*/*.list 
###### Debian Main Repos
#deb http://ftp.ru.debian.org/debian/ stable main contrib non-free
deb http://ftp.ru.debian.org/debian/ stretch main contrib non-free

#deb http://ftp.ru.debian.org/debian/ stable-updates main contrib non-free
deb http://ftp.ru.debian.org/debian/ stretch-updates main contrib non-free

#deb http://security.debian.org/ stable/updates main
deb http://security.debian.org/ stretch/updates main

deb https://mirror.yandex.ru/debian/ stretch main contrib non-free
deb http://packages.linuxmint.com/ sonya main upstream import backport romeo
# This file makes sure that Opera Browser is kept up-to-date
# as part of regular system upgrades

deb https://deb.opera.com/opera-stable/ stable non-free #Opera Browser (final releases)

Re: пакетная система DEB

Добавлено: 09 июл 2019, 18:05
Olej
Olej писал(а):1. посмотреть текущие использующиеся репозитории ... когда их много

Код: Выделить всё

olej@astra:~$ apt-cache policy
Списки пакетов:
 100 /var/lib/dpkg/status
     release a=now
 500 https://deb.opera.com/opera-stable stable/non-free i386 Packages
     release o=Opera Software AS,a=stable,n=stable,l=The Opera web browser,c=non-free,b=i386
     origin deb.opera.com
 500 https://deb.opera.com/opera-stable stable/non-free amd64 Packages
     release o=Opera Software AS,a=stable,n=stable,l=The Opera web browser,c=non-free,b=amd64
     origin deb.opera.com
 500 http://packages.linuxmint.com sonya/backport i386 Packages
     release v=18.2,o=linuxmint,a=sonya,n=sonya,l=linuxmint,c=backport,b=i386
     origin packages.linuxmint.com
 500 http://packages.linuxmint.com sonya/backport amd64 Packages
     release v=18.2,o=linuxmint,a=sonya,n=sonya,l=linuxmint,c=backport,b=amd64
     origin packages.linuxmint.com
 500 http://packages.linuxmint.com sonya/import i386 Packages
     release v=18.2,o=linuxmint,a=sonya,n=sonya,l=linuxmint,c=import,b=i386
     origin packages.linuxmint.com
 500 http://packages.linuxmint.com sonya/import amd64 Packages
     release v=18.2,o=linuxmint,a=sonya,n=sonya,l=linuxmint,c=import,b=amd64
     origin packages.linuxmint.com
 500 http://packages.linuxmint.com sonya/upstream i386 Packages
     release v=18.2,o=linuxmint,a=sonya,n=sonya,l=linuxmint,c=upstream,b=i386
     origin packages.linuxmint.com
 500 http://packages.linuxmint.com sonya/upstream amd64 Packages
     release v=18.2,o=linuxmint,a=sonya,n=sonya,l=linuxmint,c=upstream,b=amd64
     origin packages.linuxmint.com
 500 http://packages.linuxmint.com sonya/main i386 Packages
     release v=18.2,o=linuxmint,a=sonya,n=sonya,l=linuxmint,c=main,b=i386
     origin packages.linuxmint.com
 500 http://packages.linuxmint.com sonya/main amd64 Packages
     release v=18.2,o=linuxmint,a=sonya,n=sonya,l=linuxmint,c=main,b=amd64
     origin packages.linuxmint.com
 500 https://mirror.yandex.ru/debian stretch/non-free i386 Packages
     release v=9.9,o=Debian,a=oldstable,n=stretch,l=Debian,c=non-free,b=i386
     origin mirror.yandex.ru
 500 https://mirror.yandex.ru/debian stretch/non-free amd64 Packages
     release v=9.9,o=Debian,a=oldstable,n=stretch,l=Debian,c=non-free,b=amd64
     origin mirror.yandex.ru
 500 https://mirror.yandex.ru/debian stretch/contrib i386 Packages
     release v=9.9,o=Debian,a=oldstable,n=stretch,l=Debian,c=contrib,b=i386
     origin mirror.yandex.ru
 500 https://mirror.yandex.ru/debian stretch/contrib amd64 Packages
     release v=9.9,o=Debian,a=oldstable,n=stretch,l=Debian,c=contrib,b=amd64
     origin mirror.yandex.ru
 500 https://mirror.yandex.ru/debian stretch/main i386 Packages
     release v=9.9,o=Debian,a=oldstable,n=stretch,l=Debian,c=main,b=i386
     origin mirror.yandex.ru
 500 https://mirror.yandex.ru/debian stretch/main amd64 Packages
     release v=9.9,o=Debian,a=oldstable,n=stretch,l=Debian,c=main,b=amd64
     origin mirror.yandex.ru
 500 http://security.debian.org stretch/updates/main i386 Packages
     release v=9,o=Debian,a=oldstable,n=stretch,l=Debian-Security,c=main,b=i386
     origin security.debian.org
 500 http://security.debian.org stretch/updates/main amd64 Packages
     release v=9,o=Debian,a=oldstable,n=stretch,l=Debian-Security,c=main,b=amd64
     origin security.debian.org
 500 http://ftp.ru.debian.org/debian stretch-updates/main i386 Packages
     release o=Debian,a=oldstable-updates,n=stretch-updates,l=Debian,c=main,b=i386
     origin ftp.ru.debian.org
 500 http://ftp.ru.debian.org/debian stretch-updates/main amd64 Packages
     release o=Debian,a=oldstable-updates,n=stretch-updates,l=Debian,c=main,b=amd64
     origin ftp.ru.debian.org
 500 http://ftp.ru.debian.org/debian stretch/non-free i386 Packages
     release v=9.9,o=Debian,a=oldstable,n=stretch,l=Debian,c=non-free,b=i386
     origin ftp.ru.debian.org
 500 http://ftp.ru.debian.org/debian stretch/non-free amd64 Packages
     release v=9.9,o=Debian,a=oldstable,n=stretch,l=Debian,c=non-free,b=amd64
     origin ftp.ru.debian.org
 500 http://ftp.ru.debian.org/debian stretch/contrib i386 Packages
     release v=9.9,o=Debian,a=oldstable,n=stretch,l=Debian,c=contrib,b=i386
     origin ftp.ru.debian.org
 500 http://ftp.ru.debian.org/debian stretch/contrib amd64 Packages
     release v=9.9,o=Debian,a=oldstable,n=stretch,l=Debian,c=contrib,b=amd64
     origin ftp.ru.debian.org
 500 http://ftp.ru.debian.org/debian stretch/main i386 Packages
     release v=9.9,o=Debian,a=oldstable,n=stretch,l=Debian,c=main,b=i386
     origin ftp.ru.debian.org
 500 http://ftp.ru.debian.org/debian stretch/main amd64 Packages
     release v=9.9,o=Debian,a=oldstable,n=stretch,l=Debian,c=main,b=amd64
     origin ftp.ru.debian.org
 900 https://download.astralinux.ru/astra/testing/orel/repository orel/non-free i386 Packages
     release v=2.12.15,o=Debian,a=stable,n=orel,c=non-free,b=i386
     origin download.astralinux.ru
 900 https://download.astralinux.ru/astra/testing/orel/repository orel/non-free amd64 Packages
     release v=2.12.15,o=Debian,a=stable,n=orel,c=non-free,b=amd64
     origin download.astralinux.ru
 900 https://download.astralinux.ru/astra/testing/orel/repository orel/contrib i386 Packages
     release v=2.12.15,o=Debian,a=stable,n=orel,c=contrib,b=i386
     origin download.astralinux.ru
 900 https://download.astralinux.ru/astra/testing/orel/repository orel/contrib amd64 Packages
     release v=2.12.15,o=Debian,a=stable,n=orel,c=contrib,b=amd64
     origin download.astralinux.ru
 900 https://download.astralinux.ru/astra/testing/orel/repository orel/main i386 Packages
     release v=2.12.15,o=Debian,a=stable,n=orel,c=main,b=i386
     origin download.astralinux.ru
 900 https://download.astralinux.ru/astra/testing/orel/repository orel/main amd64 Packages
     release v=2.12.15,o=Debian,a=stable,n=orel,c=main,b=amd64
     origin download.astralinux.ru
Зафиксированные пакеты:
Цифра перед репозиторием - это приоритет, чем больше цифра - тем выше приоритет, если пакет прописан в разных репозиториях (конфликтуует), то он берётся из высшего приоритета.

Эта информация актуальна только тогда, когда репозитории свеже обновлялись:

Код: Выделить всё

root@astra:~# apt-get update
Игн:1 http://ftp.ru.debian.org/debian stretch InRelease
Сущ:2 https://download.astralinux.ru/astra/testing/orel/repository orel InRelease                                               
Сущ:3 http://ftp.ru.debian.org/debian stretch-updates InRelease                                                                    
Игн:4 http://packages.linuxmint.com sonya InRelease                                                                                
Сущ:5 http://ftp.ru.debian.org/debian stretch Release                                                              
Сущ:6 https://deb.opera.com/opera-stable stable InRelease                                                          
Сущ:7 http://packages.linuxmint.com sonya Release                                                                  
Игн:8 https://mirror.yandex.ru/debian stretch InRelease                                                            
Сущ:9 https://mirror.yandex.ru/debian stretch Release                      
Сущ:13 http://security-cdn.debian.org stretch/updates InRelease            
Чтение списков пакетов… Готово

Re: пакетная система DEB

Добавлено: 09 июл 2019, 18:09
Olej
Olej писал(а):2. как управлять приоритетами репозиториев, когда пакеты в них перекрываются?
Файл /etc/apt/preferences + файлы в каталоге /etc/apt/preferences.d :

Код: Выделить всё

olej@astra:/etc/apt/preferences.d$ pwd
/etc/apt/preferences.d

olej@astra:/etc/apt/preferences.d$ ls
orel

olej@astra:/etc/apt/preferences.d$ cat orel
Package: *
Pin: release n=orel
Pin-Priority: 900
Или даже (рекомендуют!) так:

Код: Выделить всё

...
Pin: release o=Debian,a=stable,n=orel
...
Как понятно, значение для release берётся из вывода apt-cache выше:

Код: Выделить всё

olej@astra:~$ apt-cache policy
...

Re: пакетная система DEB

Добавлено: 09 июл 2019, 20:05
Olej
Olej писал(а):Цифра перед репозиторием - это приоритет, чем больше цифра - тем выше приоритет,
Приоритеты репозиториев apt и deb-multimedia.org
Приоритеты репозиториев apt имеют следующие значения:
- P >= 1000 — Устанавливать пакеты, даже если это приводит к установке более старой версии, чем текущая установленная
- 990 <= P < 1000 — Устанавливать версию пакетов, даже если она не входит в текущий релиз, за исключением случая, если установленная версия новее.
- 500 <= P < 990 — Устанавливать пакеты, если они отсутствуют в текущем релизе, и устанавливаемая версия новее.
- 100 <= P < 500 — Устанавливать пакеты, если нет доступной версии в других репозиториях или установленная версия старее.
- 0 < P < 100 — Устанавливать пакет только в том случае, если нет другой установленной версии.
- P < 0 — Предотвратить установку указанной версии
- P = 0 — Неопределенное поведение, не рекомендуется использовать
Более подробно почитать о приоритетах и параметрах приоритезации можно в man-страничке (man apt_preferences) или здесь.
AptPreferences

Re: пакетная система DEB

Добавлено: 12 июл 2019, 18:07
Olej
Посмотреть какие пакеты вообще установлены в системе - начало алфавитного списка:

Код: Выделить всё

olej@ACER:~/2019_WORK/HISTORY/07/11$ dpkg --get-selections | head 
accountsservice					install
acl						install
acpid						install
adb						install
adduser						install
adwaita-icon-theme				install
aisleriot					install
albatross-gtk-theme				install
alsa-utils					install
alsaplayer-alsa					install
Список, естественно, большой:

Код: Выделить всё

olej@ACER:~/2019_WORK/HISTORY/07/11$ dpkg --get-selections | wc -l
3527

Re: пакетная система DEB

Добавлено: 12 июл 2019, 18:43
Olej
Olej писал(а): Список, естественно, большой:

Код: Выделить всё

olej@ACER:~/2019_WORK/HISTORY/07/11$ dpkg --get-selections | wc -l
3527
В таком виде, ясное дело, это смотреть нельзя, но отфильтровав, оказывается очень полезной информация:

Код: Выделить всё

olej@ACER:~$ dpkg --get-selections | grep ^python3
python3						install
python3-apt					install
python3-asn1crypto				install
python3-atomicwrites				install
python3-attr					install
python3-automat					install
python3-blosc					install
python3-brlapi:amd64				install
python3-bs4					install
python3-cairo:amd64				install
python3-certifi					install
python3-cffi-backend				install
python3-chardet					install
python3-click					install
python3-cloudpickle				install
python3-colorama				install
python3-constantly				install
python3-cryptography				install
python3-cups					install
python3-cupshelpers				install
python3-cycler					install
python3-dask					install
python3-dateutil				install
python3-dbus					install
python3-debian					install
python3-decorator				install
python3-dev					install
python3-distro					install
python3-distro-info				install
python3-distutils				install
python3-gdal					install
python3-gi					install
python3-gi-cairo				install
python3-gst-1.0					install
python3-html5lib				install
python3-hyperlink				install
python3-idna					install
python3-incremental				install
python3-joblib					install
python3-kiwisolver				install
python3-lib2to3					install
python3-libvoikko				install
python3-locket					install
python3-louis					install
python3-lxml:amd64				install
python3-mako					install
python3-markupsafe				install
python3-matplotlib				install
python3-minimal					install
python3-more-itertools				install
python3-networkx				install
python3-nose					install
python3-numexpr					install
python3-numpy					install
python3-olefile					install
python3-opencv					install
python3-opengl					install
python3-openssl					install
python3-pampy					install
python3-pandas					install
python3-pandas-lib				install
python3-partd					install
python3-pexpect					install
python3-pil:amd64				install
python3-pkg-resources				install
python3-plplot					install
python3-plplot-qt				install
python3-pluggy					install
python3-png					install
python3-psutil					install
python3-ptyprocess				install
python3-py					install
python3-pyasn1					install
python3-pyasn1-modules				install
python3-pyatspi					install
python3-pycurl					install
python3-pygame					install
python3-pyinotify				install
python3-pymodbus				install
python3-pyparsing				install
python3-pyqrcode				install
python3-pyqt4					install
python3-pyqt5					install
python3-pyqt5.qtmultimedia			install
python3-pyqt5.qtopengl				install
python3-pyqt5.qtsvg				install
python3-pyqt5.qtwebkit				install
python3-pyqt5.qtx11extras			install
python3-pyqt5.qwt				install
python3-pyqtgraph				install
python3-pyside2.qtgui				install
python3-pytest					install
python3-pywt					install
python3-q					install
python3-qrcode					install
python3-qrcodegen				install
python3-qrencode				install
python3-qtawesome				install
python3-qtpy					install
python3-readlike				install
python3-regex					install
python3-requests				install
python3-schedutils				install
python3-scipy					install
python3-scour					install
python3-serial					install
python3-serial-asyncio				install
python3-service-identity			install
python3-setproctitle:amd64			install
python3-setuptools				install
python3-simplejson				install
python3-sip					install
python3-six					install
python3-skimage					install
python3-skimage-lib:amd64			install
python3-sklearn					install
python3-sklearn-lib				install
python3-smbc					install
python3-software-properties			install
python3-soupsieve				install
python3-speechd					install
python3-tables					install
python3-tables-lib				install
python3-tk:amd64				install
python3-tksnack					install
python3-tktreectrl				install
python3-toolz					install
python3-twisted					install
python3-twisted-bin:amd64			install
python3-tz					install
python3-uno					install
python3-urllib3					install
python3-webencodings				install
python3-websocket				install
python3-wxgtk4.0				install
python3-xapp					install
python3-xdg					install
python3-xdo					install
python3-xlib					install
python3-yaml					install
python3-yapf					install
python3-zmq					install
python3-zope.interface				install
python3.6-minimal				deinstall
python3.7					install
python3.7-dev					install
python3.7-minimal				install

Код: Выделить всё

olej@ACER:~$ dpkg --get-selections | grep ^python-
python-all					install
python-all-dev					install
python-apt-common				install
python-asn1crypto				install
python-atomicwrites				install
python-attr					install
python-backports.functools-lru-cache		install
python-bs4					install
python-cffi-backend				install
python-chardet					install
python-configparser				install
python-crypto					install
python-cryptography				install
python-dbus					install
python-dev					install
python-entrypoints				install
python-enum34					install
python-funcsigs					install
python-gi					install
python-html5lib					install
python-ipaddress				install
python-keyring					install
python-keyrings.alt				install
python-lxml:amd64				install
python-matplotlib-data				install
python-minimal					install
python-more-itertools				install
python-numpy					install
python-olefile					install
python-opencv					install
python-pathlib2					install
python-pil:amd64				install
python-pil.imagetk:amd64			install
python-pip					install
python-pip-whl					install
python-pkg-resources				install
python-pluggy					install
python-py					install
python-pymodbus-doc				install
python-pytest					install
python-pythoncard				install
python-qtawesome-common				install
python-scandir					install
python-scour					install
python-secretstorage				install
python-setuptools				install
python-six					install
python-soupsieve				install
python-tables-data				install
python-talloc:amd64				install
python-tk					install
python-webencodings				install
python-wheel					install
python-wxgtk3.0					install
python-wxversion				install
python-xdg					install
И т.д.

Re: пакетная система DEB

Добавлено: 04 сен 2022, 18:46
Olej
Olej писал(а):
09 июл 2019, 17:49
1. посмотреть текущие использующиеся репозитории ... когда их много
Текущие репозитории в системе:

Код: Выделить всё

olej@R420:~$ apt-cache policy | grep http | awk '{print $2" "$3}' | sort -u
http://archive.canonical.com/ubuntu focal/partner
http://archive.ubuntu.com/ubuntu focal-backports/main
http://archive.ubuntu.com/ubuntu focal-backports/universe
http://archive.ubuntu.com/ubuntu focal/main
http://archive.ubuntu.com/ubuntu focal/multiverse
http://archive.ubuntu.com/ubuntu focal/restricted
http://archive.ubuntu.com/ubuntu focal/universe
http://archive.ubuntu.com/ubuntu focal-updates/main
http://archive.ubuntu.com/ubuntu focal-updates/multiverse
http://archive.ubuntu.com/ubuntu focal-updates/restricted
http://archive.ubuntu.com/ubuntu focal-updates/universe
http://dl.google.com/linux/chrome/deb stable/main
http://packages.linuxmint.com una/backport
http://packages.linuxmint.com una/import
http://packages.linuxmint.com una/main
http://packages.linuxmint.com una/upstream
https://apt.kitware.com/ubuntu focal/main
https://apt.kitware.com/ubuntu focal-rc/main
https://brave-browser-apt-release.s3.brave.com stable/main
https://deb.opera.com/opera-stable stable/non-free
http://security.ubuntu.com/ubuntu focal-security/main
http://security.ubuntu.com/ubuntu focal-security/multiverse
http://security.ubuntu.com/ubuntu focal-security/restricted
http://security.ubuntu.com/ubuntu focal-security/universe
https://linux.teamviewer.com/deb stable/main
https://packagecloud.io/slacktechnologies/slack/debian jessie/main
https://packages.element.io/debian default/main
https://packages.microsoft.com/repos/ms-teams stable/main
https://repo.skype.com/deb stable/main
https://www.kismetwireless.net/repos/apt/release/focal focal/main

Re: пакетная система DEB

Добавлено: 04 сен 2022, 18:55
Olej
Важно: При добавлении или перезаписи строки нового репозитория часто можно наловить новых сообщений о отсутствии PGP-ключей для использования репозитория, типа:

Код: Выделить всё

olej@astra:~$ sudo apt update
[sudo] пароль для olej: 
Пол:1 http://deb.debian.org/debian buster InRelease [122 kB]
Пол:2 http://deb.debian.org/debian buster-updates InRelease [56,6 kB]                                                                                 
Сущ:3 https://deb.opera.com/opera-stable stable InRelease                                                                                             
Игн:4 http://packages.linuxmint.com sonya InRelease                 
Ошк:1 http://deb.debian.org/debian buster InRelease                 
  Следующие подписи не могут быть проверены, так как недоступен открытый ключ: NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY DCC9EFBF77E11517
Сущ:5 http://packages.linuxmint.com sonya Release                    
Сущ:6 https://download.astralinux.ru/astra/stable/2.12_x86-64/repository orel InRelease
Сущ:7 https://download.astralinux.ru/astra/testing/orel/repository orel InRelease
Ошк:2 http://deb.debian.org/debian buster-updates InRelease
  Следующие подписи не могут быть проверены, так как недоступен открытый ключ: NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9
Сущ:8 https://dl.astralinux.ru/astra/stable/2.12_x86-64/repository orel InRelease
Сущ:9 https://download.astralinux.ru/astra/testing/2.12_x86-64/repository orel InRelease
Чтение списков пакетов… Готово
W: Ошибка GPG: http://deb.debian.org/debian buster InRelease: Следующие подписи не могут быть проверены, так как недоступен открытый ключ: NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY DCC9EFBF77E11517
E: Репозиторий «http://deb.debian.org/debian buster InRelease» не подписан.
N: Обновление из этого репозитория нельзя выполнить безопасным способом, и поэтому по умолчанию он отключён.
N: Смотрите справочную страницу apt-secure(8) о создании репозитория и настройке пользователя.
W: Ошибка GPG: http://deb.debian.org/debian buster-updates InRelease: Следующие подписи не могут быть проверены, так как недоступен открытый ключ: NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9
E: Репозиторий «http://deb.debian.org/debian buster-updates InRelease» не подписан.
N: Обновление из этого репозитория нельзя выполнить безопасным способом, и поэтому по умолчанию он отключён.
N: Смотрите справочную страницу apt-secure(8) о создании репозитория и настройке пользователя.
Здесь не хватает 3-х публичных ключей.