GNU/Linux >> Linux の 問題 >  >> Linux

Yumプラグインを有効、無効、およびインストールする方法

YUMプラグインは、パッケージマネージャーの全体的なパフォーマンスを拡張および改善する小さなプログラムです。それらのいくつかはデフォルトでインストールされますが、多くはインストールされません。 Yumコマンドを実行するたびに、Yumは、ロードされてアクティブになっているプラ​​グインを常に通知します。

この短い記事では、CentOS/RHELディストリビューションでYUMパッケージマネージャープラグインをオンまたはオフにして構成する方法について説明します。

アクティブなすべてのプラグインを表示するには、ターミナルでyumコマンドを実行します。以下の出力から、最速のミラーであることがわかります。 プラグインが読み込まれます。

# yum search nginx

Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Determining fastest mirrors
...

YUMプラグインの有効化

yumプラグインを有効にするには、ディレクティブplugins=1であることを確認してください。 ( 1 上の意味)は [main]の下に存在します /etc/yum.confのセクション 以下に示すように、ファイル。

# vi /etc/yum.conf
Yum構成ファイル
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1 installonly_limit=5

これは、yumプラグインをグローバルに有効にする一般的な方法です。後で説明するように、受け入れ可能な構成ファイルで個別に有効にすることができます。

YUMプラグインの無効化

yumプラグインを無効にするには、上記の値を0に変更するだけです。 (オフを意味します)、これはすべてのプラグインをグローバルに無効にします。

plugins=0	

この段階で、次の点に注意してください。

  • いくつかのプラグイン( product-id など)以降 およびサブスクリプションマネージャー )基本的なyum機能を提供します。特にグローバルに、すべてのプラグインをオフにすることはお勧めしません。
  • 次に、プラグインをグローバルに無効にすることは簡単な方法として許可されています。これは、yumで発生する可能性のある問題を調査するときにこのプロビジョニングを使用できることを意味します。
  • さまざまなプラグインの構成は、 /etc/yum/pluginconf.d/にあります。 。
  • /etc/yum.confでプラグインをグローバルに無効にする 個々の構成ファイルの設定を上書きします。
  • また、後で説明するように、yumの実行時に単一またはすべてのyumプラグインを無効にすることもできます。

追加のYUMプラグインのインストールと構成

このコマンドを使用して、すべてのyumプラグインとその説明のリストを表示できます。

# yum search yum-plugin

Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Loading mirror speeds from cached hostfile
 * base: mirror.sov.uk.goscomb.net
 * epel: www.mirrorservice.org
 * extras: mirror.sov.uk.goscomb.net
 * updates: mirror.sov.uk.goscomb.net
========================================================================= N/S matched: yum-plugin ==========================================================================
PackageKit-yum-plugin.x86_64 : Tell PackageKit to check for updates when yum exits
fusioninventory-agent-yum-plugin.noarch : Ask FusionInventory agent to send an inventory when yum exits
kabi-yum-plugins.noarch : The CentOS Linux kernel ABI yum plugin
yum-plugin-aliases.noarch : Yum plugin to enable aliases filters
yum-plugin-auto-update-debug-info.noarch : Yum plugin to enable automatic updates to installed debuginfo packages
yum-plugin-changelog.noarch : Yum plugin for viewing package changelogs before/after updating
yum-plugin-fastestmirror.noarch : Yum plugin which chooses fastest repository from a mirrorlist
yum-plugin-filter-data.noarch : Yum plugin to list filter based on package data
yum-plugin-fs-snapshot.noarch : Yum plugin to automatically snapshot your filesystems during updates
yum-plugin-keys.noarch : Yum plugin to deal with signing keys
yum-plugin-list-data.noarch : Yum plugin to list aggregate package data
yum-plugin-local.noarch : Yum plugin to automatically manage a local repo. of downloaded packages
yum-plugin-merge-conf.noarch : Yum plugin to merge configuration changes when installing packages
yum-plugin-ovl.noarch : Yum plugin to work around overlayfs issues
yum-plugin-post-transaction-actions.noarch : Yum plugin to run arbitrary commands when certain pkgs are acted on
yum-plugin-priorities.noarch : plugin to give priorities to packages from different repos
yum-plugin-protectbase.noarch : Yum plugin to protect packages from certain repositories.
yum-plugin-ps.noarch : Yum plugin to look at processes, with respect to packages
yum-plugin-remove-with-leaves.noarch : Yum plugin to remove dependencies which are no longer used because of a removal
yum-plugin-rpm-warm-cache.noarch : Yum plugin to access the rpmdb files early to warm up access to the db
yum-plugin-show-leaves.noarch : Yum plugin which shows newly installed leaf packages
yum-plugin-tmprepo.noarch : Yum plugin to add temporary repositories
yum-plugin-tsflags.noarch : Yum plugin to add tsflags by a commandline option
yum-plugin-upgrade-helper.noarch : Yum plugin to help upgrades to the next distribution version
yum-plugin-verify.noarch : Yum plugin to add verify command, and options
yum-plugin-versionlock.noarch : Yum plugin to lock specified packages from being updated

