laughk / archlinux-note

普段使っている ArchLinux に関するメモ置き場です
5 stars 0 forks source link

error while loading shared libraries: libalpm.so.10: cannot open shared object file: No such file or directory #18

Closed laughk closed 6 years ago

laughk commented 6 years ago

いつもどおりのカジュアルアップデートで以下のような感じにコケた

$ yaourt -Syua --noconfirm
:: Synchronizing package databases...
 core                                                                           129.4 KiB  1348K/s 00:00 [##############################################################] 100%
 extra                                                                         1611.1 KiB  5.03M/s 00:00 [##############################################################] 100%
 community                                                                        4.4 MiB  13.4M/s 00:00 [##############################################################] 100%
 archlinuxfr is up to date
 Foreign packages: | 44 / 44

==> Package upgrade only (new release):
extra/appstream-glib         0.7.7-1                  1 -> 2

==> Software upgrade (new version) :
core/pacman                  5.0.2-3                  -> 5.1.0-1
core/xfsprogs                4.15.1-1                 -> 4.16.1-1
extra/fftw                   3.3.7-1                  -> 3.3.8-1
extra/ldb                    1.3.2-1                  -> 1.3.3-1
extra/libwbclient            4.8.1-1                  -> 4.8.2-1
extra/network-manager-applet 1.8.11dev+12+ga37483c1-1 -> 1.8.12-1
extra/nm-connection-editor   1.8.11dev+12+ga37483c1-1 -> 1.8.12-1
extra/smbclient              4.8.1-1                  -> 4.8.2-1
aur/python34                 3.4.7-1                  -> 3.4.8-1
aur/typora                   0.9.51-1                 -> 0.9.52-1
aur/yay                      6.777-2                  -> 6.784-1

==> Continue upgrade ? [Y/n]
==> [V]iew package detail   [M]anually select packages
==> --------------------------------------------------
==> :: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Packages (9) appstream-glib-0.7.7-2  fftw-3.3.8-1  ldb-1.3.3-1  libwbclient-4.8.2-1  network-manager-applet-1.8.12-1  nm-connection-editor-1.8.12-1  pacman-5.1.0-1
             smbclient-4.8.2-1  xfsprogs-4.16.1-1

Total Download Size:   10.84 MiB
Total Installed Size:  49.10 MiB
Net Upgrade Size:      -0.93 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages...
 pacman-5.1.0-1-x86_64                                                          743.9 KiB  2.59M/s 00:00 [##############################################################] 100%
 xfsprogs-4.16.1-1-x86_64                                                       942.9 KiB  6.58M/s 00:00 [##############################################################] 100%
 appstream-glib-0.7.7-2-x86_64                                                  365.6 KiB  10.5M/s 00:00 [##############################################################] 100%
 fftw-3.3.8-1-x86_64                                                           1852.3 KiB  9.88M/s 00:00 [##############################################################] 100%
 ldb-1.3.3-1-x86_64                                                             168.1 KiB  41.0M/s 00:00 [##############################################################] 100%
 libwbclient-4.8.2-1-x86_64                                                      33.4 KiB  0.00B/s 00:00 [##############################################################] 100%
 nm-connection-editor-1.8.12-1-x86_64                                           943.7 KiB  13.8M/s 00:00 [##############################################################] 100%
 network-manager-applet-1.8.12-1-x86_64                                         149.6 KiB  4.43M/s 00:00 [##############################################################] 100%
 smbclient-4.8.2-1-x86_64                                                         5.8 MiB  12.5M/s 00:00 [##############################################################] 100%
(9/9) checking keys in keyring                                                                           [##############################################################] 100%
(9/9) checking package integrity                                                                         [##############################################################] 100%
(9/9) loading package files                                                                              [##############################################################] 100%
(9/9) checking for file conflicts                                                                        [##############################################################] 100%
(9/9) checking available disk space                                                                      [##############################################################] 100%
:: Processing package changes...
(1/9) upgrading pacman                                                                                   [##############################################################] 100%
(2/9) upgrading appstream-glib                                                                           [##############################################################] 100%
(3/9) upgrading fftw                                                                                     [##############################################################] 100%
(4/9) upgrading ldb                                                                                      [##############################################################] 100%
(5/9) upgrading libwbclient                                                                              [##############################################################] 100%
(6/9) upgrading nm-connection-editor                                                                     [##############################################################] 100%
(7/9) upgrading network-manager-applet                                                                   [##############################################################] 100%
(8/9) upgrading smbclient                                                                                [##############################################################] 100%
(9/9) upgrading xfsprogs                                                                                 [##############################################################] 100%
:: Running post-transaction hooks...
(1/6) Compiling GSettings XML schema files...
(2/6) Updating icon theme caches...
(3/6) Reloading system manager configuration...
(4/6) Arming ConditionNeedsUpdate...
(5/6) Updating the info directory file...
(6/6) Updating the desktop file MIME type cache...
package-query: error while loading shared libraries: libalpm.so.10: cannot open shared object file: No such file or directory
==> ERROR: unable to update
package-query: error while loading shared libraries: libalpm.so.10: cannot open shared object file: No such file or directory
==> ERROR: unable to update
package-query: error while loading shared libraries: libalpm.so.10: cannot open shared object file: No such file or directory
==> ERROR: unable to update
package-query: error while loading shared libraries: libalpm.so.10: cannot open shared object file: No such file or directory
No database errors have been found!

問題はこの後で、以下のエラーで pacman, yaourt などヘルパー含めてパッケージ管理が使えなくなった

$ yaourt -Ss pre-commit
package-query: error while loading shared libraries: libalpm.so.10: cannot open shared object file: No such file or directory
$ yay   
yay: error while loading shared libraries: libalpm.so.10: cannot open shared object file: No such file or directory
laughk commented 6 years ago

応急処置

とりあえず libalpm.so.* を探してみる

$ sudo find /  -name "*libalpm.so*"
find: ‘/run/user/1000/gvfs’: Permission denied
/usr/lib/libalpm.so.11.0.0
/usr/lib/libalpm.so
/usr/lib/libalpm.so.11

という感じでどうも libalpm というやつのバージョンが上がったことが原因っぽい。

雑な応急処置としてシムリンクで逃げることにする。

$ cd /usr/lib/

$ sudo ln -sv libalpm.so.11 libalpm.so.10
'libalpm.so.10' -> 'libalpm.so.11'

$ ls -l libalpm.so.10 
lrwxrwxrwx 1 root root 13 May 29 14:33 libalpm.so.10 -> libalpm.so.11*

これで一応動くようになった

$ yay                                    
:: Synchronizing package databases...
 core is up to date
 extra                                                                                     1610.8 KiB  4.11M/s 00:00 [######################################################################] 100%
 community                                                                                    4.4 MiB  11.1M/s 00:00 [######################################################################] 100%
 archlinuxfr is up to date
:: Searching databases for updates...
:: Searching AUR for updates...
 -> Local package is newer than AUR: ttf-cica (2.0.4-1 -> 1.0.2-1)
:: Querying AUR...
 -> Missing AUR Packages:  js  libcloudproviders  libhttpseverywhere  vte3-ng
:: 5 Packages to upgrade.
5  extra/gnome-builder          3.28.1-1 -> 3.28.2-1
4  community/python-sqlalchemy  1.2.7-1  -> 1.2.8-1
3  aur/python34                 3.4.7-1  -> 3.4.8-1
2  aur/typora                   0.9.51-1 -> 0.9.52-1
1  aur/yay                      6.777-2  -> 6.784-1
laughk commented 6 years ago

どうも libalpm というやつのバージョンが上がったことが原因

これは pacman に含まれるライブラリみたい。 ref. https://www.archlinux.org/packages/core/x86_64/pacman/files/

https://github.com/laughk/archlinux-note/issues/18#issue-327177070 のアップデートの際に中途半端な状態でファイルが展開され、新バージョンと旧バージョンの pacman がごちゃまぜになって発生した可能性が高そう。

実際、シムリンクによる回避を行い再度アップデートを行った所、 libalpm.so.10 のシムリンクは削除しても正常に動いたことを確認。

# laughk @ archlinux in ~ [14:52:24] C:130
$ ls -l /usr/lib/libalpm.so
lrwxrwxrwx 1 root root 17 May 28 10:26 /usr/lib/libalpm.so -> libalpm.so.11.0.0*

# laughk @ archlinux in ~ [14:52:34] 
$ ls -l /usr/lib/libalpm.so.10 
lrwxrwxrwx 1 root root 13 May 29 14:33 /usr/lib/libalpm.so.10 -> libalpm.so.11*

# laughk @ archlinux in ~ [14:52:39] 
$ sudo unlink  /usr/lib/libalpm.so.10
[sudo] password for laughk: 

# laughk @ archlinux in ~ [14:52:50] 
$ ls -l /usr/lib/libalpm.so.10       
ls: cannot access '/usr/lib/libalpm.so.10': No such file or directory

# laughk @ archlinux in ~ [14:52:52] C:2
$ yay    
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 archlinuxfr is up to date
:: Searching databases for updates...
:: Searching AUR for updates...
 -> Local package is newer than AUR: ttf-cica (2.0.4-1 -> 1.0.2-1)
 -> Missing AUR Packages:  js  libcloudproviders  libhttpseverywhere  vte3-ng

:: Starting full system upgrade...
 there is nothing to do
laughk commented 6 years ago

なおったのでおしまい

laughk commented 6 years ago

yaourt の方は報告が上がっていた

https://aur.archlinux.org/packages/yaourt

ちなみに https://github.com/laughk/archlinux-note/issues/18#issuecomment-392660857 では yay で確認して問題なかった感じだけど、 yaourt だと libalpm.so.10 のシムリンクが消えるとまた起動しなくなってしまった...