tech_memo / linux / yum


tech_memo/linux

未インストールのファイル、コマンド名からPKG名を検索

  • yum providesで検索できる。下記はlibopenjpeg.so.1がどのパッケージからインストールできるかの確認例(インストール済みのものも表示される模様)
    [root@testserver13 ~]# yum provides */libopenjpeg.so.1
    openjpeg-libs-1.5.1-10.el7.i686 : JPEG 2000 codec runtime library
    Repo        : core-0
    Matched from:
    Filename    : /usr/lib/libopenjpeg.so.1
    
    
    
    openjpeg-libs-1.5.1-10.el7.x86_64 : JPEG 2000 codec runtime library
    Repo        : core-0
    Matched from:
    Filename    : /usr/lib64/libopenjpeg.so.1
    
    

バージョンを指定してのinstall、update

  • 以下のようにバージョンを含んだパッケージ名を指定すればよい
    yum install httpd-2.2.15-15.el6
    yum update httpd-2.2.15-15.el6

Install済みrpmの削除(依存rpmも削除)

  • 以下のコマンドで依存パッケージを含めてキレイに削除してくれる
    yum remove <PKG_NAME>
  • 複数指定も可能
    yum remove qt3-3.3.8b-30.el6.x86_64 qt-x11-4.6.2-26.el6_4.x86_64 qt-4.6.2-26.el6_4.x86_64 qt-sqlite-4.6.2-26.el6_4.x86_64

リポジトリ単位で、proxyの有効・無効を指定

  • リポジトリ設定ファイルに、下記のように記述する。無効にしたい場合は、値に"_none_"と入力する
    [core-0]
    name=core-0
    baseurl=http://192.168.22.118/cobbler/ks_mirror/RHEL6.5
    enabled=1
    gpgcheck=0
    priority=1
    proxy=_none_
  • 上記は、/etc/yum.confのproxy設定を無効にできるが、http_proxy環境変数は無効にできないので注意。

groupと、そのgroupに属するpkgの一覧

  • group情報は、以下のコマンドで確認できる
    yum groupinfo <GROUP_NAME>
  • すべてのgroup情報を知りたい場合は、以下のようにする
    yum groupinfo '*'

Not using downloaded repomd.xml because it is older than what we have

  • 項目のErrorが出た場合の解消方法。以下のコマンドを実行するとよい。
    [root ~]# yum clean all
    • testserver18以外で実行した後は、testserver18のcobbler以外のリポジトリの情報も再取得する必要があるので、/etc/yum.confのproxy設定ON/OFF両方でyumコマンドを一度実行しておく必要がある(DB情報を更新する)

リポジトリ設定ファイル

  • testserver18の/etc/yum.repos.d/epel.repo
    [epel]
    name=Extra Packages for Enterprise Linux 5 - $basearch
    #baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch
    mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
    failovermethod=priority
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
  • enabled : 0=利用しない 1=利用する
  • gpgcheck : 0=checkしない 1=checkする
    • 1の場合はGPG-KEYが必要。testserver18の場合はrpmでinstall済み

install可能なPackageがどのリポジトリにあるかの確認方法

  • 未インストールPKG
    • yum infoで確認できる。Repoの部分。
      [root@testserver18 yum.repos.d]# yum info xen
      Loaded plugins: downloadonly, security
      Available Packages
      Name       : xen
      Arch       : x86_64
      Version    : 3.0.3
      Release    : 105.el5
      Size       : 1.9 M
      Repo       : core-3
      Summary    : Xen is a virtual machine monitor
      URL        : http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html
      License    : GPLv2+, LGPLv2+
      Description: This package contains the Xen tools and management daemons needed
                 : to run virtual machines on x86, x86_64, and ia64 systems.
                 : Information on how to use Xen can be found at the Xen project pages.
                 :
                 : The Xen system also requires the Xen hypervisor and domain-0
                 : kernel, which can be found in the kernel-xen* package.
                 :
                 : Virtualization can be used to run multiple operating systems on one
                 : physical system, for purposes of hardware consolidation, hardware
                 : abstraction, or to test untrusted applications in a sandboxed
                 : environment.
  • install済みPKG
    • install済みのPKGはyum infoだと、Repoの部分はinstalledと表示されてしまう。
    • 強引だがyum reinstallでリボジトリを確認できる(Repositoryの部分)
      [root@testserver18 yum.repos.d]# yum reinstall zsh
      Loaded plugins: downloadonly, security
      Setting up Reinstall Process
      clusterlabs-next                                                                                                                | 2.5 kB     00:00
      Resolving Dependencies
      --> Running transaction check
      ---> Package zsh.x86_64 0:4.2.6-3.el5 set to be updated
      --> Finished Dependency Resolution
      
      Dependencies Resolved
      
      =======================================================================================================================================================
       Package                         Arch                               Version                                   Repository                          Size
      =======================================================================================================================================================
      Reinstalling:
       zsh                             x86_64                             4.2.6-3.el5                               core-2                             1.7 M
      
      Transaction Summary
      =======================================================================================================================================================

epelのレポジトリを参照できるようにする方法(RHEL6編)

  • testserver18:/var/www/cobbler/localmirror/epel/epel-release-6-8.noarch.rpm を該当サーバにrpm -ivh でインストール
  • epelのrepomd.xmlを取得(?)するために、/etc/yum.confのurlのmirror_urlとbase_urlのコメントアウトを交換(mirror_urlはhttpなので。)
  • あとはcobblerで取得できるものとepelから取得できるものを/etc/yum.confのproxyをON/OFF使い分けて実施していく。