You are not logged in.

#1 2016-12-01 15:55:59

Abarbasam
Member
Registered: 2016-12-01
Posts: 7

[SOLVED]"Failed to init transaction" - After interrupting pacman -Syu

Last night I was running an update and shut my computer down. Now, I can't install any packages whatsoever. I have tried deleting /var/lib/pacman/db.lck. No luck. How can I fix my mistake?
Thanks in advance.

Last edited by Abarbasam (2016-12-02 00:33:08)

Offline

#2 2016-12-01 16:05:38

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

Re: [SOLVED]"Failed to init transaction" - After interrupting pacman -Syu

Please post the exact command you used and the complete output.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2016-12-01 16:05:41

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,788
Website

Re: [SOLVED]"Failed to init transaction" - After interrupting pacman -Syu

Please post the complete output from a failed pacman run, use --debug to get more information. Please use code tags when posting the output.

https://wiki.archlinux.org/index.php/Co … s_and_code


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2016-12-01 16:05:53

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

Re: [SOLVED]"Failed to init transaction" - After interrupting pacman -Syu

Boot from the installation media, mount your partition(s) under /mnt, and then run the upgrade...

pacman --root=/mnt --cachedir=/mnt/var/cache/pacman/pkg -Syyu

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

#5 2016-12-01 16:07:59

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

Re: [SOLVED]"Failed to init transaction" - After interrupting pacman -Syu

I don't think an installation medium is needed.  The OP just needs to be clear on the problem.  Removing the lock file should clear that error, but saying it gave "No luck" is ambiguous.  Was the file not deleted?  What the rm command not run as root?  Is pacman now giving a new error?

Without more information I think prescribing an intervention is a bad idea.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2016-12-02 00:16:11

Abarbasam
Member
Registered: 2016-12-01
Posts: 7

Re: [SOLVED]"Failed to init transaction" - After interrupting pacman -Syu

When I remove db.lck, I get the same error message. The error message and command is shown below.

sudo pacman -Syyu
:: Synchronizing package databases...
error: failed to update core (unable to lock database)
error: failed to update extra (unable to lock database)
error: failed to update community (unable to lock database)
error: failed to synchronize any databases
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

I get the same error message no matter what I do with pacman. Installing, removing, or updating any package will yield this error.

running "pacman --debug" yields:

