You are not logged in.

#1 2018-01-29 15:02:56

george3
Member
Registered: 2015-02-13
Posts: 9

SOLVED pacman db locked

#pacman -S cups

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

# rm /var/lib/pacman/db.lck

# pacman -S cups
resolving dependencies...
looking for conflicting packages...

Packages (13) bc-1.07.1-1  cups-filters-1.17.9-3  ijs-0.35-1
              imagemagick-7.0.7.21-1  liblouis-3.4.0-1  liblqr-0.4.2-1
              libmagick-7.0.7.21-1  libpaper-1.1.24-10  libraqm-0.3.0-2
              poppler-0.61.1-1  qpdf-7.0.0-3  run-parts-4.8.3-1  cups-2.2.6-1

Total Download Size:   11.97 MiB
Total Installed Size:  39.81 MiB

:: Proceed with installation? [Y/n]   Y

:: Retrieving packages...
error: failed retrieving file 'qpdf-7.0.0-3-x86_64.pkg.tar.xz' from arch.mirror.constant.com : The requested URL returned error: 404
^Z
[1]+  Stopped

#pacman -S cups
error: failed to init transaction (unable to lock database)
error: could not lock database: File exists
etc etc .......



Is this because a) the db has relocked after the install messages, or b) because it's not retrieving the package, or c) something else?

Last edited by george3 (2018-02-09 16:33:30)

Offline

#2 2018-01-29 15:25:06

Xabre
Member
From: Serbia
Registered: 2009-03-19
Posts: 755

Re: SOLVED pacman db locked

ctrl+z places the task in the background, it doesn't cancel it (ctrl + c).db is locked because pacman is still running.

Offline

#3 2018-01-29 15:25:40

ayekat
Member
Registered: 2011-01-17
Posts: 1,611

Re: SOLVED pacman db locked

george3 wrote:

^Z
[1]+  Stopped

What? Why on Earth are you suspending pacman halfway through?

--edit

Xabre wrote:

ctrl+z places the task in the background, it doesn't cancel it (ctrl + c).db is locked because pacman is still running.

Not quite—Ctrl+Z only suspends the running process. If you want it to resume in the background, you need to run `bg` (or `fg` if you want to resume it in the foreground).

Last edited by ayekat (2018-01-29 15:27:05)


pkgshackscfgblag

Offline

#4 2018-01-29 15:51:22

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: SOLVED pacman db locked

https://wiki.archlinux.org/index.php/Pacman

Please read it.  Or at very least, read the parts that are in big red-shaded boxes with the bold label "Warning" as well as the troubleshooting sections with titles that precisely match each of your problems.

Last edited by Trilby (2018-01-29 15:53:59)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2018-01-31 18:38:16

george3
Member
Registered: 2015-02-13
Posts: 9

Re: SOLVED pacman db locked

Thanks Xabre.
bg now says 'no jobs'
But pacman  still doesn't work, or only occasionally works if the download is very small.

Offline

#6 2018-01-31 18:39:30

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,646

Offline

#7 2018-02-01 00:45:22

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: SOLVED pacman db locked

Try running 'pacman -Syu' to update the databases.  It sounds like you are trying to retrieve old files that no longer exist.

Offline

#8 2018-02-01 16:38:21

dviktor
Member
From: Moscow
Registered: 2015-10-18
Posts: 162

Re: SOLVED pacman db locked

As Trilby already said, try this

Offline

#9 2018-02-03 19:11:47

george3
Member
Registered: 2015-02-13
Posts: 9

Re: SOLVED pacman db locked

Thanks circleface. That worked.
I'd assumed things were up to date, because  I re-installed ArchLinux only a  week ago.
Maybe it was an old .iso file.
Never assume anything.

Offline

#10 2018-02-03 19:20:21

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: SOLVED pacman db locked

george3 wrote:

Maybe it was an old .iso file.

That wouldn't matter, installing Arch retrieves all the latest packages from your selected mirror.
Your problem was trying to install packages without updating the system first.


I'd assumed things were up to date, because  I re-installed ArchLinux only a  week ago.

Arch is a rolling release distro, a lot happens in a week.


Please remember to mark this thread [SOLVED].
CoC - How to post


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#11 2023-03-29 20:36:50

pabbycratty
Member
Registered: 2023-03-29
Posts: 1

Re: SOLVED pacman db locked

I ran into this same issue. however i forgot i was running pacman -Syu in another terminal, so check if pacman is allready in use

Offline

#12 2023-03-29 20:57:23

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,447

Re: SOLVED pacman db locked

Note that you  are responding to a 5 year old solved thread. Please don't necrobump old threads.

https://wiki.archlinux.org/title/Genera … bumping%22

Closing.

Offline

Board footer

Powered by FluxBB