Pacman error failed to initialize alpm library

Hello, I have been trying to get yaourt working in fedora but I continue to run into this issue when trying to run pacman -Sy error: failed to initialize alpm library (could not find or read direct...

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account


Closed

bordermick opened this issue

Mar 17, 2016

· 8 comments

Comments

@bordermick

Hello, I have been trying to get yaourt working in fedora but I continue to run into this issue when trying to run

pacman -Sy
error: failed to initialize alpm library
(could not find or read directory: /opt/arch/var/lib/pacman/)

I have tried following the fixes given in this issue report but there has still been no luck. Does anyone know how I would go about getting this working successfully? Any help would be great, thanks in advance.

@1dot75cm

Hi @bordermick
I’m so sorry. These days, I’m not online.
You may need to check the alsm library exists.

$ pacman -V
Pacman v5.0.1 - libalpm v10.0.1
$ ldd /usr/bin/pacman
libalpm.so.10 => /lib64/libalpm.so.10 (0x00007f71cf847000)
$ ll /usr/lib64/libalpm.so.10.0.1
-rwxr-xr-x. 1 root root ...

@bordermick

No problem, I ran those same commands and got the same outputs as you so I assume that means that the alsm library exists.

@1dot75cm

Please use --debug option to see more information.

-> $ pacman -V
Pacman v5.0.1 - libalpm v10.0.1
-> $ pacman -v
Root      : /opt/arch1/
Conf File : /etc/pacman.conf
DB Path   : /opt/arch1/var/lib/pacman/
Cache Dirs: /var/cache/pacman/pkg/  
Hook Dirs : /opt/arch1/usr/share/libalpm/hooks/  /etc/pacman.d/hooks/  
Lock File : /opt/arch1/var/lib/pacman/db.lck
Log File  : /var/log/pacman.log
GPG Dir   : /etc/pacman.d/gnupg/
-> $ pacman -Sy --debug
[04:03:54] debug: pacman v5.0.1 - libalpm v10.0.1
......

@bordermick

Sorry for the late response, I have been rather busy over the past 3 days.

When I run pacman -v I get the same error:

$ pacman -v
error: failed to initialize alpm library
(could not find or read directory: /opt/arch/var/lib/pacman/)

This is my pacman -Sy —debug output:

$ pacman -Sy --debug
[18:32:47] debug: pacman v5.0.1 - libalpm v10.0.1
[18:32:47] debug: config: attempting to read file /etc/pacman.conf
[18:32:47] debug: config: new section 'options'
[18:32:47] debug: config: rootdir: /opt/arch/
[18:32:47] debug: config: dbpath: /opt/arch/var/lib/pacman/
[18:32:47] debug: config: logfile: /var/log/pacman.log
[18:32:47] debug: config: arch: x86_64
[18:32:47] debug: config: new section 'core'
[18:32:47] debug: config: SigLevel: Optional
[18:32:47] debug: config: SigLevel: TrustedOnly
[18:32:47] debug: config file /etc/pacman.conf, line 10: including /etc/pacman.d/mirrorlist
[18:32:47] debug: config: new section 'community'
[18:32:47] debug: config: SigLevel: Never
[18:32:47] debug: config file /etc/pacman.conf, line 14: including /etc/pacman.d/mirrorlist
[18:32:47] debug: config: new section 'multilib'
[18:32:47] debug: config: SigLevel: Never
[18:32:47] debug: config file /etc/pacman.conf, line 18: including /etc/pacman.d/mirrorlist
[18:32:47] debug: config: new section 'extra'
[18:32:47] debug: config: SigLevel: Never
[18:32:47] debug: config file /etc/pacman.conf, line 22: including /etc/pacman.d/mirrorlist
[18:32:47] debug: config: new section 'archlinuxfr'
[18:32:47] debug: config: SigLevel: Optional
[18:32:47] debug: config: SigLevel: TrustedOnly
[18:32:47] debug: config: new section 'archlinuxcn'
[18:32:47] debug: config: SigLevel: Optional
[18:32:47] debug: config: SigLevel: TrustedOnly
[18:32:47] debug: config: finished parsing /etc/pacman.conf
[18:32:47] debug: setup_libalpm called
[18:32:47] error: failed to initialize alpm library
(could not find or read directory: /opt/arch/var/lib/pacman/)

@1dot75cm

I saw some similar problems https://bbs.archlinux.org/viewtopic.php?id=191861 . In fact, you need to run pacman as root permissions. @bordermick

$ pacman -Sy
error: failed to initialize alpm library
(database is incorrect version: /opt/arch1/var/lib/pacman/)
try running pacman-db-upgrade
$ sudo pacman -Sy
:: Synchronizing package databases...
Initializing download: http://mirrors.ustc.edu.cn/archlinux/core/os/x86_64/core.db
-OR-
$ su -
# pacman -Sy

I will update wiki, thanks.

@bordermick

Still getting the same error, even when I run it as root.

# pacman -Sy
error: failed to initialize alpm library
(could not find or read directory: /opt/arch/var/lib/pacman/)

@markzz

So create that directory. ALPM cannot initialize if the root or dbpath don’t exist on the filesystem.

# mkdir -p /opt/arch/var/lib/pacman

@alick

  • Index
  • » Pacman & Package Upgrade Issues
  • » [SOLVED] pacman: error: failed to initialize alpm library

#1 2014-12-20 09:02:07

essence-of-foo
Member
Registered: 2008-07-12
Posts: 82

[SOLVED] pacman: error: failed to initialize alpm library

I just upgraded my system about an hour ago and now whenever I run any pacman-related command I get this:

$ pacman
error: failed to initialize alpm library
(database is incorrect version: /var/lib/pacman/)
error:   try running pacman-db-upgrade

How can I get a correct database version?

Last edited by essence-of-foo (2014-12-20 09:13:18)

#2 2014-12-20 09:14:27

essence-of-foo
Member
Registered: 2008-07-12
Posts: 82

Re: [SOLVED] pacman: error: failed to initialize alpm library

Silly me…

I thought

error:   try running pacman-db-upgrade

Was something that was tried by pacman automatically but it was actually a hint of what to do next. So running

solved the problem.

#3 2014-12-31 12:04:45

Kobussie
Member
From: NL — Groningen
Registered: 2007-04-06
Posts: 43
Website

Re: [SOLVED] pacman: error: failed to initialize alpm library

Thanks!
Worked for me too… just another silly arch-user…

#4 2014-12-31 17:49:07

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: [SOLVED] pacman: error: failed to initialize alpm library

Had to use:

pacman-db-upgrade


fs/super.c : «Self-destruct in 5 seconds.  Have a nice day…n»,

#5 2015-01-01 00:18:53

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

Re: [SOLVED] pacman: error: failed to initialize alpm library

Rexilion wrote:

Had to use:

pacman-db-upgrade

So … you did the same thing as OP and Kobussie? No need to post a ‘me too’ then.

#6 2015-01-01 10:07:11

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: [SOLVED] pacman: error: failed to initialize alpm library

karol wrote:

Rexilion wrote:

Had to use:

pacman-db-upgrade

So … you did the same thing as OP and Kobussie? No need to post a ‘me too’ then.

Whoops misread the commands, I was in a hurry.

Pacman suggested pacman-db-update (which it could not find).


fs/super.c : «Self-destruct in 5 seconds.  Have a nice day…n»,

#7 2015-01-01 12:19:53

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,246
Website

Re: [SOLVED] pacman: error: failed to initialize alpm library

There is a typo in one of the translations…  Dutch maybe?

#8 2015-01-01 12:28:15

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: [SOLVED] pacman: error: failed to initialize alpm library

The Dutch translation did indeed have a typo. It was fixed 12 days ago though, so the fix should have made it into the current pacman release.

#9 2015-01-01 13:09:01

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,246
Website

Re: [SOLVED] pacman: error: failed to initialize alpm library

Nope…   pacman-4.2.0 was created on 2014-12-19.   It will be pulled for the 4.2.1 release.

#10 2015-01-01 13:20:23

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: [SOLVED] pacman: error: failed to initialize alpm library

My mistake. Then the error is indeed in pacman-4.2.0. It will be fixed in the next release then.

#11 2015-01-02 16:38:34

stefanwilkens
Member
From: Enschede, the Netherlands
Registered: 2008-12-10
Posts: 624

Re: [SOLVED] pacman: error: failed to initialize alpm library

shameless plug:

The Dutch translation is very lacking at the moment, some new people joined in recent weeks — here’s to hoping things will improve shortly.

Anybody looking to put some time into this and review translations or add to the translations for pacman-scripts (22% at this moment), please do drop me a message through transifex. (https://www.transifex.com/accounts/profile/swilkens/)

Last edited by stefanwilkens (2015-01-02 16:40:19)


Arch i686 on Phenom X4 | GTX760

#12 2015-01-02 20:23:09

Xavion
Member
From: Australia
Registered: 2010-03-13
Posts: 38

Re: [SOLVED] pacman: error: failed to initialize alpm library

The «pacman-db-upgrade» operation took about 10 minutes here.  This was particularly surprising, given that I’ve got a SSD.

I was getting worried that it was stuck in an infinite loop somewhere.  I think you should add an extra line to the output text:

==> Pre-4.2 database format detected — upgrading…
==> Please be aware — this will take a f**king eternity.

#13 2015-01-02 21:29:59

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,163
Website

Re: [SOLVED] pacman: error: failed to initialize alpm library

Xavion wrote:

The «pacman-db-upgrade» operation took about 10 minutes here.  This was particularly surprising, given that I’ve got a SSD.

I was getting worried that it was stuck in an infinite loop somewhere.  I think you should add an extra line to the output text:

==> Pre-4.2 database format detected — upgrading…
==> Please be aware — this will take a f**king eternity.

Really? For me, it only took 30 seconds or so to upgrade the database format when I did an upgrade on a buddy’s machine. And that’s a slow dual-core with a rotating disk.


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

#14 2015-01-02 21:40:58

Xavion
Member
From: Australia
Registered: 2010-03-13
Posts: 38

Re: [SOLVED] pacman: error: failed to initialize alpm library

Okay, it looks like my recommendation should be reworded slightly:

==> Pre-4.2 database format detected — upgrading…
==> Please be aware — this may take a f**king eternity.

#15 2015-01-03 02:03:28

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: [SOLVED] pacman: error: failed to initialize alpm library

FWIW, mine finished almost immediately. Maybe 10 seconds. Maybe you just have a huge amount of packages installed?


Matt

«It is very difficult to educate the educated.»

#16 2015-01-03 02:29:45

Xavion
Member
From: Australia
Registered: 2010-03-13
Posts: 38

Re: [SOLVED] pacman: error: failed to initialize alpm library

The output of «pacman -Qs | wc -l» is «3528», which means I’ve got 1764 packages installed.  It’s also worth noting that I make use of the pacman-cage package to (normally) speed things up.

#17 2015-01-03 04:59:48

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

Re: [SOLVED] pacman: error: failed to initialize alpm library

Xavion wrote:

The output of «pacman -Qs | wc -l» is «3528», which means I’ve got 1764 packages installed.

Q: How to quickly count how many sheep do you have?
A: Count their legs and divide by 4.

#18 2015-01-03 07:04:13

Xavion
Member
From: Australia
Registered: 2010-03-13
Posts: 38

Re: [SOLVED] pacman: error: failed to initialize alpm library

Oh, well done; you truly are brilliant.  Would you like a medal or a trophy?

#19 2015-01-03 08:36:42

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: [SOLVED] pacman: error: failed to initialize alpm library

stefanwilkens wrote:

shameless plug:

The Dutch translation is very lacking at the moment, some new people joined in recent weeks — here’s to hoping things will improve shortly.

Anybody looking to put some time into this and review translations or add to the translations for pacman-scripts (22% at this moment), please do drop me a message through transifex. (https://www.transifex.com/accounts/profile/swilkens/)

Check your transifex inbox!


fs/super.c : «Self-destruct in 5 seconds.  Have a nice day…n»,

#20 2015-01-06 04:46:31

shoelesshunter
Member
Registered: 2014-05-18
Posts: 266

Re: [SOLVED] pacman: error: failed to initialize alpm library

I use yaourt and get this upon upgrade:

package-query: error while loading shared libraries: libalpm.so.8: cannot open shared object file: No such file or directory

Last edited by shoelesshunter (2015-01-06 04:47:20)

#21 2015-01-06 04:50:11

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,376
Website

Re: [SOLVED] pacman: error: failed to initialize alpm library

Search the boards: there have been plenty of threads about package-query and yaourt.

This is done. Closing.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Содержание

  1. Arch Linux
  2. #1 2012-01-21 19:31:23
  3. [solved — non-issue] error: failed to initialize alpm library
  4. #2 2012-01-21 19:55:56
  5. Re: [solved — non-issue] error: failed to initialize alpm library
  6. #3 2012-01-21 20:20:27
  7. Re: [solved — non-issue] error: failed to initialize alpm library
  8. #4 2012-01-21 20:27:12
  9. Re: [solved — non-issue] error: failed to initialize alpm library
  10. #5 2012-01-22 00:36:14
  11. Re: [solved — non-issue] error: failed to initialize alpm library
  12. #6 2012-01-22 07:11:32
  13. Re: [solved — non-issue] error: failed to initialize alpm library
  14. #7 2012-01-22 15:53:14
  15. Re: [solved — non-issue] error: failed to initialize alpm library
  16. #8 2012-01-22 16:05:16
  17. Re: [solved — non-issue] error: failed to initialize alpm library
  18. #9 2012-01-22 17:04:17
  19. Re: [solved — non-issue] error: failed to initialize alpm library
  20. #10 2012-02-17 16:27:21
  21. Re: [solved — non-issue] error: failed to initialize alpm library
  22. #11 2012-02-17 16:47:35
  23. Re: [solved — non-issue] error: failed to initialize alpm library
  24. #12 2012-03-25 20:08:21
  25. Re: [solved — non-issue] error: failed to initialize alpm library
  26. #13 2012-03-26 08:59:21
  27. Re: [solved — non-issue] error: failed to initialize alpm library
  28. #14 2012-03-26 18:07:03
  29. Re: [solved — non-issue] error: failed to initialize alpm library
  30. #15 2012-04-01 20:22:47
  31. Re: [solved — non-issue] error: failed to initialize alpm library
  32. Arch Linux
  33. #1 2014-12-20 09:02:07
  34. [SOLVED] pacman: error: failed to initialize alpm library
  35. #2 2014-12-20 09:14:27
  36. Re: [SOLVED] pacman: error: failed to initialize alpm library
  37. #3 2014-12-31 12:04:45
  38. Re: [SOLVED] pacman: error: failed to initialize alpm library
  39. #4 2014-12-31 17:49:07
  40. Re: [SOLVED] pacman: error: failed to initialize alpm library
  41. #5 2015-01-01 00:18:53
  42. Re: [SOLVED] pacman: error: failed to initialize alpm library
  43. #6 2015-01-01 10:07:11
  44. Re: [SOLVED] pacman: error: failed to initialize alpm library
  45. #7 2015-01-01 12:19:53
  46. Re: [SOLVED] pacman: error: failed to initialize alpm library
  47. #8 2015-01-01 12:28:15
  48. Re: [SOLVED] pacman: error: failed to initialize alpm library
  49. #9 2015-01-01 13:09:01
  50. Re: [SOLVED] pacman: error: failed to initialize alpm library
  51. #10 2015-01-01 13:20:23
  52. Re: [SOLVED] pacman: error: failed to initialize alpm library
  53. #11 2015-01-02 16:38:34
  54. Re: [SOLVED] pacman: error: failed to initialize alpm library
  55. #12 2015-01-02 20:23:09
  56. Re: [SOLVED] pacman: error: failed to initialize alpm library
  57. #13 2015-01-02 21:29:59
  58. Re: [SOLVED] pacman: error: failed to initialize alpm library
  59. Arch Linux
  60. #1 2015-01-05 10:55:44
  61. failed to initialize alpm library (pacman-db-upgrade didnt help)
  62. #2 2015-01-05 11:03:51
  63. Re: failed to initialize alpm library (pacman-db-upgrade didnt help)
  64. #3 2015-01-05 11:22:17
  65. Re: failed to initialize alpm library (pacman-db-upgrade didnt help)
  66. #4 2015-01-05 22:08:57
  67. Re: failed to initialize alpm library (pacman-db-upgrade didnt help)
  68. Arch Linux
  69. #1 2019-05-14 22:09:54
  70. [SOLVED] makepkg fails with failed to initialize alpm library
  71. #2 2019-05-15 01:34:58
  72. Re: [SOLVED] makepkg fails with failed to initialize alpm library
  73. #3 2019-05-15 02:02:25
  74. Re: [SOLVED] makepkg fails with failed to initialize alpm library
  75. #4 2019-05-15 07:08:18
  76. Re: [SOLVED] makepkg fails with failed to initialize alpm library
  77. Arch Linux
  78. #1 2014-11-15 01:00:47
  79. [SOLVED] Can’t remove packages.
  80. #2 2014-11-15 01:05:48
  81. Re: [SOLVED] Can’t remove packages.
  82. #3 2014-11-15 01:11:16
  83. Re: [SOLVED] Can’t remove packages.
  84. #4 2014-11-15 01:29:20
  85. Re: [SOLVED] Can’t remove packages.
  86. #5 2014-11-15 01:39:30
  87. Re: [SOLVED] Can’t remove packages.
  88. #6 2014-11-15 04:27:53
  89. Re: [SOLVED] Can’t remove packages.
  90. #7 2014-11-17 03:36:59
  91. Re: [SOLVED] Can’t remove packages.

Arch Linux

You are not logged in.

#1 2012-01-21 19:31:23

[solved — non-issue] error: failed to initialize alpm library

I managed to blow up pacman during the recent upgrade, but fixed it with the help of some posts on the fora. That said, now when I run any recursive command, I get the following error:

running a locate shows:

Anyone know what I failed to fix after I broke pacman?

Last edited by Snarkout (2012-01-22 17:42:34)

Unthinking respect for authority is the greatest enemy of truth.
-Albert Einstein

#2 2012-01-21 19:55:56

Re: [solved — non-issue] error: failed to initialize alpm library

Do /var/lib/pacman/local and /var/lib/pacman/sync both exist?

#3 2012-01-21 20:20:27

Re: [solved — non-issue] error: failed to initialize alpm library

Do /var/lib/pacman/local and /var/lib/pacman/sync both exist?

Unthinking respect for authority is the greatest enemy of truth.
-Albert Einstein

#4 2012-01-21 20:27:12

Re: [solved — non-issue] error: failed to initialize alpm library

Run ‘pacman -Tv’. Make sure all those dirs exist. —debug is your friend, as is strace.

#5 2012-01-22 00:36:14

Re: [solved — non-issue] error: failed to initialize alpm library

Thanks for the help — I appear to be missing some locale stuff.

From the strace:

I’m using the locale «en_US.UTF-8» in rc.conf and locale.gen — did I miss an announcement?

Unthinking respect for authority is the greatest enemy of truth.
-Albert Einstein

#6 2012-01-22 07:11:32

Re: [solved — non-issue] error: failed to initialize alpm library

#7 2012-01-22 15:53:14

Re: [solved — non-issue] error: failed to initialize alpm library

Thanks, but I’m using pacman directly in this case, and I don’t have /usr/local/bin in root’s $PATH at all (though there is a bunch of junk in there I didn’t manually add):

Just for grins, I manually copied the two missing files into en_US from en_GB, now it bombs here instead:

Being a coding dunce, I’m assuming i686 and fstat64 aren’t in conflict.

Unthinking respect for authority is the greatest enemy of truth.
-Albert Einstein

#8 2012-01-22 16:05:16

Re: [solved — non-issue] error: failed to initialize alpm library

What exactly are you trying to achieve with that? Perhaps you should go look at what the -r flag does.

#9 2012-01-22 17:04:17

Re: [solved — non-issue] error: failed to initialize alpm library

You’re right, I’m using the wrong flag. I could have sworn that -r and —recursive were the same thing, but obviously not. I was actually trying to recursively remove packages yesterday and ran into that issue, while trying to do too many other things at once. I apologize for the noise (and being a dumbass).

Unthinking respect for authority is the greatest enemy of truth.
-Albert Einstein

#10 2012-02-17 16:27:21

Re: [solved — non-issue] error: failed to initialize alpm library

Faconindy, I unfortunately formated my /var. How to re-create pacman’s files needed for alpm to make pacman functional again? Thanks a lot.

Our tomcat for your mice! Archlinux for your comps! Alfa Romeo for your roads! Faster running guaranted!

#11 2012-02-17 16:47:35

Re: [solved — non-issue] error: failed to initialize alpm library

Faconindy, I unfortunately formated my /var. How to re-create pacman’s files needed for alpm to make pacman functional again? Thanks a lot.

Edit:
Er. nm, misread it. Just mkdir -p the dirs that pacman complains about.
/var/cache/pacman/pkg/
/var/lib/pacman/
and /var/log/ if you have not gotten it back yet.

Last edited by Mr.Elendig (2012-02-17 16:50:04)

Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

#12 2012-03-25 20:08:21

Re: [solved — non-issue] error: failed to initialize alpm library

This is not working on snapshot 2012-03-25 iso.

. Using Arch Linux Since October 25, 2011 .
. Tutorials: http://distrogeeks.com/ .

#13 2012-03-26 08:59:21

Re: [solved — non-issue] error: failed to initialize alpm library

Known issue, just use the official install iso instead.

Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

#14 2012-03-26 18:07:03

Re: [solved — non-issue] error: failed to initialize alpm library

Actually, I got around this issue by installing this packages,
http://wiki.gotux.net/archlinux/tutoria … al-install

It worked for me 😉 It looks like when you don’t install filesystem and initscripts you get that error. I’ve tested in one of my vm’s

. Using Arch Linux Since October 25, 2011 .
. Tutorials: http://distrogeeks.com/ .

#15 2012-04-01 20:22:47

Re: [solved — non-issue] error: failed to initialize alpm library

It looks like this problem is do to /etc/fstab specifically in my case reiserfs see bellow for more details.

For example this reiserfs which is uses default options works.
UUID=#### /var reiserfs defaults 0 2

Where this one, with custom options does not.
UUID=#### /var reiserfs defaults,nodiratime,noatime,discard 0 2

I think reiserfs does not support «discard» option on SSD.
This is why its not mounting filesystem correctly and ones you run pacman -Syu you get that error.

I’ve tested this on my netbook, and this is why I had this error. I hope this helps.

Last edited by TuxLyn (2012-04-01 20:31:54)

Источник

Arch Linux

You are not logged in.

#1 2014-12-20 09:02:07

[SOLVED] pacman: error: failed to initialize alpm library

I just upgraded my system about an hour ago and now whenever I run any pacman-related command I get this:

How can I get a correct database version?

Last edited by essence-of-foo (2014-12-20 09:13:18)

#2 2014-12-20 09:14:27

Re: [SOLVED] pacman: error: failed to initialize alpm library

Was something that was tried by pacman automatically but it was actually a hint of what to do next. So running

solved the problem.

#3 2014-12-31 12:04:45

Re: [SOLVED] pacman: error: failed to initialize alpm library

Thanks!
Worked for me too. just another silly arch-user.

#4 2014-12-31 17:49:07

Re: [SOLVED] pacman: error: failed to initialize alpm library

pacman-db-upgrade

fs/super.c : «Self-destruct in 5 seconds. Have a nice day. n»,

#5 2015-01-01 00:18:53

Re: [SOLVED] pacman: error: failed to initialize alpm library

pacman-db-upgrade

So . you did the same thing as OP and Kobussie? No need to post a ‘me too’ then.

#6 2015-01-01 10:07:11

Re: [SOLVED] pacman: error: failed to initialize alpm library

pacman-db-upgrade

So . you did the same thing as OP and Kobussie? No need to post a ‘me too’ then.

Whoops misread the commands, I was in a hurry.

Pacman suggested pacman-db-update (which it could not find).

fs/super.c : «Self-destruct in 5 seconds. Have a nice day. n»,

#7 2015-01-01 12:19:53

Re: [SOLVED] pacman: error: failed to initialize alpm library

There is a typo in one of the translations. Dutch maybe?

#8 2015-01-01 12:28:15

Re: [SOLVED] pacman: error: failed to initialize alpm library

The Dutch translation did indeed have a typo. It was fixed 12 days ago though, so the fix should have made it into the current pacman release.

#9 2015-01-01 13:09:01

Re: [SOLVED] pacman: error: failed to initialize alpm library

Nope. pacman-4.2.0 was created on 2014-12-19. It will be pulled for the 4.2.1 release.

#10 2015-01-01 13:20:23

Re: [SOLVED] pacman: error: failed to initialize alpm library

My mistake. Then the error is indeed in pacman-4.2.0. It will be fixed in the next release then.

#11 2015-01-02 16:38:34

Re: [SOLVED] pacman: error: failed to initialize alpm library

The Dutch translation is very lacking at the moment, some new people joined in recent weeks — here’s to hoping things will improve shortly.

Anybody looking to put some time into this and review translations or add to the translations for pacman-scripts (22% at this moment), please do drop me a message through transifex. (https://www.transifex.com/accounts/profile/swilkens/)

Last edited by stefanwilkens (2015-01-02 16:40:19)

Arch i686 on Phenom X4 | GTX760

#12 2015-01-02 20:23:09

Re: [SOLVED] pacman: error: failed to initialize alpm library

The «pacman-db-upgrade» operation took about 10 minutes here. This was particularly surprising, given that I’ve got a SSD.

I was getting worried that it was stuck in an infinite loop somewhere. I think you should add an extra line to the output text:

==> Pre-4.2 database format detected — upgrading.
==> Please be aware — this will take a f**king eternity.

#13 2015-01-02 21:29:59

Re: [SOLVED] pacman: error: failed to initialize alpm library

The «pacman-db-upgrade» operation took about 10 minutes here. This was particularly surprising, given that I’ve got a SSD.

I was getting worried that it was stuck in an infinite loop somewhere. I think you should add an extra line to the output text:

==> Pre-4.2 database format detected — upgrading.
==> Please be aware — this will take a f**king eternity.

Really? For me, it only took 30 seconds or so to upgrade the database format when I did an upgrade on a buddy’s machine. And that’s a slow dual-core with a rotating disk.

Источник

Arch Linux

You are not logged in.

#1 2015-01-05 10:55:44

failed to initialize alpm library (pacman-db-upgrade didnt help)

Yes, I have seen the recent topic, `pacman-db-upgrade` didnt help.

Pacman is latest, 4.2.0-5

Ok, let’s see where it actually fails:

There’s no matching translation file for my (pretty common I assume) en_US.UTF-8 locale.

This gave me an idea to look for EACCES:

After `chmod a+x /var/lib/pacman/local` problem has gone.
I’ve removed translations previously copied to /usr/share/locale/en/LC_MESSAGES/, works fine regardless.

Problems so far:
1. Something goes wrong with non 022 umask (027 specifically).
2. Error handling and error messages are not exactly correct.
3. Pacman misses common ‘en’ locale and has a specific ‘en_GB’ one instead (doesn’t seem to affect anything, but anyway).

Is it all my fault or should be reported?

Last edited by pirj (2015-01-05 10:59:23)

#2 2015-01-05 11:03:51

Re: failed to initialize alpm library (pacman-db-upgrade didnt help)

What actually happens when you run `pacman-db-upgrade`?

#3 2015-01-05 11:22:17

Re: failed to initialize alpm library (pacman-db-upgrade didnt help)

Nothing. It’s in 4.2 format already.

#4 2015-01-05 22:08:57

Re: failed to initialize alpm library (pacman-db-upgrade didnt help)

After `chmod a+x /var/lib/pacman/local` problem has gone.

So, what was the permission on this directory before you did this? And also what are the permissions on file inside /. /local?

I am guessing that your user umask is propagated to sudo. Then, pacman sets this «wrong» permission on the local DB. That’s one reason why sudo and su have to be used with caution, it’s always better to just log in as root via tty or ssh as root into localhost.

Problems so far:
1. Something goes wrong with non 022 umask (027 specifically).
2. Error handling and error messages are not exactly correct.
3. Pacman misses common ‘en’ locale and has a specific ‘en_GB’ one instead (doesn’t seem to affect anything, but anyway).

Is it all my fault or should be reported?

(3) is not a problem because en_US is a default language, so there is no need for a localization (at least this is my understanding). That’s why some small projects have no localization data inn /sur/share at all.

(1) Probably an issue with sudo.

Arch Linux is more than just GNU/Linux — it’s an adventure
pkill -9 systemd

Источник

Arch Linux

You are not logged in.

#1 2019-05-14 22:09:54

[SOLVED] makepkg fails with failed to initialize alpm library

When trying to build an install a package from AUR, makepkg fails.

This happens with all the packages I have tried to build.

I’m having no issues with pacman directly. I ran pacman -Tv and verified that all the listed directories exist (including /var/lib/pacman).

Last edited by shermixx (2019-05-15 15:25:21)

#2 2019-05-15 01:34:58

Re: [SOLVED] makepkg fails with failed to initialize alpm library

Could be a permissions issue with the pacman db?

When you run a system update do you use sudo?

#3 2019-05-15 02:02:25

Re: [SOLVED] makepkg fails with failed to initialize alpm library

When you run a system update do you use sudo?

Ha! Fair question and the answer is yes.

Something told me it was a permission issue but everywhere I had checked looked fine. There were several warnings during the install complaining of directory permissions not matching the package but I tracked those down with pacman -Qkk and fixed them. I thought.

Thanks for your help!

#4 2019-05-15 07:08:18

Re: [SOLVED] makepkg fails with failed to initialize alpm library

Please remember to mark your thread as solved by editing the first post and amending the topic title.

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

Источник

Arch Linux

You are not logged in.

#1 2014-11-15 01:00:47

[SOLVED] Can’t remove packages.

Hi there, I seem to no longer be able to remove packages with pacman.
I get the error: failed to initialise alpm library (could not find or read directory)

A debug output gives me this:

Last edited by ful (2014-11-17 04:23:32)

#2 2014-11-15 01:05:48

Re: [SOLVED] Can’t remove packages.

Can you post the output of the following:

«UNIX is simple and coherent. » — Dennis Ritchie, «GNU’s Not UNIX» — Richard Stallman

#3 2014-11-15 01:11:16

Re: [SOLVED] Can’t remove packages.

ls -l /usr/lib/libalpm*

#4 2014-11-15 01:29:20

Re: [SOLVED] Can’t remove packages.

Oops, my suspicion went in the wrong direction — that all looks fine.

But a quick google search did return a solved thread for this exact same error:
https://bbs.archlinux.org/viewtopic.php?id=134070

«UNIX is simple and coherent. » — Dennis Ritchie, «GNU’s Not UNIX» — Richard Stallman

#5 2014-11-15 01:39:30

Re: [SOLVED] Can’t remove packages.

I found that thread earlier but I’m afraid none of the solutions there seem to be relevant to me.

#6 2014-11-15 04:27:53

Re: [SOLVED] Can’t remove packages.

What’s in /var/lib/pacman/local and /var/lib/pacman/sync?

Online

#7 2014-11-17 03:36:59

Re: [SOLVED] Can’t remove packages.

And today it seems to be working again, I have no idea why. Thanks for the help anyway, I appreciate it.

Last edited by ful (2014-11-17 04:23:08)

Источник

As long as I understood it is because of privilege configuration with the Docker and running a container. When we login to the OS, it seems we are root but infact we do not have the right root permission. And here is a simple try:

root[0]docker:~# docker run -it archlinux:latest bash
[root@c565c90fdb7f /]# pacman
error: failed to initialize alpm library
(could not find or read directory: /var/lib/pacman/)
[root@c565c90fdb7f /]# exit
exit

but if we give the right root permission when we login to the container then it is okay.

root[0]docker:~# docker run -it --privileged=true archlinux:latest bash
[root@0d95575abec6 /]# dir
bin  boot  dev  etc  home  lib  lib64  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
[root@0d95575abec6 /]# pacman
warning: database file for 'core' does not exist (use '-Sy' to download)
warning: database file for 'extra' does not exist (use '-Sy' to download)
warning: database file for 'community' does not exist (use '-Sy' to download)
error: no operation specified (use -h for help)
[root@0d95575abec6 /]# pacman -Sy
:: Synchronizing package databases...
 core                                                                                                        131.2 KiB  10.7 MiB/s 00:00 [####################################################################################] 100%
 extra                                                                                                      1654.4 KiB   101 MiB/s 00:00 [####################################################################################] 100%
 community                                                                                                     5.4 MiB   270 MiB/s 00:00 [####################################################################################] 100%
[root@0d95575abec6 /]# exit
exit

So for login to Arch Linux this options --privileged=true should be used whereas for Debian , Alpine, Ubunut it seems we do not need it.


Has been tested on:

cat /etc/os-release

NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://www.archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
LOGO=archlinux

and

 pacman -V

 .--.                  Pacman v5.2.2 - libalpm v12.0.2
/ _.-' .-.  .-.  .-.   Copyright (C) 2006-2020 Pacman Development Team
  '-. '-'  '-'  '-'   Copyright (C) 2002-2006 Judd Vinet
 '--'
                       This program may be freely redistributed under
                       the terms of the GNU General Public License.

and Docker

docker -v
Docker version 19.03.6, build 369ce74a3c

#
8 лет, 5 месяцев назад

Темы:

1

Сообщения:

16

Участник с: 21 августа 2014

При вводе команды Pacman S (что либо) выдает такую вот ошибку..
Error: failed to initialize alpm library (could not find or read directory)

Как этот пакман то сделать?

drfaust

#
8 лет, 5 месяцев назад

Темы:

10

Сообщения:

53

Участник с: 18 июля 2013

Выложите в спойлер выхлоп:

#cat /var/log/pacman.log

lampslave

#
8 лет, 5 месяцев назад

Темы:

32

Сообщения:

4800

Участник с: 05 июля 2011

Pacman S это не команда. Команда вот:

pacman -S

boujele

#
8 лет, 5 месяцев назад

Темы:

1

Сообщения:

16

Участник с: 21 августа 2014

Это я тут не поставил дефиз… Полез гуглить «Выложите в спойлер выхлоп»… Кроме как постов о машинах, ничего не нашёл.. я первый день в глаза вижу linux. Производил установку по мэнуалу с ютуба и вики. дошёл до пункта»установка драйверов» и при команде: Pacman -Suy xorg xorg-xinit xorg-utils .. Стало выбивать ошибку.

lampslave

#
8 лет, 5 месяцев назад

Темы:

32

Сообщения:

4800

Участник с: 05 июля 2011

Дайте ссылку на мануал.

boujele

#
8 лет, 5 месяцев назад

Темы:

1

Сообщения:

16

Участник с: 21 августа 2014

https://www.youtube.com/watch?v=Q8pexbE_aWM&list=PLh3LoKFbdJekSfTgEKTo3L6mCZ4hTCjwQ

lampslave

#
8 лет, 5 месяцев назад

Темы:

32

Сообщения:

4800

Участник с: 05 июля 2011

Давайте ещё вывод mount и содержимое /etc/fstab.

boujele

#
8 лет, 5 месяцев назад

Темы:

1

Сообщения:

16

Участник с: 21 августа 2014


это /etc/fstab .как я понял,интуитивно, это текстовый редактор?(уж извините за глупые вопросы)
http://cs616731.vk.me/v616731910/19b51/9eQVCX4UEFI.jpg
http://cs616731.vk.me/v616731910/19b59/K4ULltUotc4.jpg
это mount .
Показать могу,к сожалению только так, других способов не пришло в голову:) я даже браузер не могу установить ,т.к. этот пакман не работает..

Aivar

#
8 лет, 5 месяцев назад

Темы:

4

Сообщения:

6897

Участник с: 17 февраля 2011

boujele
т.к. этот пакман не работает..

Чушь. Ничего, что у вас fstab пустой? Признаться, даже лень разбираться почему. Хотя, по крайней мере один раздел у вас примонтирован — /dev/sda3.
Все же не смотрите киношек, а ставьте по толковому мануалу — Wiki, блог Lampslave etc…

boujele
я первый день в глаза вижу linux.

Тогда потренируйтесь пока на кошках Ubuntu. Принцип Линя вообще — от понимания к действию, а Арча — тем паче.
Без обид.

lampslave

#
8 лет, 5 месяцев назад

Темы:

32

Сообщения:

4800

Участник с: 05 июля 2011

По мануалу у вас должно быть 4 раздела, и все они должны упоминаться в /etc/fstab. Я вижу только один, плюс чистый /etc/fstab.
Основная причина подобных ошибок — отсутствие или повреждение содержимого /var/lib/pacman. Что конкретно случилось у вас я не знаю, но одно могу сказать точно — Арч не пригоден для начального изучения линукса. Попробуйте сначала чего-нибудь попроще, научитесь работать в консоли и тогда уже пробуйте Арч, если он будет вам по-прежнему интересен.

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Packet processing error minecraft
  • Packet loss warface как исправить
  • Packet loss war thunder как исправить
  • Packet loss fortnite как исправить
  • Packet error rate это

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии