====== Обновление ПО дистрибутивов Линукс ======
===== Suse,OpenSuse =====
[[https://linuxcommandlibrary.com/man/zypper.html|man zypper]]
Консольная программа zypper, используемая в [Open]Suse, позволяет сокращать свои команды. Удобно: refresh - ref, update - up, install - in, search - se и т.д.
Обновить список ПО из подключенных репозиториев:
zypper ref
Обновить ПО, имеющего в репозиториях новые версии:
zypper up
Поиск пакета
zypper se имя_пакета
Установка
zypper in имя_пакета
Удаление
zypper rm имя_пакета
===== Debian,Ubuntu =====
[[https://manpages.ubuntu.com/manpages/xenial/man8/apt.8.html|man apt]], [[https://www.opennet.ru/man.shtml?category=8&topic=dpkg|man dpkg]]
Обновить список ПО из репозиториев
apt update
Вывести список пакетов, для которых доступно обновление
apt list --upgradable
Обновить
apt upgrade
Обновить конкретные пакеты, а не все
apt install --reinstall <список пакетов>
Поиск
apt search имя_пакета
Установка
apt install имя_пакета
Удаление
apt remove имя_пакета
Удаление с очисткой данных программы
apt purge имя_пакета
Удалить локально установленные пакеты (не из репозиториев. иногда такие остаются после апгрейда ОС)
apt list --installed|grep local|awk -F '/' '{print $1}'|xargs
apt remove $(apt list --installed|grep local|awk -F '/' '{print $1}'|xargs)
Удаление "хвостов" (конфигов, дополнительных данных) от удаленных пакетов.
apt purge $(dpkg -l | grep '^rc' | awk '{print $2}')
dpkg -l | grep "^rc" | awk '{print $2}' | sudo xargs dpkg -P
Поиск уязвимых пакетов для последующего обновления (через apt install)
debsecan --suite bullseye --format packages --only-fixed
Если установлен lsb_release, то можно так:
debsecan --suite $(lsb_release -cs) --format packages --only-fixed
Получение списка установленных пакетов с информацией о репозитории откуда он установлен
dpkg -l | grep "ii" | awk '{print $2}' | xargs -n 1 -IX sh -c "apt policy X 2>/dev/null | tr '\n' ' ';printf '\n'" | tee all_packages.txt
Определить к какому установленому пакету принадлежит файл
dpkg-query -S путь/к/файлу
Вывести список файлов в установленном пакете
dpkg -L package_name
==== Решение проблем ====
Ошибка: "NO_PUBKEY 648ACFD622F3D138"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
Предупреждение "Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details."
apt-key --keyring /etc/apt/trusted.gpg list
#Ищем id ключа (напр. 91E7EE5E)
apt-key export 91E7EE5E | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/repo_name.gpg
Так тоже работает
cp /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d
См. также [[https://devicetests.com/solving-apt-key-deprecated-warning]]
===== RHEL,Centos =====
[[https://www.opennet.ru/man.shtml?category=8&topic=yum|man yum]]
yum update
yum list available
yum search available
yum install
yum remove
dnf - почти прозрачно заменяет yum в свежих версиях RHEL,Centos
===== Alpine =====
Пакет apk-tools предоставляет программу [[https://wiki.alpinelinux.org/wiki/Alpine_Package_Keeper|apk]] со следующими возможностями:
add Add new packages or upgrade packages to the running system
del Delete packages from the running system
fix Repair packages or system
update Update the index of available packages
info Prints information about installed or available packages
search Search for packages or descriptions with wildcard patterns
upgrade Upgrade the currently installed packages
cache Maintenance operations for locally cached package repository
version Compare version differences between installed and available packages
index create a repository index from a list of packages
fetch download (but not install) packages
audit List changes to the file system from pristine package install state
verify Verify a package signature
dot Create a graphviz graph description for a given package
policy Display the repository that updates a given package, plus repositories that also offer the package
stats Display statistics, including number of packages installed and available, number of directories and files, etc.
manifest Display checksums for files contained in a given package
===== Дебиан, хренебиан - какая разница =====
==== PackageKit ====
В дистрибутивах с PackageKit(Suse,Ubuntu и др.) можно использовать утилиту pkcon. [[https://manpages.ubuntu.com/manpages/trusty/man1/pkcon.1.html|man pkcon]]
pkcon refresh
pkcon update
pkcon search
pkcon install
pkcon remove
==== yum/apt ====
В [Open]Suse можно установить apt, в Ubuntu/Debian можно установить yum
===== Дополнительные репозитории дебиан =====
==== Postgresql ====
[[https://wiki.postgresql.org/wiki/Apt]]
sudo apt install curl ca-certificates
sudo install -d /usr/share/postgresql-common/pgdg
sudo curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
Create /etc/apt/sources.list.d/pgdg.list. The distributions are called codename-pgdg. In the example, replace bookworm with the actual distribution you are using. File contents:
deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main
(You may determine the codename of your distribution by running lsb_release -c). For a script version of the above file creation, presuming you are using a supported release:
sudo sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
Finally, update the package lists, and start installing packages:
sudo apt update
sudo apt install postgresql-15
==== Репозитории HP Enterpise ====
[[hard:hpe_repository|]]
==== Репозитории MySQL ====
[[https://dev.mysql.com/downloads/]]
{{tag>linux}}