8

I am slowly making progress on installing Fedora into a Logical Volume for a DomU using Package Management. I have (with the help of the wonderful people at Unix & Linux) resolved a number of issues, mainly surrounding rpm (see links below):

I am using the --root option with rpm to change my newly built version of rpm to /mnt/fedRoot. I have also directed rpm to look at the rpmrc file in the build folder, rather than on the actual /var/lib/rpm. Now Unfortunately, on any rpm file I run though I am getting: error: can't create transaction lock on /mnt/fedRoot (Is a directory). Looking online, I found a few pages that indicated this was an issue with the __db.*. Though deleting them and rebuilding the db within my rpm folder fixed another issue, I am still getting the transaction lock error.

Anyone have insight into this error?

  • 1
    If you have a file called /var/lock/rpm/transaction, try deleting it. – fpmurphy Jun 18 '11 at 14:57
  • 1
    does the directory /mnt/fedRoot/var/lib/rpm exist ? in analogy to redhat.com/archives/rpm-list/2007-May/msg00046.html , what does rpm --root=/mnt/fedRoot -E '%{_rpmlock_path}' say ? – Andre Holzner Jun 19 '11 at 19:28
  • Any updates on this problem? Answers to the two suggestions above? – Caleb Jun 26 '11 at 21:56
  • Sorry for the lack of response, thanks for keeping me honest @Caleb. The command pointed to /usr/lib/rpm/macros. I think the issue was, I was trying to use a version of a fedora install rpm that wasnt compatible with the CentOS rpm I was using. I dont know if that actually makes sense (to linux experts), but I was able to install another version of CentOS without any issues, so that is what I am basing this on. I have decided to take a step back and try to learn a bit more about linux before I attempt a full-blown xen system again. For now I am using Fedora 14 as my main system. – Hari Seldon Jun 26 '11 at 22:07
11

Try running your command as root. It worked for me.

  • 1
    Why does running as root work? – Kevin Meredith May 31 '13 at 16:48
  • Yes why does it require root user access ? – LoveWithMaths Apr 21 '18 at 8:14
0

Something else is holding that lock. Wait a while. (It is usually the graphical package management tool refreshing it's view of what's available, or perhaps a run of yum).

0

check the file level permission for the root user, it has to be (read write and execute)

$ls -l /var/lib/rpm/.rpm.lock
-rwxr-xr-x
0

2019 Update:::

Ran into a similar problem as asked ( RPM failed: error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Resource temporarily unavailable) )

Solved by;

ps -ef|grep rpm

And killing 2 orphan rpm processes as shown below ;

rpm --root / --dbpath /var/lib/rpm -i --percent --noglob --force --nodeps -- /var/cache/zypp/packages/download.o
/bin/sh /var/tmp/rpm-tmp.uHUmw1 7

I was then able to proceed with upgrading packages

-1

Try removing the /var/lib/rpm/.rpm.lock file (need to be root to do this). That fixed it for me.

  • 7
    Now getting error can't create transaction lock on /var/lib/rpm/.rpm.lock (No such file or directory) – shashwat Sep 8 '15 at 12:46
-2

As you are having error of 'can't create the transaction lock on rpm', to solve this error and get install the required package on your machine you just have to login to your root user through terminal window 'su -root' and then install your rpm package. The error gets solved.

  • 2
    Can you highlight what your answer adds above and beyond the existing answers? – Anthon Mar 12 '14 at 9:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.