You are not logged in.

#1 2010-05-20 19:06:58

steve24
Member
From: Salzburg, Austria
Registered: 2010-05-20
Posts: 6

[SOLVED] Problem with pacman

Hey guys,

I dont know, if there is already a topic with the same problem, but unfortunately i didnt find one.
I looked up in the internet for the same problem, but my little knowledge of english and archlinux makes it very difficult for me.

My Problem:
I wanted to install the vlc-player and meanwhile some other programs so i tried to get the packages using

[matt@sx20 ~]$ packer -S vlc
    Password:

but what i get back is

error: failed to init transaction (unable to lock database)
      if you're sure a package manager is not already
      running, you can remove /var/lib/pacman/db.lck

in the next steps, i tried to remove that file... in vain

[matt@sx20 ~]$ sudo rm /var/lib/pacman/db.lck
    rm: cannot remove `/var/lib/pacman/db.lck': Operation not permitted

[matt@sx20 ~]$ sudo mv /var/lib/pacman/db.lck ~/
    Password:
    mv: cannot remove `/var/lib/pacman/db.lck': Operation not permitted
[matt@sx20 ~]$ sudo rm -f /var/lib/pacman/db.lck
    rm: cannot remove `/var/lib/pacman/db.lck': Operation not permitted

As i mentioned, i am a beginner a in arch linux, so please write me a detailed list, what i have to do to remove this problem.

If you need more detail to solve this problem, just mail me.

Thank you a lot
steve24

Last edited by steve24 (2010-05-21 18:59:48)

Offline

#2 2010-05-20 19:57:40

VoodooSteve
Member
From: Vancouver, BC
Registered: 2009-03-31
Posts: 43

Re: [SOLVED] Problem with pacman

Not familiar with packer but are you sure no other instance of pacman or packer etc is working since that is what the error means. Have you tried installing vlc or something else with plain old pacman?

Offline

#3 2010-05-20 19:58:12

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Problem with pacman

Are you sure a package manager is not already running?

> wanted to install the vlc-player and meanwhile some other programs
You have to wait until pacman finishes installing some packages to call it again.

Sprechst du Deutsch?
https://www.archlinux.de/

Last edited by karol (2010-05-20 20:02:39)

Offline

#4 2010-05-20 20:31:27

steve24
Member
From: Salzburg, Austria
Registered: 2010-05-20
Posts: 6

Re: [SOLVED] Problem with pacman

yes, i tried... the same thing appears.

I tried already "sudo killall pacman" , but no process called pacman is running.

are there other package manager too, that could run?

@karol, Ja, Danke.

Offline

#5 2010-05-20 20:34:40

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Problem with pacman

Close all apps, reboot, try running pacman. If the warning about '/var/lib/pacman/db.lck' appears again, try removing the file as root.

Offline

#6 2010-05-20 20:41:46

steve24
Member
From: Salzburg, Austria
Registered: 2010-05-20
Posts: 6

Re: [SOLVED] Problem with pacman

warning appeared again...

when i use 'sudo rm /var/lib/pacman/db.lck', is that removing as root?
cause it doesnt work either...

Offline

#7 2010-05-20 20:52:03

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Problem with pacman

[karol@black ~]$ su
Password: 
[root@black karol]# rm /var/lib/pacman/db.lck

This is root.

If you still can't remove it, what are the permissions of that file

[karol@black ~]$ ls -l /var/lib/pacman/db.lck
---------- 1 root root 6 May 20 22:52 /var/lib/pacman/db.lck

Offline

#8 2010-05-20 21:03:19

steve24
Member
From: Salzburg, Austria
Registered: 2010-05-20
Posts: 6

Re: [SOLVED] Problem with pacman

permissions here are the same as yours.
but the computer isnt mine, so i have to ask for the password tomorrow.

Thanks for your help so far!

Last edited by steve24 (2010-05-20 21:03:36)

Offline

#9 2010-05-20 21:07:15

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Problem with pacman

The file should disappear when you quit pacman / packer etc.
There's a German wiki so you can read all about pacman in your native lang.
https://wiki.archlinux.de/title/Pacman

Offline

#10 2010-05-20 22:26:54

Tsynique
Member
Registered: 2010-05-19
Posts: 37

Re: [SOLVED] Problem with pacman

Try not sudo but su and then login with the root password and then rm the file. I have this problem too sometimes when I CTRL+Z the pacman process but I only use pacman as root (not sudo - as real root) and rm'ing the files always solves it.

If that doesnt work, just press CTRL+ALT+F1 and you'll be in the terminal number one where you will asked for a username and password. Login as root there and deleting the lock file should be no problem. Then just switch back to the GUI (CTRL+ALT+F7).

Offline

#11 2010-05-20 22:30:21

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Problem with pacman

> when I CTRL+Z the pacman process
What for?

Offline

#12 2010-05-20 22:43:30

Tsynique
Member
Registered: 2010-05-19
Posts: 37

Re: [SOLVED] Problem with pacman

karol wrote:

> when I CTRL+Z the pacman process
What for?

I know it's the worst thing to do to a running process and I do it only on emergency situations (promise to use CTRL+C next time) but I mentioned it here just because it's an example why the lock might stay even though the process is long gone.

Offline

#13 2010-05-20 22:58:57

tavianator
Member
From: Waterloo, ON, Canada
Registered: 2007-08-21
Posts: 858
Website

Re: [SOLVED] Problem with pacman

Tsynique wrote:
karol wrote:

> when I CTRL+Z the pacman process
What for?

I know it's the worst thing to do to a running process and I do it only on emergency situations (promise to use CTRL+C next time) but I mentioned it here just because it's an example why the lock might stay even though the process is long gone.

Um, when you CTRL+Z a process, it isn't long gone, it's just paused, basically.  To start it again, do CTRL+Z or run `fg'.

Offline

#14 2010-05-20 23:14:19

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: [SOLVED] Problem with pacman

Please post the output of 'lsattr /var/lib/pacman/db.lck'.

Offline

#15 2010-05-21 04:51:33

steve24
Member
From: Salzburg, Austria
Registered: 2010-05-20
Posts: 6

Re: [SOLVED] Problem with pacman

as i said, today i'll get the root password, and then i'll hopefully inform you about my success.

[matt@sx20 ~]$ sudo lsattr /var/lib/pacman/db.lck 
----i--------e- /var/lib/pacman/db.lck

thx for your help

Offline

#16 2010-05-21 07:24:02

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: [SOLVED] Problem with pacman

I suspect that is your problem.  For some reason the 'i' attribute had been set, which prevents any modification to the file (including removal) until it has been unset.
Run:

sudo chattr -i /var/lib/pacman/db.lck

and try once again to remove the file.

Offline

#17 2010-05-21 18:59:22

steve24
Member
From: Salzburg, Austria
Registered: 2010-05-20
Posts: 6

Re: [SOLVED] Problem with pacman

thx chpln, your command worked!

Offline

Board footer

Powered by FluxBB