debug: pacman v5.0.1 - libalpm v10.0.1
debug: config: attempting to read file /etc/pacman.conf
debug: config: new section 'options'
debug: config: HoldPkg: pacman
debug: config: HoldPkg: glibc
debug: config: arch: x86_64
debug: config: SigLevel: Required
debug: config: SigLevel: DatabaseOptional
debug: config: LocalFileSigLevel: Optional
debug: config: new section 'core'
debug: config file /etc/pacman.conf, line 76: including /etc/pacman.d/mirrorlist
debug: config: new section 'extra'
debug: config file /etc/pacman.conf, line 79: including /etc/pacman.d/mirrorlist
debug: config: new section 'community'
debug: config file /etc/pacman.conf, line 85: including /etc/pacman.d/mirrorlist
debug: config: finished parsing /etc/pacman.conf
debug: setup_libalpm called
debug: option 'logfile' = /var/log/pacman.log
debug: option 'gpgdir' = /etc/pacman.d/gnupg/
debug: option 'hookdir' = /etc/pacman.d/hooks/
debug: option 'cachedir' = /var/cache/pacman/pkg/
debug: registering sync database 'core'
debug: database path for tree core set to /var/lib/pacman/sync/core.db
debug: "/var/lib/pacman/sync/core.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/core.db.sig could not be opened
debug: missing optional signature
debug: setting usage of 15 for core repository
debug: adding new server URL to database 'core': [url]http://lug.mtu.edu/archlinux/core/os/x86_64[/url]
debug: adding new server URL to database 'core': [url]http://mirror.rit.edu/archlinux/core/os/x86_64[/url]
debug: adding new server URL to database 'core': [url]http://arch.localmsp.org/arch/core/os/x86_64[/url]
debug: adding new server URL to database 'core': [url]http://muug.ca/mirror/archlinux/core/os/x86_64[/url]
debug: adding new server URL to database 'core': [url]http://mirror.tyborek.pl/arch/core/os/x86_64[/url]
debug: adding new server URL to database 'core': [url]http://arch.tamcore.eu/core/os/x86_64[/url]
debug: adding new server URL to database 'core': [url]http://mirror.cedille.club/archlinux/core/os/x86_64[/url]
debug: adding new server URL to database 'core': [url]http://mirror.clibre.uqam.ca/archlinux/core/os/x86_64[/url]
debug: adding new server URL to database 'core': [url]http://mirror.csclub.uwaterloo.ca/archlinux/core/os/x86_64[/url]
debug: adding new server URL to database 'core': [url]http://mirror.frgl.pw/archlinux/core/os/x86_64[/url]
debug: adding new server URL to database 'core': [url]https://mirror.frgl.pw/archlinux/core/os/x86_64[/url]
debug: adding new server URL to database 'core': [url]http://mirror.its.dal.ca/archlinux/core/os/x86_64[/url]
debug: adding new server URL to database 'core': [url]https://muug.ca/mirror/archlinux/core/os/x86_64[/url]
debug: adding new server URL to database 'core': [url]http://archlinux.mirror.rafal.ca/core/os/x86_64[/url]
debug: adding new server URL to database 'core': [url]http://archlinux.mirror.vexxhost.com/core/os/x86_64[/url]
debug: registering sync database 'extra'
debug: database path for tree extra set to /var/lib/pacman/sync/extra.db
debug: "/var/lib/pacman/sync/extra.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/extra.db.sig could not be opened
debug: missing optional signature
debug: setting usage of 15 for extra repository
debug: adding new server URL to database 'extra': [url]http://lug.mtu.edu/archlinux/extra/os/x86_64[/url]
debug: adding new server URL to database 'extra': [url]http://mirror.rit.edu/archlinux/extra/os/x86_64[/url]
debug: adding new server URL to database 'extra': [url]http://arch.localmsp.org/arch/extra/os/x86_64[/url]
debug: adding new server URL to database 'extra': [url]http://muug.ca/mirror/archlinux/extra/os/x86_64[/url]
debug: adding new server URL to database 'extra': [url]http://mirror.tyborek.pl/arch/extra/os/x86_64[/url]
debug: adding new server URL to database 'extra': [url]http://arch.tamcore.eu/extra/os/x86_64[/url]
debug: adding new server URL to database 'extra': [url]http://mirror.cedille.club/archlinux/extra/os/x86_64[/url]
debug: adding new server URL to database 'extra': [url]http://mirror.clibre.uqam.ca/archlinux/extra/os/x86_64[/url]
debug: adding new server URL to database 'extra': [url]http://mirror.csclub.uwaterloo.ca/archlinux/extra/os/x86_64[/url]
debug: adding new server URL to database 'extra': [url]http://mirror.frgl.pw/archlinux/extra/os/x86_64[/url]
debug: adding new server URL to database 'extra': [url]https://mirror.frgl.pw/archlinux/extra/os/x86_64[/url]
debug: adding new server URL to database 'extra': [url]http://mirror.its.dal.ca/archlinux/extra/os/x86_64[/url]
debug: adding new server URL to database 'extra': [url]https://muug.ca/mirror/archlinux/extra/os/x86_64[/url]
debug: adding new server URL to database 'extra': [url]http://archlinux.mirror.rafal.ca/extra/os/x86_64[/url]
debug: adding new server URL to database 'extra': [url]http://archlinux.mirror.vexxhost.com/extra/os/x86_64[/url]
debug: registering sync database 'community'
debug: database path for tree community set to /var/lib/pacman/sync/community.db
debug: "/var/lib/pacman/sync/community.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/community.db.sig could not be opened
debug: missing optional signature
debug: setting usage of 15 for community repository
debug: adding new server URL to database 'community': [url]http://lug.mtu.edu/archlinux/community/os/x86_64[/url]
debug: adding new server URL to database 'community': [url]http://mirror.rit.edu/archlinux/community/os/x86_64[/url]
debug: adding new server URL to database 'community': [url]http://arch.localmsp.org/arch/community/os/x86_64[/url]
debug: adding new server URL to database 'community': [url]http://muug.ca/mirror/archlinux/community/os/x86_64[/url]
debug: adding new server URL to database 'community': [url]http://mirror.tyborek.pl/arch/community/os/x86_64[/url]
debug: adding new server URL to database 'community': [url]http://arch.tamcore.eu/community/os/x86_64[/url]
debug: adding new server URL to database 'community': [url]http://mirror.cedille.club/archlinux/community/os/x86_64[/url]
debug: adding new server URL to database 'community': [url]http://mirror.clibre.uqam.ca/archlinux/community/os/x86_64[/url]
debug: adding new server URL to database 'community': [url]http://mirror.csclub.uwaterloo.ca/archlinux/community/os/x86_64[/url]
debug: adding new server URL to database 'community': [url]http://mirror.frgl.pw/archlinux/community/os/x86_64[/url]
debug: adding new server URL to database 'community': [url]https://mirror.frgl.pw/archlinux/community/os/x86_64[/url]
debug: adding new server URL to database 'community': [url]http://mirror.its.dal.ca/archlinux/community/os/x86_64[/url]
debug: adding new server URL to database 'community': [url]https://muug.ca/mirror/archlinux/community/os/x86_64[/url]
debug: adding new server URL to database 'community': [url]http://archlinux.mirror.rafal.ca/community/os/x86_64[/url]
debug: adding new server URL to database 'community': [url]http://archlinux.mirror.vexxhost.com/community/os/x86_64[/url]
error: no operation specified (use -h for help)
debug: unregistering database 'local'
debug: unregistering database 'core'
debug: unregistering database 'extra'
debug: unregistering database 'community'

