not able to make [.rpm.lock (No such file or directory]

General support questions
stanny
Posts: 6
Joined: 2021/09/27 16:51:12

not able to make [.rpm.lock (No such file or directory]

Post by stanny » 2021/09/27 17:01:20

Hi I have faced issue with "error: can't create transaction lock on /var/lib/rpm/.rpm.lock" it occurs
under trying to rebuild rpm's ( rpm --rebuilddb) or even install yum package.

Host has been also restarted but it can't help out.
Do You have any idea how we can investigate further?
It seems that the main reason is too lack of this file but any process with rpm is not hanging...
[root@hostname]# uname -snr
Linux host 3.10.0-693.2.2.el7.x86_64

[root@hostname]# rpm -vv --rebuilddb > /tmp/rpmrebuilddb.log 2>&1
[root@hostname]# more /tmp/rpmrebuilddb.log
error: can't create transaction lock on /var/lib/rpm/.rpm.lock (No such file or directory)
[root@hostname rpm]# ls -ltr
total 34780
-rw-r--r--. 2 root root 8192 Jan 1 1970 Triggername
-rw-r--r--. 2 root root 24576 Jan 1 1970 Sigmd5
-rw-r--r--. 2 root root 45056 Jan 1 1970 Sha1header
-rw-r--r--. 2 root root 172032 Jan 1 1970 Requirename
-rw-r--r--. 2 root root 1720320 Jan 1 1970 Providename
-rw-r--r--. 2 root root 31830016 Jan 1 1970 Packages
-rw-r--r--. 2 root root 16384 Jan 1 1970 Obsoletename
-rw-r--r--. 2 root root 28672 Jan 1 1970 Name
-rw-r--r--. 2 root root 12288 Jan 1 1970 Installtid
-rw-r--r--. 2 root root 8192 Jan 1 1970 Group
-rw-r--r--. 2 root root 430080 Jan 1 1970 Dirnames
-rw-r--r--. 2 root root 8192 Jan 1 1970 Conflictname
-rw-r--r--. 2 root root 1310720 Jan 1 1970 Basenames

[root@hostname rpm]# pwd
/var/lib/rpm

tunk
Posts: 1204
Joined: 2017/02/22 15:08:17

Re: not able to make [.rpm.lock (No such file or directory]

Post by tunk » 2021/09/27 17:48:43

Don't know what your problem is, but your kernel is four years old.
I suggest that you run yum update.

stanny
Posts: 6
Joined: 2021/09/27 16:51:12

Re: not able to make [.rpm.lock (No such file or directory]

Post by stanny » 2021/09/27 17:58:25

this is the the strange case.... I don't have install yum ;) and under installation of yum mentioned issue existed


[root@hostname]# rpm -ivh yum-3.4.3-168.el7.centos.noarch.rpm
warning: yum-3.4.3-168.el7.centos.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
error: can't create transaction lock on /var/lib/rpm/.rpm.lock (No such file or directory)

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: not able to make [.rpm.lock (No such file or directory]

Post by TrevorH » 2021/09/27 18:43:45

Is this a machine you installed? Or a "VPS" supplied by a hoster?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

stanny
Posts: 6
Joined: 2021/09/27 16:51:12

Re: not able to make [.rpm.lock (No such file or directory]

Post by stanny » 2021/09/27 18:51:26

no this is standalone installation on my server, but I don't know the details of installation

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: not able to make [.rpm.lock (No such file or directory]

Post by TrevorH » 2021/09/27 20:07:22

I think, given how long it is since your machine was last updated and also the fact that you are missing essential things - yum is installed with the distro and cannot be removed, I would suggest reinstalling the system from the latest media.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Whoever
Posts: 1357
Joined: 2013/09/06 03:12:10

Re: not able to make [.rpm.lock (No such file or directory]

Post by Whoever » 2021/09/27 23:09:07

[root@hostname rpm]# ls -ltr
What about

Code: Select all

ls -aZl
on that directory
also:

Code: Select all

lsattr -a /var/lib/rpm/

stanny
Posts: 6
Joined: 2021/09/27 16:51:12

Re: not able to make [.rpm.lock (No such file or directory]

Post by stanny » 2021/11/17 12:59:26

Code: Select all

[root@hostaname rpm]# ls -aZL
drwxr-xr-x. root root system_u:object_r:rpm_var_lib_t:s0 .
drwxr-xr-x. root root system_u:object_r:usr_t:s0       ..
-rw-r--r--. root root system_u:object_r:rpm_var_lib_t:s0 Basenames
-rw-r--r--. root root system_u:object_r:rpm_var_lib_t:s0 Conflictname
-rw-r--r--. root root system_u:object_r:rpm_var_lib_t:s0 Dirnames
-rw-r--r--. root root system_u:object_r:rpm_var_lib_t:s0 Group
-rw-r--r--. root root system_u:object_r:rpm_var_lib_t:s0 Installtid
-rw-r--r--. root root system_u:object_r:rpm_var_lib_t:s0 Name
-rw-r--r--. root root system_u:object_r:rpm_var_lib_t:s0 Obsoletename
-rw-r--r--. root root system_u:object_r:rpm_var_lib_t:s0 Packages
-rw-r--r--. root root system_u:object_r:rpm_var_lib_t:s0 Providename
-rw-r--r--. root root system_u:object_r:rpm_var_lib_t:s0 Requirename
-rw-r--r--. root root system_u:object_r:rpm_var_lib_t:s0 Sha1header
-rw-r--r--. root root system_u:object_r:rpm_var_lib_t:s0 Sigmd5
-rw-r--r--. root root system_u:object_r:rpm_var_lib_t:s0 Triggername

Code: Select all

[root@hostname rpm]# lsattr -a /var/lib/rpm/
---------------- /var/lib/rpm/.
---------------- /var/lib/rpm/..
---------------- /var/lib/rpm/Basenames
---------------- /var/lib/rpm/Conflictname
---------------- /var/lib/rpm/Dirnames
---------------- /var/lib/rpm/Group
---------------- /var/lib/rpm/Installtid
---------------- /var/lib/rpm/Name
---------------- /var/lib/rpm/Obsoletename
---------------- /var/lib/rpm/Packages
---------------- /var/lib/rpm/Providename
---------------- /var/lib/rpm/Requirename
---------------- /var/lib/rpm/Sha1header
---------------- /var/lib/rpm/Sigmd5
---------------- /var/lib/rpm/Triggername

stanny
Posts: 6
Joined: 2021/09/27 16:51:12

Re: not able to make [.rpm.lock (No such file or directory]

Post by stanny » 2021/11/18 16:08:55

any updates?

sml
Posts: 305
Joined: 2020/01/17 09:01:44

Re: not able to make [.rpm.lock (No such file or directory]

Post by sml » 2021/11/19 08:04:08

Code: Select all

drwxr-xr-x. root root system_u:object_r:usr_t:s0       ..
This one is wrong. The SELinux type of /var/lib should be (unsurprisingly) var_lib_t. Try

Code: Select all

restorecon -v /var/lib

Post Reply