facebook twitter hatena line email

Linux/yumインストール

提供: 初心者エンジニアの簡易メモ
移動: 案内検索

yumアップデート

# yum install yum-fastestmirror
# yum update

インストール

# yum -y install gcc

アンインストール

# yum remove gcc

バージョンチェック

rpm -qa php

rpmライブラリ削除

rpm -e php

yumでインストール済リスト

yum list installed

404エラー発生時、以下で直す

ls /etc/yum.repos.d/ #←以下に404となる.repoファイルがあるので削除
rpm -qa ***
rpm -e [***]でパッケージ削除
yum clean all
yum update

アップデート自動化

# /sbin/chkconfig --list | grep yum
# /sbin/chkconfig yum-updatesd on
# /etc/rc.d/init.d/yum-updatesd start

yumが壊れたとき

There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
  No module named cElementTree
Please install a package which provides this module, or
verify that the module is installed correctly.
It's possible that the above module doesn't match the
current version of Python, which is:
2.4.3 (#1, Jan  9 2013, 06:47:03)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)]
If you cannot solve this problem yourself, please go to
the yum faq at:
  http://wiki.linux.duke.edu/YumFaq

以下コマンドでなおる。(urlが存在しない場合は直らない)

$ sudo rpm -Uvh --force ttp://mirror.centos.org/centos/5/os/x86_64/CentOS/python-elementtree-1.2.6-5.x86_64.rpm
$ sudo yum clean all

以下コマンドでなおる。

$ sudo rpm -Uvh --force ftp://ftp.pbone.net/mirror/www.startcom.org/ML-5.0.7/os/x86_64/StartCom/RPMS/python-elementtree-1.2.6-5.x86_64.rpm
$ sudo yum clean all

yum updateでエラー

$ sudo yum update
Error: Package: matahari-host-0.4.4-11.el6.x86_64
# 開発が終了しているようなのでmatahariライブラリは削除してかまわない
$ sudo yum remove matahari-*

参考:http://www.united-bears.co.jp/blog/archives/2565