更新过程中,mandb更新索引缓存失败,如何处理?

更新过程中,mandb更新索引缓存失败,如何处理?

dist-upgrade今天运行了它,输出结果如下:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  gnome-mines libglib2.0-0 libglib2.0-0:i386 libglib2.0-bin libglib2.0-data
  libglib2.0-dev libglib2.0-doc libspice-server1 qtox
9 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
Need to get 12.4 MB of archives.
After this operation, 4,531 kB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/gnome3-team/gnome3-staging/ubuntu xenial/main amd64 gnome-mines amd64 1:3.20.1-1~ubuntu16.04.1 [2,441 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libglib2.0-dev amd64 2.48.1-1~ubuntu16.04.1 [1,377 kB]
Get:3 https://pkg.tox.chat/debian nightly/wily amd64 qtox amd64 1.4.0-192-g279225c-1 [4,328 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libglib2.0-bin amd64 2.48.1-1~ubuntu16.04.1 [39.4 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial-updates/main i386 libglib2.0-0 i386 2.48.1-1~ubuntu16.04.1 [1,184 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libglib2.0-0 amd64 2.48.1-1~ubuntu16.04.1 [1,118 kB]
Get:7 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libglib2.0-data all 2.48.1-1~ubuntu16.04.1 [132 kB]
Get:8 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libglib2.0-doc all 2.48.1-1~ubuntu16.04.1 [1,471 kB]
Get:9 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libspice-server1 amd64 0.12.6-4ubuntu0.1 [338 kB]
Fetched 12.4 MB in 15s (783 kB/s)                                              
(Reading database ... 242183 files and directories currently installed.)
Preparing to unpack .../libglib2.0-data_2.48.1-1~ubuntu16.04.1_all.deb ...
Unpacking libglib2.0-data (2.48.1-1~ubuntu16.04.1) over (2.48.0-1ubuntu4) ...
Preparing to unpack .../libglib2.0-dev_2.48.1-1~ubuntu16.04.1_amd64.deb ...
Unpacking libglib2.0-dev (2.48.1-1~ubuntu16.04.1) over (2.48.0-1ubuntu4) ...
Preparing to unpack .../libglib2.0-bin_2.48.1-1~ubuntu16.04.1_amd64.deb ...
Unpacking libglib2.0-bin (2.48.1-1~ubuntu16.04.1) over (2.48.0-1ubuntu4) ...
Preparing to unpack .../libglib2.0-0_2.48.1-1~ubuntu16.04.1_i386.deb ...
De-configuring libglib2.0-0:amd64 (2.48.0-1ubuntu4) ...
Unpacking libglib2.0-0:i386 (2.48.1-1~ubuntu16.04.1) over (2.48.0-1ubuntu4) ...
Preparing to unpack .../libglib2.0-0_2.48.1-1~ubuntu16.04.1_amd64.deb ...
Unpacking libglib2.0-0:amd64 (2.48.1-1~ubuntu16.04.1) over (2.48.0-1ubuntu4) ...
Preparing to unpack .../gnome-mines_1%3a3.20.1-1~ubuntu16.04.1_amd64.deb ...
Unpacking gnome-mines (1:3.20.1-1~ubuntu16.04.1) over (1:3.20.0-2~ubuntu16.04.1) ...
Preparing to unpack .../libglib2.0-doc_2.48.1-1~ubuntu16.04.1_all.deb ...
Unpacking libglib2.0-doc (2.48.1-1~ubuntu16.04.1) over (2.48.0-1ubuntu4) ...
Preparing to unpack .../libspice-server1_0.12.6-4ubuntu0.1_amd64.deb ...
Unpacking libspice-server1:amd64 (0.12.6-4ubuntu0.1) over (0.12.6-4) ...
Preparing to unpack .../qtox_1.4.0-192-g279225c-1_amd64.deb ...
Unpacking qtox (1.4.0-192-g279225c-1) over (1.4.0-189-gfd2e585-1) ...
Processing triggers for man-db (2.7.5-1) ...
/usr/bin/mandb: warning: can't update index cache /var/cache/man/index.db: Resource temporarily unavailable
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu3) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for menu (2.1.47ubuntu1) ...
Setting up libglib2.0-data (2.48.1-1~ubuntu16.04.1) ...
Setting up libglib2.0-0:amd64 (2.48.1-1~ubuntu16.04.1) ...
Setting up libglib2.0-0:i386 (2.48.1-1~ubuntu16.04.1) ...
Setting up libglib2.0-bin (2.48.1-1~ubuntu16.04.1) ...
Setting up libglib2.0-dev (2.48.1-1~ubuntu16.04.1) ...
Setting up gnome-mines (1:3.20.1-1~ubuntu16.04.1) ...
Setting up libglib2.0-doc (2.48.1-1~ubuntu16.04.1) ...
Setting up libspice-server1:amd64 (0.12.6-4ubuntu0.1) ...
Setting up qtox (1.4.0-192-g279225c-1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for menu (2.1.47ubuntu1) ...

您将会看到出现以下错误:

Processing triggers for man-db (2.7.5-1) ...
/usr/bin/mandb: warning: can't update index cache /var/cache/man/index.db: Resource temporarily unavailable

有什么方法可以告诉我为什么会发生这种情况(如果没有明显的原因)?我能/需要做什么吗?因为更新索引缓存似乎失败了man?我正在运行带有 GNOME 3.20 的 Ubuntu GNOME 16.04。

信息更新:

运行sudo mandb输出:

Purging old database entries in /usr/share/man...
Processing manual pages under /usr/share/man...
Purging old database entries in /usr/share/man/en_CA...
Processing manual pages under /usr/share/man/en_CA...
Purging old database entries in /usr/share/man/km...
Processing manual pages under /usr/share/man/km...
Purging old database entries in /usr/share/man/sr...
Processing manual pages under /usr/share/man/sr...
Purging old database entries in /usr/share/man/be...
Processing manual pages under /usr/share/man/be...
Purging old database entries in /usr/share/man/ta...
Processing manual pages under /usr/share/man/ta...
Purging old database entries in /usr/share/man/ne...
Processing manual pages under /usr/share/man/ne...
Purging old database entries in /usr/share/man/lt...
Processing manual pages under /usr/share/man/lt...
Purging old database entries in /usr/share/man/ms...
Processing manual pages under /usr/share/man/ms...
Purging old database entries in /usr/share/man/hi...
Processing manual pages under /usr/share/man/hi...
Purging old database entries in /usr/share/man/et...
Processing manual pages under /usr/share/man/et...
Purging old database entries in /usr/share/man/zh_TW...
Processing manual pages under /usr/share/man/zh_TW...
Purging old database entries in /usr/share/man/de.UTF-8...
Processing manual pages under /usr/share/man/de.UTF-8...
Purging old database entries in /usr/share/man/ja...
Processing manual pages under /usr/share/man/ja...
Purging old database entries in /usr/share/man/tr...
Processing manual pages under /usr/share/man/tr...
Purging old database entries in /usr/share/man/bg...
Processing manual pages under /usr/share/man/bg...
Purging old database entries in /usr/share/man/az...
Processing manual pages under /usr/share/man/az...
Purging old database entries in /usr/share/man/ps...
Processing manual pages under /usr/share/man/ps...
Purging old database entries in /usr/share/man/pa...
Processing manual pages under /usr/share/man/pa...
Purging old database entries in /usr/share/man/nl...
Processing manual pages under /usr/share/man/nl...
Purging old database entries in /usr/share/man/th...
Processing manual pages under /usr/share/man/th...
Purging old database entries in /usr/share/man/es...
Processing manual pages under /usr/share/man/es...
Purging old database entries in /usr/share/man/zh_CN...
Processing manual pages under /usr/share/man/zh_CN...
Purging old database entries in /usr/share/man/da...
Processing manual pages under /usr/share/man/da...
Purging old database entries in /usr/share/man/pl...
Processing manual pages under /usr/share/man/pl...
Purging old database entries in /usr/share/man/fi...
Processing manual pages under /usr/share/man/fi...
Purging old database entries in /usr/share/man/fr...
Processing manual pages under /usr/share/man/fr...
Purging old database entries in /usr/share/man/fa...
Processing manual pages under /usr/share/man/fa...
Purging old database entries in /usr/share/man/fy...
Processing manual pages under /usr/share/man/fy...
Purging old database entries in /usr/share/man/lv...
Processing manual pages under /usr/share/man/lv...
Purging old database entries in /usr/share/man/en_AU...
Processing manual pages under /usr/share/man/en_AU...
Purging old database entries in /usr/share/man/cs...
Processing manual pages under /usr/share/man/cs...
Purging old database entries in /usr/share/man/sk...
Processing manual pages under /usr/share/man/sk...
Purging old database entries in /usr/share/man/sl...
Processing manual pages under /usr/share/man/sl...
Purging old database entries in /usr/share/man/gl...
Processing manual pages under /usr/share/man/gl...
Purging old database entries in /usr/share/man/zh_HK...
Processing manual pages under /usr/share/man/zh_HK...
Purging old database entries in /usr/share/man/io...
Processing manual pages under /usr/share/man/io...
Purging old database entries in /usr/share/man/ca...
Processing manual pages under /usr/share/man/ca...
Purging old database entries in /usr/share/man/he...
Processing manual pages under /usr/share/man/he...
Purging old database entries in /usr/share/man/pt...
Processing manual pages under /usr/share/man/pt...
Purging old database entries in /usr/share/man/cy...
Processing manual pages under /usr/share/man/cy...
Purging old database entries in /usr/share/man/oc...
Processing manual pages under /usr/share/man/oc...
Purging old database entries in /usr/share/man/bs...
Processing manual pages under /usr/share/man/bs...
Purging old database entries in /usr/share/man/ro...
Processing manual pages under /usr/share/man/ro...
Purging old database entries in /usr/share/man/hu...
Processing manual pages under /usr/share/man/hu...
Purging old database entries in /usr/share/man/ce...
Processing manual pages under /usr/share/man/ce...
Purging old database entries in /usr/share/man/ja.UTF-8...
Processing manual pages under /usr/share/man/ja.UTF-8...
Purging old database entries in /usr/share/man/te...
Processing manual pages under /usr/share/man/te...
Purging old database entries in /usr/share/man/ku...
Processing manual pages under /usr/share/man/ku...
Purging old database entries in /usr/share/man/kk...
Processing manual pages under /usr/share/man/kk...
Purging old database entries in /usr/share/man/gd...
Processing manual pages under /usr/share/man/gd...
Purging old database entries in /usr/share/man/id...
Processing manual pages under /usr/share/man/id...
Purging old database entries in /usr/share/man/eo...
Processing manual pages under /usr/share/man/eo...
Purging old database entries in /usr/share/man/pt_BR...
Processing manual pages under /usr/share/man/pt_BR...
Purging old database entries in /usr/share/man/ug...
Processing manual pages under /usr/share/man/ug...
Purging old database entries in /usr/share/man/it...
Processing manual pages under /usr/share/man/it...
Purging old database entries in /usr/share/man/ko...
Processing manual pages under /usr/share/man/ko...
Purging old database entries in /usr/share/man/fr.ISO8859-1...
Processing manual pages under /usr/share/man/fr.ISO8859-1...
Purging old database entries in /usr/share/man/shn...
Processing manual pages under /usr/share/man/shn...
Purging old database entries in /usr/share/man/hy...
Processing manual pages under /usr/share/man/hy...
Purging old database entries in /usr/share/man/mhr...
Processing manual pages under /usr/share/man/mhr...
Purging old database entries in /usr/share/man/se...
Processing manual pages under /usr/share/man/se...
Purging old database entries in /usr/share/man/fr.UTF-8...
Processing manual pages under /usr/share/man/fr.UTF-8...
Purging old database entries in /usr/share/man/de...
Processing manual pages under /usr/share/man/de...
Purging old database entries in /usr/share/man/ca@valencia...
Processing manual pages under /usr/share/man/ca@valencia...
Purging old database entries in /usr/share/man/sq...
Processing manual pages under /usr/share/man/sq...
Purging old database entries in /usr/share/man/nn...
Processing manual pages under /usr/share/man/nn...
Purging old database entries in /usr/share/man/bo...
Processing manual pages under /usr/share/man/bo...
Purging old database entries in /usr/share/man/uk...
Processing manual pages under /usr/share/man/uk...
Purging old database entries in /usr/share/man/eu...
Processing manual pages under /usr/share/man/eu...
Purging old database entries in /usr/share/man/ar...
Processing manual pages under /usr/share/man/ar...
Purging old database entries in /usr/share/man/hr...
Processing manual pages under /usr/share/man/hr...
Purging old database entries in /usr/share/man/vi...
Processing manual pages under /usr/share/man/vi...
Purging old database entries in /usr/share/man/el...
Processing manual pages under /usr/share/man/el...
Purging old database entries in /usr/share/man/zh...
Processing manual pages under /usr/share/man/zh...
Purging old database entries in /usr/share/man/si...
Processing manual pages under /usr/share/man/si...
Purging old database entries in /usr/share/man/uz...
Processing manual pages under /usr/share/man/uz...
Purging old database entries in /usr/share/man/fr_CA...
Processing manual pages under /usr/share/man/fr_CA...
Purging old database entries in /usr/share/man/my...
Processing manual pages under /usr/share/man/my...
Purging old database entries in /usr/share/man/sv...
Processing manual pages under /usr/share/man/sv...
Purging old database entries in /usr/share/man/fo...
Processing manual pages under /usr/share/man/fo...
Purging old database entries in /usr/share/man/nb...
Processing manual pages under /usr/share/man/nb...
Purging old database entries in /usr/share/man/ml...
Processing manual pages under /usr/share/man/ml...
Purging old database entries in /usr/share/man/en_GB...
Processing manual pages under /usr/share/man/en_GB...
Purging old database entries in /usr/share/man/bn...
Processing manual pages under /usr/share/man/bn...
Purging old database entries in /usr/share/man/ast...
Processing manual pages under /usr/share/man/ast...
Purging old database entries in /usr/share/man/ru...
Processing manual pages under /usr/share/man/ru...
Processing manual pages under /usr/local/man...
0 man subdirectories contained newer manual pages.
0 manual pages were added.
0 stray cats were added.
0 old database entries were purged.

答案1

此错误表示多个 mandb 进程同时运行,因此部分缓存更新失败。无法真正知道安装过程的哪个部分对缓存进行了 2 次或多次调用,从而导致失败。

如果担心手册页数据库不完整以下命令将刷新数据库:

sudo mandb

运行此程序可以发现刷新过程的具体过程:

Purging old database entries in /usr/share/man/fr_CA...
Processing manual pages under /usr/share/man/fr_CA...
Purging old database entries in /usr/share/man/sq...
Processing manual pages under /usr/share/man/sq...

然而,如果 mandb 数据库已经变成腐败,这在您提到的情况下不太可能发生,您可以尝试运行更激进的命令:

sudo mandb --create

来自 mandb 的手册页:

-c, --create
    By default, mandb will try  to  update  any  previously  created
    databases. If  a  database  does not exist, it will create it.
    This option forces mandb to delete previous  databases  and  re-
    create  them  from scratch, and implies --no-purge.  This may be
    necessary if a database becomes corrupt or if a new database 
    storage scheme is introduced in the future.

当你运行此命令时,你会看到一个异想天开的开发人员使用了搜索流浪猫的想法来重新创建和重建数据库:

Processing manual pages under /usr/share/man/hr...
Updating index cache for path `/usr/share/man/hr/man1'. Wait...done.
Checking for stray cats under /usr/share/man/hr...
Checking for stray cats under /var/cache/man/hr...

:)

参考:

相关内容