warning: waiting for transaction lock on /var/lib/rpm/.rpm.lock

问题:执行安装FTP时,报出

** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
wget-1.12-5.el6_6.1.x86_64 is a duplicate with wget-1.12-1.8.el6.x86_64

的错误信息。原因为系统中存在两个版本的wget,产生两个wget版本的原因可能是yum源更新的问题。所以这时想到的办法就是重置yum源和更新yum源

执行过程如下:

[root@SZB-L0015013 ~]# yum install vsftpd
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * atomic: mirrors.hosting.in.th
Setting up Install Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
---> Package vsftpd.x86_64 0:2.2.2-14.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================
 Package        Arch           Version                Repository                    Size
=========================================================================================
Installing:
 vsftpd         x86_64         2.2.2-14.el6           CentOS.6.base.x86_64         152 k

Transaction Summary
=========================================================================================
Install       1 Package(s)

Total download size: 152 k
Installed size: 332 k
Is this ok [y/N]: y
Downloading Packages:
vsftpd-2.2.2-14.el6.x86_64.rpm                                    | 152 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
wget-1.12-5.el6_6.1.x86_64 is a duplicate with wget-1.12-1.8.el6.x86_64

解决办法:

wget http://www.atomicorp.com/installers/atomic
 sh ./atomic

执行到这里时报错如下:

Installing the Atomic GPG keys: OK

Downloading atomic-release-1.0-21.el6.art.noarch.rpm: warning: waiting for transaction lock on /var/lib/rpm/.rpm.lock

解决办法:删除/var/lib/rpm/.rpm.lock即可,之后重建正常。

 rm -f /var/lib/rpm/.rpm.lock
 rpm --rebuilddb

也可通过fuser /var/lib/rpm/.rpm.lock查看占用的进程,之后ps aux |grep processid找到对应程序,杀死即可。

[root@SZB-L0015013 ~]# yum check-update

更新完后就可以正常安装了

参考链接:
http://xoyabc.blog.51cto.com/7401264/1898748

你可能感兴趣的:(Linux,Ubuntu/Centos)