KITA Eng.

北海道でサーバー技術者として歩み出したひとが綴るblog。

"r-base-core.postinst: mktexlsr: not found"ってオコラレタ。

いつものごとくパッケージのアップデートをしようとしたら、以下のように怒られました。

Preparing to unpack .../r-base-core_3.2.3-3trusty0_amd64.deb ...
Unpacking r-base-core (3.2.3-3trusty0) over (3.2.3-1trusty0) ...
Preparing to unpack .../r-base_3.2.3-3trusty0_all.deb ...
Unpacking r-base (3.2.3-3trusty0) over (3.2.3-1trusty0) ...
Preparing to unpack .../r-recommended_3.2.3-3trusty0_all.deb ...
Unpacking r-recommended (3.2.3-3trusty0) over (3.2.3-1trusty0) ...
Preparing to unpack .../r-base-dev_3.2.3-3trusty0_all.deb ...
Unpacking r-base-dev (3.2.3-3trusty0) over (3.2.3-1trusty0) ...
Preparing to unpack .../r-doc-html_3.2.3-3trusty0_all.deb ...
Unpacking r-doc-html (3.2.3-3trusty0) over (3.2.3-1trusty0) ...
Preparing to unpack .../r-base-html_3.2.3-3trusty0_all.deb ...
Unpacking r-base-html (3.2.3-3trusty0) over (3.2.3-1trusty0) ...
Setting up r-base-core (3.2.3-3trusty0) ...
/var/lib/dpkg/info/r-base-core.postinst: 57:
/var/lib/dpkg/info/r-base-core.postinst: mktexlsr: not found
dpkg: error processing package r-base-core (--configure):
 subprocess installed post-installation script returned error exit status 127
dpkg: dependency problems prevent configuration of r-recommended:
 r-recommended depends on r-base-core (>= 3.2.3-3trusty0); however:
  Package r-base-core is not configured yet.

dpkg: error processing package r-recommended (--configure):
 dependency problems - leaving unconfigured
 dpkg: dependency problems prevent configuration of r-base:
 r-base depends on r-base-core (>= 3.2.3-3trusty0); however:
  Package r-base-core is not configured yet.
 r-base depends on r-recommended (= 3.2.3-3trusty0); however:
  Package r-recommended is not configured yet.