Last edited by Abarbasam (2016-12-02 00:21:16)

Offline

#7 2016-12-02 00:19:01

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

Re: [SOLVED]"Failed to init transaction" - After interrupting pacman -Syu

How did you remove the lock file?  Did you confirm that it is not there?

Your pacman debug output isn't helpful as you didn't give pacman any command.  If you want to provide debug output, add the debug flag to the failing command.

Please also use code tags for posting command output.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#8 2016-12-02 00:25:02

Abarbasam
Member
Registered: 2016-12-01
Posts: 7

Re: [SOLVED]"Failed to init transaction" - After interrupting pacman -Syu

Ok. Sorry. Here is the output for me trying to install gedit.

sudo pacman -S gedit --debug
debug: pacman v5.0.1 - libalpm v10.0.1
debug: config: attempting to read file /etc/pacman.conf
debug: config: new section 'options'
debug: config: HoldPkg: pacman
debug: config: HoldPkg: glibc
debug: config: arch: x86_64
debug: config: SigLevel: Required
debug: config: SigLevel: DatabaseOptional
debug: config: LocalFileSigLevel: Optional
debug: config: new section 'core'
debug: config file /etc/pacman.conf, line 76: including /etc/pacman.d/mirrorlist
debug: config: new section 'extra'
debug: config file /etc/pacman.conf, line 79: including /etc/pacman.d/mirrorlist
debug: config: new section 'community'
debug: config file /etc/pacman.conf, line 85: including /etc/pacman.d/mirrorlist
debug: config: finished parsing /etc/pacman.conf
debug: setup_libalpm called
debug: option 'logfile' = /var/log/pacman.log
debug: option 'gpgdir' = /etc/pacman.d/gnupg/
debug: option 'hookdir' = /etc/pacman.d/hooks/
debug: option 'cachedir' = /var/cache/pacman/pkg/
debug: registering sync database 'core'
debug: database path for tree core set to /var/lib/pacman/sync/core.db
debug: "/var/lib/pacman/sync/core.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/core.db.sig could not be opened
debug: missing optional signature
debug: setting usage of 15 for core repository
debug: adding new server URL to database 'core': http://lug.mtu.edu/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': http://mirror.rit.edu/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': http://arch.localmsp.org/arch/core/os/x86_64
debug: adding new server URL to database 'core': http://muug.ca/mirror/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': http://mirror.tyborek.pl/arch/core/os/x86_64
debug: adding new server URL to database 'core': http://arch.tamcore.eu/core/os/x86_64
debug: adding new server URL to database 'core': http://mirror.cedille.club/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': http://mirror.clibre.uqam.ca/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': http://mirror.csclub.uwaterloo.ca/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': http://mirror.frgl.pw/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': https://mirror.frgl.pw/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': http://mirror.its.dal.ca/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': https://muug.ca/mirror/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': http://archlinux.mirror.rafal.ca/core/os/x86_64
debug: adding new server URL to database 'core': http://archlinux.mirror.vexxhost.com/core/os/x86_64
debug: registering sync database 'extra'
debug: database path for tree extra set to /var/lib/pacman/sync/extra.db
debug: "/var/lib/pacman/sync/extra.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/extra.db.sig could not be opened
debug: missing optional signature
debug: setting usage of 15 for extra repository
debug: adding new server URL to database 'extra': http://lug.mtu.edu/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': http://mirror.rit.edu/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': http://arch.localmsp.org/arch/extra/os/x86_64
debug: adding new server URL to database 'extra': http://muug.ca/mirror/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': http://mirror.tyborek.pl/arch/extra/os/x86_64
debug: adding new server URL to database 'extra': http://arch.tamcore.eu/extra/os/x86_64
debug: adding new server URL to database 'extra': http://mirror.cedille.club/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': http://mirror.clibre.uqam.ca/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': http://mirror.csclub.uwaterloo.ca/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': http://mirror.frgl.pw/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': https://mirror.frgl.pw/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': http://mirror.its.dal.ca/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': https://muug.ca/mirror/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': http://archlinux.mirror.rafal.ca/extra/os/x86_64
debug: adding new server URL to database 'extra': http://archlinux.mirror.vexxhost.com/extra/os/x86_64
debug: registering sync database 'community'
debug: database path for tree community set to /var/lib/pacman/sync/community.db
debug: "/var/lib/pacman/sync/community.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/community.db.sig could not be opened
debug: missing optional signature
debug: setting usage of 15 for community repository
debug: adding new server URL to database 'community': http://lug.mtu.edu/archlinux/community/os/x86_64
debug: adding new server URL to database 'community': http://mirror.rit.edu/archlinux/community/os/x86_64
debug: adding new server URL to database 'community': http://arch.localmsp.org/arch/community/os/x86_64
debug: adding new server URL to database 'community': http://muug.ca/mirror/archlinux/community/os/x86_64
debug: adding new server URL to database 'community': http://mirror.tyborek.pl/arch/community/os/x86_64
debug: adding new server URL to database 'community': http://arch.tamcore.eu/community/os/x86_64
debug: adding new server URL to database 'community': http://mirror.cedille.club/archlinux/community/os/x86_64
debug: adding new server URL to database 'community': http://mirror.clibre.uqam.ca/archlinux/community/os/x86_64
debug: adding new server URL to database 'community': http://mirror.csclub.uwaterloo.ca/archlinux/community/os/x86_64
debug: adding new server URL to database 'community': http://mirror.frgl.pw/archlinux/community/os/x86_64
debug: adding new server URL to database 'community': https://mirror.frgl.pw/archlinux/community/os/x86_64
debug: adding new server URL to database 'community': http://mirror.its.dal.ca/archlinux/community/os/x86_64
debug: adding new server URL to database 'community': https://muug.ca/mirror/archlinux/community/os/x86_64
debug: adding new server URL to database 'community': http://archlinux.mirror.rafal.ca/community/os/x86_64
debug: adding new server URL to database 'community': http://archlinux.mirror.vexxhost.com/community/os/x86_64
debug: returning error 10 from alpm_trans_init : unable to lock database
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
debug: unregistering database 'local'
debug: unregistering database 'core'
debug: unregistering database 'extra'
debug: unregistering database 'community'

to remove the lock file, I ran the command

sudo rm -f /var/lib/pacman/db.lck 

I did not confirm that the lock file was removed. I will do this.

Offline

#9 2016-12-02 00:27:30

Abarbasam
Member
Registered: 2016-12-01
Posts: 7

Re: [SOLVED]"Failed to init transaction" - After interrupting pacman -Syu

Nevermind. I solved it. Before, I was running

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

This didn't work. Adding the -f flag worked.

Thanks so much for your help guys.

Last edited by Abarbasam (2016-12-02 00:28:26)

Offline

#10 2016-12-02 00:28:13

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

Re: [SOLVED]"Failed to init transaction" - After interrupting pacman -Syu

It looks like the file was not removed.  Please run the following commands in sequence and post any output from each of them: (deleted commands)

EDIT: I suspected as much smile

Last edited by Trilby (2016-12-02 00:28:47)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB