安装后脚本退出错误 10:ucf 失败

安装后脚本退出错误 10:ucf 失败

当我尝试在 Ubuntu 16.04 xenial 上安装 R 时,我卡住了,因为r-base-core无法配置。我正在使用通用手册。显然,当 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 问题的其他帖子,我在安装后脚本中的 ucf 行中添加了调试级别 3。控制台现在如下所示:

+ 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

我不知道接下来该去哪里。

总结:我似乎遇到了与讨论过的类似的问题这里,但解决方案不起作用。命令

sudo apt-get --reinstall install r-base-core

返回

E: Internal Error, No file name for r-base-core:amd64

和命令

sudo sed -i 's/\tucf/\t#ucf/' /var/lib/dpkg/info/r-base-core.postinst
sudo apt-get -f install

结果与往常一样

subprocess installed post-installation script returned error exit status 10

答案1

我在 Ubuntu 20.04 上遇到了同样的情况(使用不同的软件包,但ucf问题的根源在于——事实上,它似乎ucf无法访问自己的debconf配置)。

这对我有用:

sudo apt --reinstall install ucf

看起来ucf安装已经因某种原因被损坏了。

相关内容