dpkg:依赖性问题阻止在 ubuntu 20.4 中删除 r-base-core

dpkg:依赖性问题阻止在 ubuntu 20.4 中删除 r-base-core

我曾尝试从源代码安装 R 新版本,但没有成功。因此我卸载了 R,然后使用 amd64 重新安装了 R。

当我运行时,R 仍然没有工作:

$which R 
command not found  

我正在尝试在重新安装之前清理所有文件。

$dpkg -l | grep r-base-core  
r-base-core 4.3.2-1.2004.0   amd64   GNU R core of statistical computation and graphics system. 

所以我知道还有文件剩余。这就是我接下来尝试强制删除文件的操作。

apt-get install --fix-broken

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.
~$ sudo apt-get update

Reading package lists... Done
E: The repository 'https://nvidia.github.io/libnvidia-container/stable/ubuntu20.04/amd64  Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
:~$ sudo apt-get upgrade
sudo: unable to resolve host : No address associated with hostname
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  
11 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$ sudo dpkg --remove --force-remove-reinstreq r-base-core

dpkg: dependency problems prevent removal of r-base-core:

 r-recommended depends on r-base-core (>= 4.3.2-1.2004.0).
 r-cran-withr depends on r-base-core.
 r-cran-viridislite depends on r-base-core.
 r-cran-vctrs depends on r-base-core.
 r-cran-utf8 depends on r-base-core.
 r-cran-tibble depends on r-base-core.
 r-cran-systemfonts depends on r-base-core.
 r-cran-svglite depends on r-base-core.
 r-cran-survival depends on r-base-core.
 r-cran-stanheaders depends on r-base-core.
 r-cran-spatial depends on r-base-core.
 r-cran-scales depends on r-base-core.
 r-cran-rstan depends on r-base-core.
 r-cran-rpart depends on r-base-core.
 r-cran-rlang depends on r-base-core.
 r-cran-rcppparallel depends on r-base-core.
 r-cran-rcppeigen depends on r-base-core.
 r-cran-rcpp depends on r-base-core.
 r-cran-rcolorbrewer depends on r-base-core.
 r-cran-r6 depends on r-base-core.
 r-cran-quickjsr depends on r-base-core.
 r-cran-ps depends on r-base-core.
 r-cran-processx depends on r-base-core.
 r-cran-pkgconfig depends on r-base-core (>= 3.6.3.20200416-1.2004.0).
 r-cran-pkgconfig 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 to be removed.
 r-cran-pkgbuild depends on r-base-core.
 r-cran-pillar depends on r-base-core.
 r-cran-nnet depends on r-base-core (>= 4.3.1-1.2004.0).
 r-cran-nnet 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 to be removed.
 r-cran-nlme depends on r-base-core (>= 4.3.1-4.2004.0).
 r-cran-nlme 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 to be removed.
 r-cran-munsell depends on r-base-core (>= 3.6.3.20200416-1.2004.0).
 r-cran-munsell 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 to be removed.
 r-cran-mgcv depends on r-base-core (>= 4.3.2-1.2004.0).
 r-cran-mgcv 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 to be removed.
 r-cran-matrixstats depends on r-base-core.
 r-cran-matrix depends on r-base-core.
 r-cran-mass depends on r-base-core (>= 4.3.1-1.2004.0).
 r-cran-mass 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 to be removed.
 r-cran-magrittr depends on r-base-core.
 r-cran-loo depends on r-base-core.
 r-cran-lifecycle depends on r-base-core.
 r-cran-lattice depends on r-base-core (>= 4.3.1-4.2004.0).
 r-cran-lattice 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 to be removed.
 r-cran-labeling depends on r-base-core.
 r-cran-kernsmooth depends on r-base-core.
 r-cran-jsonlite depends on r-base-core.
 r-cran-isoband depends on r-base-core.
 r-cran-inline depends on r-base-core.
 r-cran-gtable depends on r-base-core.
 r-cran-gridextra depends on r-base-core (>= 3.6.3.20200416-1.2004.0).
 r-cran-gridextra 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 to be removed.
 r-cran-glue depends on r-base-core.
 r-cran-ggplot2 depends on r-base-core.
 r-cran-foreign depends on r-base-core (>= 4.3.2-1.2004.0).
 r-cran-foreign 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 to be removed.
 r-cran-farver depends on r-base-core.
 r-cran-fansi depends on r-base-core.
 r-cran-desc depends on r-base-core.
 r-cran-cpp11 depends on r-base-core.
 r-cran-colorspace depends on r-base-core.
 r-cran-codetools depends on r-base-core.
 r-cran-cluster depends on r-base-core (>= 4.3.2-1.2004.0).
 r-cran-cluster 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 to be removed.
 r-cran-cli depends on r-base-core.
 r-cran-class depends on r-base-core (>= 4.3.1-1.2004.0).
 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 to be removed.
 r-cran-checkmate depends on r-base-core.
 r-cran-callr depends on r-base-core.
 r-cran-boot depends on r-base-core.
 r-cran-bh depends on r-base-core.
 r-cran-backports depends on r-base-core.
 r-base-html depends on r-base-core.
 r-cran-pkgconfig depends on r-base-core (>= 3.6.3.20200416-1.2004.0).
 r-cran-pkgconfig 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 to be removed.
 r-cran-nnet depends on r-base-core (>= 4.3.1-1.2004.0).
 r-cran-nnet 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 to be removed.
 r-cran-nlme depends on r-base-core (>= 4.3.1-4.2004.0).
 r-cran-nlme 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 to be removed.
 r-cran-munsell depends on r-base-core (>= 3.6.3.20200416-1.2004.0).
 r-cran-munsell 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 to be removed.
 r-cran-mgcv depends on r-base-core (>= 4.3.2-1.2004.0).
 r-cran-mgcv 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 to be removed.
 r-cran-mass depends on r-base-core (>= 4.3.1-1.2004.0).
 r-cran-mass 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 to be removed.
 r-cran-lattice depends on r-base-core (>= 4.3.1-4.2004.0).
 r-cran-lattice 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 to be removed.
 r-cran-gridextra depends on r-base-core (>= 3.6.3.20200416-1.2004.0).
 r-cran-gridextra 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 to be removed.
 r-cran-foreign depends on r-base-core (>= 4.3.2-1.2004.0).
 r-cran-foreign 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 to be removed.
 r-cran-cluster depends on r-base-core (>= 4.3.2-1.2004.0).
 r-cran-cluster 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 to be removed.
 r-cran-class depends on r-base-core (>= 4.3.1-1.2004.0).
 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 to be removed.

