r-base-core не может быть настроен
При попытке установить R на Ubuntu 16.04 xenial, я застрял, потому что r-base-core
не может быть настроен. Я использую общее руководство. После неудачной установки и попытки настройки вручную r-base-core
консоль в основном выглядит так:
~$ sudo dpkg --configure r-base-core
Setting up r-base-core (3.3.2-1xenial0) ...
dpkg: error processing package r-base-core (--configure):
subprocess installed post-installation script returned error exit
status 10
Errors were encountered while processing:
r-base-core
Сценарий после установки r-base-core.postinst
в /var/lib/dpkg/info
содержит следующее:
#!/bin/sh
#
# postinst script for the Debian GNU/Linux r-base-core package
# This version originally written by Douglas Bates <bates@stat.wisc.edu>
# and now written and maintained by Dirk Eddelbuettel <edd@debian.org>
set -e
# Automatically added by dh_installdeb
dpkg-maintscript-helper mv_conffile /etc/bash_completion.d/R /usr/share/bash-completion/completions/R -- "$@"
# End automatically added section
case "$1" in
configure)
# edd 19 Jun 2004 deal with papersize
# edd 22 Jun 2004 make that conditional on paperconf
# edd 25 Oct 2006 rewritten for R 2.4.0 and R_PAPERSIZE_USER
# edd 21 Jun 2008 rewritten for R 2.7.1 and ucf input
# edd 23 Feb 2013 trying to avoid md5sum issues with help from Andy Beckman
# edd 26 Feb 2013 correct mode of temp. Renviron file with help from Don Armstrong
tmpRenviron=$(mktemp)
chmod 0644 "$tmpRenviron"
cat /usr/lib/R/etc/Renviron.ucf > "$tmpRenviron"
#if [ -x /usr/bin/paperconf ]; then
## get the value we want from Debian's paperconf utility
papersize=`paperconf`
## have perl subst. second expression with $papersize for first
## uses the x mod. and curlies to denote the usual s|1st|2nd|
perl -p -i -e "s{^R_PAPERSIZE_USER=\\$\{R_PAPERSIZE\}}
{R_PAPERSIZE_USER=\\$\{R_PAPERSIZE-'$papersize'\}}x" "$tmpRenviron"
#fi
# edd 21 Jun 2008 whether or not Renviron was modified, ucf will handle it,
# so tell ucf that file Renviron.ucf is the source for
# conffile in /etc and register it
ucf "$tmpRenviron" /etc/R/Renviron
ucfr r-base-core /etc/R/Renviron
rm -f "$tmpRenviron"
#
#if [ -x /usr/bin/update-menus ]; then
# update-menus
#fi
# edd 03 Apr 2003 cf Section 10.1.2 of Debian Policy
if [ ! -e /usr/local/lib/R ]; then
if mkdir /usr/local/lib/R 2>/dev/null; then
chown root:staff /usr/local/lib/R
chmod 2775 /usr/local/lib/R
fi
fi
if [ ! -e /usr/local/lib/R/site-library ]; then
if mkdir /usr/local/lib/R/site-library 2>/dev/null; then
chown root:staff /usr/local/lib/R/site-library
chmod 2775 /usr/local/lib/R/site-library
fi
fi
#if [ -x /usr/bin/mktexlsr ]; then
# mktexlsr /usr/share/texmf
#fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
;;
esac
Я уже пытался удалить сценарий постинсталляции, чтобы приведенная выше конфигурация работала без ошибок, и фактически можно установить r-base. Однако при наборе R
в консоли это выглядит так:
cannot find system Renviron
R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
Error : .onLoad failed in loadNamespace() for 'utils', details:
call: options(op.utils[toset])
error: invalid value for 'editor'
Error : .onLoad failed in loadNamespace() for 'utils', details:
call: options(op.utils[toset])
error: invalid value for 'editor'
In addition: Warning message:
package ‘utils’ in options("defaultPackages") was not found
During startup - Warning message:
package ‘stats’ in options("defaultPackages") was not found
Установка переменной окружения так не меняет ничего:
export R_HOME=/usr/lib/R/
Содержимое установочной папки R:
~$ ls -l /etc/R
total 40
-rw-r--r-- 1 root root 793 Nov 1 11:45 ldpaths
-rw-r--r-- 1 root root 784 Apr 24 2016 ldpaths.dpkg-old
-rw-r--r-- 1 root root 6304 Nov 1 11:45 Makeconf
-rw-r--r-- 1 root root 6354 Apr 24 2016 Makeconf.dpkg-old
-rw-r--r-- 1 root root 608 Apr 24 2016 Renviron.site
-rw-r--r-- 1 root root 1161 Nov 1 11:45 repositories
-rw-r--r-- 1 root root 1424 Apr 24 2016 repositories.dpkg-old
-rw-r--r-- 1 root root 792 Apr 24 2016 Rprofile.site
Очевидно, что скрипт постинсталляции завершается ошибкой, когда ucf должен что-то делать. При добавлении -x
Аргумент к сценарию после установки:
Setting up r-base-core (3.3.2-1xenial0) ...
+ dpkg-maintscript-helper mv_conffile /etc/bash_completion.d/R /usr/share/bash-completion/completions/R -- configure
+ mktemp
+ tmpRenviron=/tmp/tmp.MANJybxXxQ
+ chmod 0644 /tmp/tmp.MANJybxXxQ
+ cat /usr/lib/R/etc/Renviron.ucf
+ paperconf
+ papersize=a4
+ perl -p -i -e s{^R_PAPERSIZE_USER=\$\{R_PAPERSIZE\}}
{R_PAPERSIZE_USER=\$\{R_PAPERSIZE-'a4'\}}x /tmp/tmp.MANJybxXxQ
+ ucf /tmp/tmp.MANJybxXxQ /etc/R/Renviron
dpkg: error processing package r-base-core (--configure):
subprocess installed post-installation script returned error exit status 10
Основываясь на других сообщениях, которые я нашел в Интернете о проблемах с ucf в сценариях постустановки, я добавил уровень отладки 3 в строку ucf в сценарии установки. Вот как выглядит консоль сейчас:
+ dpkg-maintscript-helper mv_conffile /etc/bash_completion.d/R /usr/share/bash-completion/completions/R -- configure
+ mktemp
+ tmpRenviron=/tmp/tmp.LsP3FSBIRI
+ chmod 0644 /tmp/tmp.LsP3FSBIRI
+ cat /usr/lib/R/etc/Renviron.ucf
+ paperconf
+ papersize=a4
+ perl -p -i -e s{^R_PAPERSIZE_USER=\$\{R_PAPERSIZE\}}
{R_PAPERSIZE_USER=\$\{R_PAPERSIZE-'a4'\}}x /tmp/tmp.LsP3FSBIRI
+ ucf --debug=3 /tmp/tmp.LsP3FSBIRI /etc/R/Renviron
The new start file is `/tmp/tmp.LsP3FSBIRI\'
The destination is `/etc/R/Renviron\' (`\/etc\/R\/Renviron\')
The history is kept under \'/tmp\'
The file may be cached at \'/var/lib/ucf/cache/:etc:R:Renviron\'
The destination file does not exist.
The old md5sum does not exist.
The new file exists, and has md5sum:
7c899e0d9d42df33d5dfd303ef43c46b /tmp/tmp.LsP3FSBIRI
Historical md5sums are not available
The new start file is `/tmp/tmp.LsP3FSBIRI\'
The destination is `/etc/R/Renviron\' (`\/etc\/R\/Renviron\')
The history is kept under \'/tmp\'
The file may be cached at \'/var/lib/ucf/cache/:etc:R:Renviron\'
dpkg: error processing package r-base-core (--configure):
subprocess installed post-installation script returned error exit status 20