dpkg: error processing package r-base (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of r-base-dev:
 r-base-dev depends on r-base-core (>= 3.2.3-3trusty0); however:
  Package r-base-core is not configured yet.

dpkg: error processing package r-base-dev (--configure):
 dependency problems - leaving unconfigured
Setting up r-doc-html (3.2.3-3trusty0) ...
dpkg: dependency problems prevent configuration of r-base-html:
 r-base-html depends on r-base-core; however:
  Package r-base-core is not configured yet.

dpkg: error processing package r-base-html (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 r-base-core
 r-recommended
 r-base
 r-base-dev
 r-base-html
E: Sub-process /usr/bin/dpkg returned an error code (1)

何事か?

とりあえずエラーメッセジをよく読めば何とかなるだろう精神で読んでみました。ざっと全体見通すと、どうやら一番最初にアップデートが走った、「r-base-core (3.2.3-3trusty0) 」がうまくいかなかったのが、どうやら以降の関係パッケージ群のアップデートに影響したっぽいです。

ということで、一番最初にアップデートが走った。「r-base-core (3.2.3-3trusty0)」のところについてもう少しよく見てみます。

Setting up r-base-core (3.2.3-3trusty0) ...
/var/lib/dpkg/info/r-base-core.postinst: 57:
/var/lib/dpkg/info/r-base-core.postinst: mktexlsr: not found

と言ってます。「/var/lib/dpkg/info/r-base-core.postinst」ってファイルの57行目で止まったらしく、「mktexlsr」ってのが見つからなかったらしいです。さらっとググると、なにやらTeXに関わるツールなんだとか。確かに入れた覚えはありません。

イマイチまだよく分からないので、「/var/lib/dpkg/info/r-base-core.postinst」を開いて、57行目を見てみることにします。

/var/lib/dpkg/info/r-base-core.postinst

  56     #if [ -x /usr/bin/mktexlsr ]; then
  57       mktexlsr /usr/share/texmf
  58     #fi

なんと、「mktexlsr」が実行可能かどうかの判定の部分だけコメントアウトされています……。

とりあえずの対処

いったいどういう経緯で上記の様な微妙なコメントアウトがされているのかは、謎ですが、とかく「mktexlsr」なんぞうちの環境にはないし、なかったらどうこうするみたいなことも書かれてないので、無くてもきっと良いんだろうと前向きにとらえてみることにしました。

ということで、コメントアウトされていない57行目もコメントアウトしてみます。

/var/lib/dpkg/info/r-base-core.postinst (改)

  56     #if [ -x /usr/bin/mktexlsr ]; then
  57     #  mktexlsr /usr/share/texmf
  58     #fi

と、これでもう一度、sudo apt-get upgradeしてみましたら、うまくいきました。果たしてきちんと全ての機能が動くのかは検証できていないので謎ですが、ざっくりは動いているようです。

はたして、本当にこれで良いのか……。

なんかバグなのかも?

なにやら、debian-bugs-dist@lists.debian.orgなるメーリングリスト!?に報告が上がっている模様です。
All mail regarding bugs in the Debian system is copied to this mailing list 細かいことは、これの続報を見守ることにしてみましょう。

2016.01.15 19:43 追記

やはり、バグだった模様です。
#810963 - r-base-core: postinst error: needs mktexlsr from texlive-binaries - Debian Bug report logsでやり取りがされていますが、修正が入ったようです。3.2.3-3 --> 3.2.3-4と変わったようです。

Thanks for the note, but I am aware -- and actually fixed that last evening:

r-base (3.2.3-4) unstable; urgency=low

  • debian/r-base-core.postinst: Don't run mktexlsr

-- Dirk Eddelbuettel edd@debian.org Wed, 13 Jan 2016 22:14:27 -0600

"Don't run mktexlsr"って言ってるんで、やっぱり、コメントアウトしちゃってよかったぽいです。

ってことで、改めて、先ほどアップデートしてみましたら、

Preparing to unpack .../r-base-core_3.2.3-4trusty0_amd64.deb ...
Unpacking r-base-core (3.2.3-4trusty0) over (3.2.3-3trusty0) ...
Preparing to unpack .../r-base_3.2.3-4trusty0_all.deb ...
Unpacking r-base (3.2.3-4trusty0) over (3.2.3-3trusty0) ...
Preparing to unpack .../r-recommended_3.2.3-4trusty0_all.deb ...
Unpacking r-recommended (3.2.3-4trusty0) over (3.2.3-3trusty0) ...
Preparing to unpack .../r-base-dev_3.2.3-4trusty0_all.deb ...
Unpacking r-base-dev (3.2.3-4trusty0) over (3.2.3-3trusty0) ...
Preparing to unpack .../r-doc-html_3.2.3-4trusty0_all.deb ...
Unpacking r-doc-html (3.2.3-4trusty0) over (3.2.3-3trusty0) ...
Preparing to unpack .../r-base-html_3.2.3-4trusty0_all.deb ...
Unpacking r-base-html (3.2.3-4trusty0) over (3.2.3-3trusty0) ...

Setting up r-base-core (3.2.3-4trusty0) ...
Replacing config file /etc/R/Renviron with new version
Setting up r-recommended (3.2.3-4trusty0) ...
Setting up r-base (3.2.3-4trusty0) ...
Setting up r-base-dev (3.2.3-4trusty0) ...
Setting up r-doc-html (3.2.3-4trusty0) ...
Setting up r-base-html (3.2.3-4trusty0) ...

ってな具合で、特に何事もなく更新されました。めでたしめでたし。