dpkg: error processing package r-base-core (--remove):
 dependency problems - not removing
Errors were encountered while processing:
 r-base-core

~$ apt-cache depends r-base-core | grep Depends
  Depends: zip
  Depends: unzip
  Depends: libpaper-utils
  Depends: xdg-utils
 |Depends: libblas3
  Depends: <libblas.so.3>
  Depends: libbz2-1.0
  Depends: libc6
  Depends: libcairo2
  Depends: libcurl4
  Depends: libglib2.0-0
  Depends: libgomp1
  Depends: libicu66
  Depends: libjpeg8
 |Depends: liblapack3
  Depends: <liblapack.so.3>
  Depends: liblzma5
  Depends: libpango-1.0-0
  Depends: libpangocairo-1.0-0
  Depends: libpcre2-8-0
  Depends: libpng16-16
  Depends: libreadline8
  Depends: libtcl8.6
  Depends: libtiff5
  Depends: libtk8.6
  Depends: libx11-6
  Depends: libxt6
  Depends: zlib1g
  Depends: ucf
  Depends: ca-certificates

在此级别,我无法强制删除 R 基础核心文件。有人知道如何解决这个问题并启用 R 的安全安装吗?

答案1

您有 3 个错误:

  1. nvidia repo 设置不正确。
  2. sudo错误:sudo: unable to resolve host : No address associated with hostname
  3. 构建时的依赖问题r

  1. 设置nvidia 存储库

删除现有的 repo (注释 URL):

sudo sed -e '/libnvidia-container/s/^/#/' -i /etc/apt/sources.list{.d/*,}

设置存储库:

curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg 
echo "deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://nvidia.github.io/libnvidia-container/stable/deb/$(ARCH) /" | 
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list

2 解决sudo错误:

echo -e "127.0.0.1\tlocalhost" |sudo tee -a /etc/hosts
  1. 解决缺失的依赖关系:

正如r文档,有时你需要启用反向移植才能r正确构建:

安装和编译 R 或它的某些软件包可能需要来自“backports”存储库的 Ubuntu 软件包。因此,建议使用类似以下条目激活 backports 存储库 deb https://<my.favorite.ubuntu.mirror>/ focal-backports main restricted universe

echo "deb http://cz.archive.ubuntu.com/ubuntu focal-backports main restricted universe" |
sudo tee /etc/apt/sources.list.d/backports.list
sudo apt update

相关内容