プラグインをインストールするには、パッケージのインストールと同じ方法を使用します。たとえば、変更ログをインストールします 更新前/更新後のパッケージ変更ログを表示するために使用されるプラグイン。

# yum install yum-plugin-changelog 

インストールしたら、変更ログ 設定ファイルを調べて確認するために、デフォルトで有効になります。

# vi /etc/yum/pluginconf.d/changelog.conf

これで、変更ログを表示できます パッケージの場合( httpd この場合)このように。

# yum changelog httpd

Loaded plugins: changelog, fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.linode.com
 * epel: mirror.freethought-internet.co.uk
 * extras: mirrors.linode.com
 * updates: mirrors.linode.com

Listing all changelogs

==================== Installed Packages ====================
httpd-2.4.6-45.el7.centos.4.x86_64       installed
* Wed Apr 12 17:30:00 2017 CentOS Sources <[email protected]> - 2.4.6-45.el7.centos.4
- Remove index.html, add centos-noindex.tar.gz
- change vstring
- change symlink for poweredby.png
- update welcome.conf with proper aliases
...

コマンドラインでYUMプラグインを無効にする

前述のように、これら2つの重要なオプションを使用して、yumコマンドの実行中に1つ以上のプラグインをオフにすることもできます。

  • --noplugins –すべてのプラグインをオフにします
  • --disableplugin=plugin_name –単一のプラグインを無効にします

このyumコマンドのように、すべてのプラグインを無効にすることができます。

# yum search --noplugins yum-plugin

次のコマンドは、プラグイン、 fastestmirrorを無効にします httpdのインストール中 パッケージ。

# yum install --disableplugin=fastestmirror httpd

Loaded plugins: changelog
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-45.el7.centos.4 will be updated
--> Processing Dependency: httpd = 2.4.6-45.el7.centos.4 for package: 1:mod_ssl-2.4.6-45.el7.centos.4.x86_64
---> Package httpd.x86_64 0:2.4.6-67.el7.centos.6 will be an update
...

今のところ以上です!以下のYUM関連の記事もお読みください。

  1. 「YumHistory」を使用してインストールまたは削除されたパッケージ情報を確認する方法
  2. Yumエラーを修正する方法:データベースディスクイメージの形式が正しくありません

このガイドでは、CentOS / RHEL 7でYUMパッケージマネージャープラグインをアクティブ化、構成、または非アクティブ化する方法を示しました。以下のコメントフォームを使用して、この記事に関する質問や意見を共有してください。


Linux
  1. LinuxMint20でSnapを有効にしてSnapパッケージをインストールする方法

  2. Linux でソースから (および YUM を使用して) MongoDB をインストールする方法

  3. Linux で libass を有効にするには?

  1. ビデオおよびオーディオコーデックを有効にする方法は?

  2. Ubuntu で Wayland を有効または無効にする方法

  3. Linux/Apache/PHP で SQLite を有効にするにはどうすればよいですか?

  1. KaliLinuxでWiFiを有効または無効にする方法

  2. Ubuntuでrootユーザーアカウントを有効または無効にする方法

  3. Ubuntuでrootアカウントを有効または無効にする方法