RTFM.WIKI

Ordnung muß sein. Ordnung über alles (18+)

User Tools

Site Tools


Sidebar


Навигация

Линкшэринг

ALARM!

Добавить новую страницу

You are not allowed to add pages
linux:centos:remove_orphan_packages

Как удалить старые неиспользуемые (orphan) пакеты?

package-cleanup

Для удаления файлов-"сирот" используется утилита package-cleanup из пакета yum-utils

См. package-cleanup –help ниже

Click to display ⇲

Click to hide ⇱

Usage:

  package-cleanup: helps find problems in the rpmdb of system and correct them
  usage: package-cleanup --problems or --leaves or --orphans or --oldkernels
  

Options:

Plugin Options:
  --leaves-exclude-bin
                      do not remove leaf packages which contain executable
                      binaries
  --remove-leaves     remove dependencies no longer needed by any other
                      packages
Yum Base Options:
  -h, --help          show this help message and exit
  -t, --tolerant      be tolerant of errors
  -C, --cacheonly     run entirely from system cache, don't update cache
  -c [config file], --config=[config file]
                      config file location
  -R [minutes], --randomwait=[minutes]
                      maximum command wait time
  -d [debug level], --debuglevel=[debug level]
                      debugging output level
  --showduplicates    show duplicates, in repos, in list/search commands
  -e [error level], --errorlevel=[error level]
                      error output level
  --rpmverbosity=[debug level name]
                      debugging output level for rpm
  -q, --quiet         quiet operation
  -v, --verbose       verbose operation
  -y, --assumeyes     answer yes for all questions
  --version           show Yum version and exit
  --installroot=[path]
                      set install root
  --enablerepo=[repo]
                      enable one or more repositories (wildcards allowed)
  --disablerepo=[repo]
                      disable one or more repositories (wildcards allowed)
  -x [package], --exclude=[package]
                      exclude package(s) by name or glob
  --disableexcludes=[repo]
                      disable exclude from main, for a repo or for
                      everything
  --obsoletes         enable obsoletes processing during updates
  --noplugins         disable Yum plugins
  --nogpgcheck        disable gpg signature checking
  --disableplugin=[plugin]
                      disable plugins by name
  --enableplugin=[plugin]
                      enable plugins by name
  --skip-broken       skip packages with depsolving problems
  --color=COLOR       control whether color is used
  --releasever=RELEASEVER
                      set value of $releasever in yum config and repo files
  --setopt=SETOPTS    set arbitrary config and repo options
package-cleanup options:
  --problems          List dependency problems in the local RPM database
  --qf=QF, --queryformat=QF
                      Query format to use for output.
  --orphans           List installed packages which are not available from
                      currently configured repositories
Duplicate Package Options:
  --dupes             Scan for duplicates in your rpmdb
  --cleandupes        Scan for duplicates in your rpmdb and remove older
  --noscripts         disable rpm scriptlets from running when cleaning
                      duplicates
Leaf Node Options:
  --leaves            List leaf nodes in the local RPM database
  --all               list all packages leaf nodes that do not match leaf-
                      regex
  --leaf-regex=LEAF_REGEX
                      A package name that matches this regular expression
                      (case insensitively) is a leaf
  --exclude-devel     do not list development packages as leaf nodes
  --exclude-bin       do not list packages with files in a bin dirs asleaf
                      nodes
Old Kernel Options:
  --oldkernels        Remove old kernel and kernel-devel packages
  --count=KERNELCOUNT
                      Number of kernel packages to keep on the system
                      (default 2)
  --keepdevel         Do not remove kernel-devel packages when removing
                      kernels

yum-plugin-remove-with-leaves

С сайта http://fedoriada.ru
Команда yum remove (или yum erase) удаляет пакет, указанный в качестве её аргумента, вместе со всеми пакетами, которые от него зависят. Однако она не затрагивает пакеты, установленные как зависимости удаляемого, даже в том случае, если они в системе более нигде не используются.

Для решения этой задачи необходима установка специального плагина:

# yum install yum-plugin-remove-with-leaves

Этот плагин должен подключаться к команде yum в явном виде:

# yum remove --remove-leaves pkgname

после чего будет выведен список пакетов, удаляемых как "осиротелые" зависимости, с предложением подтвердить это действие.

rpmreaper

Another useful tool for cleaning up unused packages is rpmreaper. It's an ncurses application that lets you view rpm dependency graph and mark packages for deletion. Marking one package can make other packages leaf, which you can see immediately, so you don't have to run the tool several times to get rid of whole sub-tree of unused packages. Install with: yum install rpmreaper.

Discussion

Enter your comment. Wiki syntax is allowed:
 
linux/centos/remove_orphan_packages.txt · Last modified: 2013/08/16 19:14 (external edit)