AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1367607
Accepted
N0rbert
N0rbert
Asked: 2021-10-06 11:49:58 +0800 CST2021-10-06 11:49:58 +0800 CST 2021-10-06 11:49:58 +0800 CST

在将带有 R 的 Ubuntu 16.04 LTS 从 CRAN 升级到 Ubuntu 18.04 LTS 时,是否可以防止 R 包冲突?

  • 772

我已经完全更新了为 RMarkdown/bookdown 配置的 Ubuntu 16.04.7 LTS amd64,使用以下命令进行 LaTeX 发布:

sudo apt-get install apt-transport-https

cat <<EOF | sudo tee /etc/apt/sources.list.d/r-cran.list
deb https://cloud.r-project.org/bin/linux/ubuntu xenial/
EOF
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

sudo apt-get update

sudo apt-get install -y r-base-dev libssl-dev libjpeg62 libgstreamer0.10-0 libgstreamer-plugins-base0.10-0 calibre
sudo apt-get install -y biber texlive-lang-cyrillic fonts-cmu texlive-xetex texlive-fonts-extra texlive-math-extra font-manager ttf-mscorefonts-installer lmodern
sudo apt-get install -y build-essential libcurl4-openssl-dev libxml2-dev libcairo2-dev git

wget https://github.com/jgm/pandoc/releases/download/2.11.4/pandoc-2.11.4-1-amd64.deb -O /tmp/pandoc.deb
sudo apt-get install -y /tmp/pandoc.deb

wget -c https://download1.rstudio.org/desktop/xenial/amd64/rstudio-1.4.1106-amd64.deb -O /tmp/rstudio.deb
sudo apt-get install -y /tmp/rstudio.deb

mkdir -p ~/R/x86_64-pc-linux-gnu-library/3.4
R -e "install.packages(c('bookdown','tikzDevice','xaringan'), repos='http://cran.rstudio.com/', lib='/home/$USER/R/x86_64-pc-linux-gnu-library/3.4')"

这意味着它/etc/apt/sources.list /etc/apt/sources.list.d/*.list包含以下几行:

$ grep ^deb -r /etc/apt/ --include=*.list
/etc/apt/sources.list.d/r-cran.list:deb https://cloud.r-project.org/bin/linux/ubuntu xenial/
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu/ xenial main restricted
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu/ xenial universe
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu/ xenial-updates universe
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu/ xenial multiverse
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu/ xenial-updates multiverse
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu xenial-security main restricted
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu xenial-security universe
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu xenial-security multiverse

该系统具有以下一组 R 包:

$ dpkg -l | grep "^ii  r-"
ii  r-base                                3.4.4-1xenial0                                  all          GNU R statistical computation and graphics system
ii  r-base-core                           3.4.4-1xenial0                                  amd64        GNU R core of statistical computation and graphics system
ii  r-base-dev                            3.4.4-1xenial0                                  all          GNU R installation of auxiliary GNU R packages
ii  r-base-html                           3.4.4-1xenial0                                  all          GNU R html docs for statistical computing system functions
ii  r-cran-boot                           1.3-20-1xenial0                                 all          GNU R package for bootstrapping functions from Davison and Hinkley
ii  r-cran-class                          7.3-14-2xenial0                                 amd64        GNU R package for classification
ii  r-cran-cluster                        2.0.7-1-1xenial0                                amd64        GNU R package for cluster analysis by Rousseeuw et al
ii  r-cran-codetools                      0.2-15-1cran1xenial0                            all          GNU R package "Code Analysis Tools for R"
ii  r-cran-foreign                        0.8.70-1xenial0                                 amd64        GNU R package to read/write data from other stat. systems
ii  r-cran-kernsmooth                     2.23-15-3xenial0                                amd64        GNU R package for kernel smoothing and density estimation
ii  r-cran-lattice                        0.20-38-1cran1xenial0                           amd64        GNU R package "Trellis Graphics for R"
ii  r-cran-mass                           7.3-50-1xenial0                                 amd64        GNU R package of Venables and Ripley's MASS
ii  r-cran-matrix                         1.2-14-1xenial0                                 amd64        GNU R package of classes for dense and sparse matrices
ii  r-cran-mgcv                           1.8-28-1cran1xenial0                            amd64        GNU R package "Mixed GAM Computation Vehicle with
ii  r-cran-nlme                           3.1.137-1xenial0                                amd64        GNU R package for (non-)linear mixed effects models
ii  r-cran-nnet                           7.3-12-2xenial0                                 amd64        GNU R package for feed-forward neural networks
ii  r-cran-rpart                          4.1-15-1cran1xenial0                            amd64        GNU R package "Recursive Partitioning and Regression
ii  r-cran-spatial                        7.3-11-1xenial0                                 amd64        GNU R package for spatial statistics
ii  r-cran-survival                       2.44-1.1-1cran1xenial0                          amd64        GNU R package "Survival Analysis"
ii  r-doc-html                            3.4.4-1xenial0                                  all          GNU R html manuals for statistical computing system
ii  r-recommended                         3.4.4-1xenial0                                  all          GNU R collection of recommended packages [metapackage]

根据以前的经验,我知道一些 R 包比 Ubuntu 18.04.6 LTS 官方存储库中的版本更新。

在这种情况下,我应该如何将此 Ubuntu 16.04.7 LTS 正确升级到 Ubuntu 18.04.6 LTS?

16.04
  • 1 1 个回答
  • 194 Views

1 个回答

  • Voted
  1. Best Answer
    N0rbert
    2021-10-06T11:49:58+08:002021-10-06T11:49:58+08:00

    要从 Ubuntu 16.04.7 LTS 和 CRAN 的 R 3.4 完美运行升级过程,应该执行以下操作:

    1. 备份已安装 R 包的列表

      dpkg -l | grep "^ii  r-" | awk '{print $2}' > ~/r-debs.txt
      
    2. 删除 CRAN r-cran.listAPT 源文件

      sudo rm /etc/apt/sources.list.d/r-cran.list
      
    3. 删除 R 包

      sudo apt-get autoremove $(cat r-debs.txt) --purge
      
    4. 使用来自官方存储库的版本重新安装 R 包

      sudo apt-get install $(cat r-debs.txt)
      
    5. 安装可能的更新

      sudo apt-get update
      sudo apt-get dist-upgrade
      

      然后重新启动。

    6. sudo do-release-upgrade使用或像往常一样升级 Ubuntu update-manager -c。

    7. 使用以下命令升级 RStudio:

      wget -c https://download1.rstudio.org/desktop/bionic/amd64/rstudio-1.4.1717-amd64.deb -O /tmp/rstudio.deb
      sudo apt-get install -y /tmp/rstudio.deb
      

    由此产生的 Ubuntu 18.04.6 LTS 系统将具有来自官方存储库的全功能 R 3.4。

    • 1

相关问题

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve