Linux yum clean all

How to clean YUM cache in CentOS / RHEL

For some operations (for example, a yum install operation), Yum downloads the packages to install into the Yum cache. The cached packages are located in a subdirectory structure from /var/cache/yum that reflects the architecture, the distribution release, and the repository from where the packages were downloaded.

After successful installation, the packages are deleted from the cache. To retain the cached packages, change the keepcache setting to 1 in the /etc/yum.conf file as follows:

# vi /etc/yum.conf keepcache = 1

Cleaning the Yum Cache

Clean the Yum cache to reclaim disk space or to clear errors due to corrupted metadata files. To remove cached packages only, use:

To delete metadata for each enabled repository, use the following command:

To delete package headers, use the following command:

To clean all cached information, use the following command:

If you get the message “Metadata file does not match checksum” during a Yum operation, clearing the metadata from the cache might not help. In this case, adding the following line to /etc/yum.conf resolves the problem:

# vi /etc/yum.conf http_caching=none

Changing default location of yum cache

Sometimes when the default yum cache location is full, you would get an error while installing any yum package.

insufficient space in download directory /var/cache/yum/rhel-x86_64-server-6/packages

As the /var filesystem where yum cache is located is full and there is no disk space for yum to download the system updates, the above error will be shown.

Читайте также:  Oki mb472 драйвер astra linux

The yum cache location is configured in /etc/yum.conf file as cachedir option in the [main] section and can be changed:

$ cat /etc/yum.conf [main] cachedir=/var/cache/yum/$basearch/$releasever

Источник

Yum, шпаргалка

Шпаргалка по работе с пакетным менеджером Yum (Yellowdog Updater, Modified), который используется в популярных Linux дистрибутивах: RedHat, CentOS, Scientific Linux (и других). В целях экономии места вывод команд не представлен.

Оглавление

#yum updateinfo list security
#yum groupinfo "Basic Web Server"
#yum groupinstall "Basic Web Server"
#yum groupremove "Basic Web Server"
#yum repo-pkgs reponame install
#yum repo-pkgs reponame remove

проверить локальную базу rpm (поддерживаются параметры dependencies, duplicates, obsoletes, provides)

установить из локальной директории (поиск/установка зависимостей будут произведены из подключенных репозиториев)

#yum localinstall httpd.rpm
#yum localinstall http://server/repo/httpd.rpm

Опции Yum

--disableplugin=fastestmirror
#yum update -y --enablerepo=epel
#yum update -y --disablerepo=epel

скачать пакеты, но не устанавливать
(на Centos 7 x86_64 будут скачаны в ‘/var/cache/yum/x86_64/7/base/packages/’)

#yum install httpd --downloadonly

Cледующие команды доступны после установки пакета yum-utils

#repoquery --requires --resolve httpd
#reposync -p repo1 --repoid=updates

запрос к локальной базе yum, отображение информации о пакете
(использованная команда, контрольная сумма, URL с которого был установлен и другое)

скачать src.rpm пакет из репозитория
(должен быть подключен соответствующий репозиторий, например в ‘/etc/yum.repos.d/CentOS-Sources.repo’ в CentOS)

Конфигурационные файлы Yum и их расположение

Некоторые опции yum.conf:

cachedir=/var/cache/yum/$basearch/$releasever

Определяет должен или нет Yum хранить кэш заголовков и пакетов после успешной установки. Значения: 0 или 1. (по умолчанию 1)

Некоторые полезные плагины

Работа Yum через прокси сервер

proxy_proxy_username=user proxy_password=pass
#export http_proxy="http://server:3128"

Источник

How to Clean YUM Cache in CentOS/RHEL?

In CentOS, YUM (Yellowdog Updater Modified) is the default package manager used to install, update, and manage software packages. YUM cache is a location on the system where YUM stores the logs and temporary files. However, the cache can become large and take up significant disk space, which slows the system’s performance.

Читайте также:  Linux rdp server принтер

This article will explain the step-by-step instructions to clean the YUM cache by removing the older or unneeded package files.

How to Clean YUM Cache in CentOS / RHEL?

Cleaning the YUM cache is useful to boost the system’s functionality. For this, step-by-step instructions are provided below to clean the YUM cache in CentOS / RHEL:

Clean the YUM Cache

To clean the YUM cache in CentOS or RHEL, utilize the “yum” command with the “all” option as below:

This command removes all files from the system’s YUM cache.

Remove Packages Cache

If you want to remove the cache of the packages only, specify the “packages” as in the following command:

Clean the YUM metadata

To clean the metadata (dependencies files) from the YUM cache in CentOS or RHEL, the user can use the “metadata” argument with the “clean” utility as below:

The output shows that “15 metadata” files have been cleaned from the system.

Delete Package Headers

To clean the package headers files (old versions of dependencies files) from the cache, mention the “headers” keyword with the “clean” utility below:

It removes all the package headers files from the system’s YUM cache.

Conclusion

CentOS / RHEL offers the “clean all” command to clean the entire YUM cache using the yum package manager. It removes all files, including “metadata ”, “package headers”, and “packages” from the system’s YUM cache. This article has briefly explained the possible methods to clear the YUM cache in CentOS / RHEL.

Читайте также:  Файловая система linux как посмотреть

Источник

Оцените статью
Adblock
detector