Tag Archives: yum

CentOS how to tips

How to remove RPM packages with several dependencies

If you are using fedora, simply use this simple script but be careful when answering y/N:

yum remove $(rpm -qa | grep PACKAGENAME)

  • Change PACKAGENAME with your Package name
  • For disabling plugins just add --disableplugin=PLUGIN-NAME
  • If you can’t access the Internet, just add this options to the line above --disablerepo=*

Find out what files are in my rpm package

Use following syntax to list the files for already INSTALLED package:

The –v (verbose) option can give you more information on the files when used with the various query options.

rpm -ql package-name

Use following syntax to list the files for RPM package:

rpm -qlp package-name

Type the following command to list the files for gitlab*.rpm package file:

rpm -qlp gitlab-7.1.1_omnibus-1.el6.x86_64.rpm

See also: HowTo: Extract an RPM Package Files Without Installing It

Update yum repositories for CentOS, RHEL Systems

Get the latest yum repos from one of the two links below, selecting to match your host’s architecture:

# CentOS/RHEL 6, 64 Bit (x86_64):
rpm -Uvh http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

Then enjoy update with yum update yum-updatesd

Change CentOS language

vi /etc/sysconfig/i18n

check the lang is your expected, such as:

LANG="en_US.UTF-8"  <<-----
SUPPORTED="en_US.UTF-8:en_US:en" 
SYSFONT="latarcyrheb-sun16"

and re-login with you user/passwd, check it with command locale

Yum install/update with specific repository

# update git with rpmforge-extras repository
yum --disablerepo=base,updates --enablerepo=rpmforge-extras update git

YUM Hangs And Won’t Respond

keyword: yum hangs and won’t respond

ssh 到测试机更新subversion1.7, 需要删除之前的老版本,发现yum命令没有响应,提示 “yum hangs and won’t respond”,
初步解决办法更新yum库缓存数据:

rm -f /var/lib/rpm/__*
rpm --rebuilddb -v -v   
yum clean all

If that did not work, you can set a debug level, error level and timeout for yum in /etc/yum.conf:

debugelevel=1
errorlevel=1
timeout=1

The timeout is standard 30 seconds. So if a repository does not respond, the error takes 30 seconds to appear. Also try using yum without the plugins (like fastest mirror and priorities) with the option –noplugins. Now starting yum again should give you more info faster. Test with:

yum --verbose --noplugins info