我只是想通过 CRAN 安装 R,但出了点问题。无论我怎么尝试,都无法安装、删除或重新安装任何软件包。我以为 dpkg 坏了,但我重新安装 dpkg 的尝试失败了。
这是我的代码和错误消息。
sudo apt update
Hit:1 http://kr.archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Hit:3 http://cloud.r-project.org/bin/linux/ubuntu xenial-cran40/ InRelease
Hit:4 http://ppa.launchpad.net/createsc/3beol/ubuntu xenial InRelease
Hit:5 http://kr.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:6 http://kr.archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:7 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease
Fetched 109 kB in 5s (19.3 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
sudo apt upgrade
Setting up php7.2-common (7.2.34-10+ubuntu16.04.1+deb.sury.org+1) ...
dpkg: error processing package php7.2-common (--configure):
subprocess installed post-installation script returned error exit status 10
Setting up php5.6-common (5.6.40-40+ubuntu16.04.1+deb.sury.org+1) ...
dpkg: error processing package php5.6-common (--configure):
subprocess installed post-installation script returned error exit status 10
Setting up grub-pc (2.02~beta2-36ubuntu3.29) ...
dpkg: error processing package grub-pc (--configure):
subprocess installed post-installation script returned error exit status 10
Setting up nfs-common (1:1.2.8-9ubuntu12.3) ...
dpkg: error processing package nfs-common (--configure):
subprocess installed post-installation script returned error exit status 10
Setting up xserver-xorg-input-synaptics-hwe-16.04 (1.9.0-1ubuntu1~16.04.1) ...
dpkg: dependency problems prevent configuration of php5.6:
php5.6 depends on php5.6-common; however:
Package php5.6-common is not configured yet.
dpkg: error processing package php5.6 (--configure):
dependency problems - leaving unconfigured
Setting up r-base-core (4.0.3-1.1604.1) ...
dpkg: error processing package r-base-core (--configure):
subprocess installed post-installation script returned error exit status 10
dpkg: dependency problems prevent configuration of r-cran-class:
r-cran-class depends on r-base-core (>= 4.0.3-1.1604.1); however:
Package r-base-core is not configured yet.
r-cran-class depends on r-api-4.0; however:
Package r-api-4.0 is not installed.
Package r-base-core which provides r-api-4.0 is not configured yet.
.
.
.
dpkg: error processing package php5.6-curl (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php5.6-opcache:
php5.6-opcache depends on php5.6-common (= 5.6.40-40+ubuntu16.04.1+deb.sury.org+1); however:
Package php5.6-common is not configured yet.
dpkg: error processing package php5.6-opcache (--configure):
dependency problems - leaving unconfigured
dpkg: too many errors, stopping
Errors were encountered while processing:
php7.2-common
php5.6-common
grub-pc
nfs-common
php5.6
r-base-core
r-cran-class
samba-common
r-cran-kernsmooth
r-cran-nnet
nfs-kernel-server
r-base-dev
autofs
php5.6-readline
php7.2-readline
php7.2
r-cran-mgcv
php7.2-cli
r-cran-rpart
r-base-html
r-cran-spatial
php5.6-xml
unattended-upgrades
php5.6-cli
php8.0-common
r-base
php5.6-mbstring
php7.2-json
r-cran-mass
r-cran-survival
samba
php7.0-common
libapache2-mod-php5.6
libapache2-mod-php7.2
php7.0-xml
samba-common-bin
php7.0-intl
rsyslog
r-cran-cluster
php7.2-opcache
php7.0-mysql
r-cran-boot
php7.0-ldap
r-recommended
php7.0-readline
autofs5
php7.0-opcache
r-cran-codetools
r-cran-matrix
php5.6-curl
php5.6-opcache
Processing was halted because there were too many errors.
我已经尝试过这个:
sudo reboot # Nothing happened
sudo dpkg --configure -a # Nothing happened
sudo apt-get autoclean # Nothing happened
sudo apt-get autoremove -f # Same error
sudo apt-get install --reinstall dpkg # Same error
sudo apt-get install php7.1-common # Same error
sudo apt purge php7.1-common # Same error
sudo apt --fix-broken install # Same error
现在我不知道该怎么办了。有什么新主意可以推荐吗?请
- 编辑
查看我的 /var/log/apt/history :这是此错误发生之前我最近的成功安装。
Start-Date: 2020-09-18 10:55:29 Commandline: apt-get install dos2unix Install: dos2unix:amd64 (6.0.4-1) End-Date: 2020-09-18 10:55:30
那么有问题的历史是这样的
Start-Date: 2021-02-09 15:21:44
Commandline: apt-get upgrade
Upgrade: ca-certificates-java:amd64 (20160321, 20160321ubuntu1), libpam0g:amd64 (1.1.8-3.2ubuntu2, 1.1.8-3.2ubuntu2.3), debconf:amd64 (1.5.58ubuntu1,
...(lots of lines)...
1.12.0-1~ubuntu16.04.3), libslang2:amd64 (2.3.0-2ubuntu1, 2.3.0-2ubuntu1.1)
Error: Sub-process /usr/bin/dpkg returned an error code (1)
End-Date: 2021-02-09 15:22:00
++ 编辑从 term.log 来看,处理时遇到错误:
php7.1-common
php5.6-common
grub-pc
nfs-common
php5.6
r-base-core
gdm3
r-cran-class
php7.1-mbstring
samba-common
r-cran-nnet
nfs-kernel-server
autofs
php7.1-xml
php5.6-readline
r-cran-rpart
r-cran-spatial
php5.6-xml
unattended-upgrades
php5.6-cli
php5.6-mbstring
r-cran-mass
samba
libapache2-mod-php5.6
samba-common-bin
rsyslog
r-cran-cluster
r-recommended
autofs5
r-cran-codetools
r-cran-matrix
php5.6-curl
php5.6-opcache
php5.6-mysql
php5.6-json
r-cran-nlme
r-cran-foreign
所以我删除了所有程序并重新安装。现在它似乎可以正常工作了(至少目前如此)
但是,我收到了很多这样的 [dpkg: warning] 列表:
Selecting previously unselected package r-base.
(Reading database ...
dpkg: warning: files list file for package 'fonts-sil-abyssinica' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libatk-adaptor:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'x11proto-fonts-dev' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'tigr-glimmer' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxkbfile1:amd64' missing; assuming package has no files currently installed