0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ubuntuに特定のRバージョン4.4.1をインストールしたい

Posted at
  • 特定のRバージョンのインストール方法を以下に記載してます

1. すでに入っているRが入っている場合のそのバージョンを確認

dpkg -l | grep r-base

そしたら入っている場合は以下のような結果が返ってきます

dpkg -l | grep r-recomm
ii  libgcr-base-3-1:amd64                         3.41.2-1build3                           amd64        Library for Crypto related tasks
ii  r-base                                        4.4.1-3.2404.0                           all          GNU R statistical computation and graphics system
ii  r-base-core                                   4.4.2-1.2404.0                           amd64        GNU R core of statistical computation and graphics system
ii  r-base-html                                   4.4.2-1.2404.0                           all          GNU R html docs for statistical computing system functions
ii  r-recommended                                 4.4.1-3.2404.0                           all          GNU R collection of recommended packages [metapackage]

今回はこの4.4.2を4.4.1にダウングレードしていきいます。

2. 不要なバージョンの削除

  • 今回は4.4.2は不必要であり4.4.1にダウングレードしていくので、不要な4.4.2のRとそのパッケージは削除します
  • r-base-coreをアンインストールしたら自動的にr-base-htmlも削除されました
  • ちなみにこのステップはスキップしても新たなバージョンをインストールする際にもとのバージョンは上書きされるため、自動的に削除されます
sudo apt remove r-base-core
  • 他にも削除したいバージョンのものはsudo apt remove ***で削除できます

3. aptのインストール可能なバージョンをリストアップ

apt policy r-base-core

そうするとこのような結果が返ってきます

r-base-core:
  Installed: (none)
  Candidate: 4.4.2-1.2404.0
  Version table:
     4.4.2-1.2404.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu noble-cran40/ Packages
        100 /var/lib/dpkg/status
     4.4.1-3.2404.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu noble-cran40/ Packages
     4.4.1-1.2404.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu noble-cran40/ Packages
     4.4.0-2.2404.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu noble-cran40/ Packages
     4.3.3-2build2 500
        500 http://jp.archive.ubuntu.com/ubuntu noble/universe amd64 Packages

4. 特定のバージョンのインストール

  • ステップ3でリストアップしたものから自分のほしいバージョンを指定して、インストールします
sudo apt-get install r-base-core=4.4.1-3.2404.0 r-recommended=4.4.1-3.2404.0

5. 確認&完了!

もう一度dpkg -l | grep r-baseをすると無事r-base-coreとr-base-devが4.4.1になっているのを確認できました!

ii  libgcr-base-3-1:amd64                         3.41.2-1build3                           amd64        Library for Crypto related tasks
ii  r-base                                        4.4.1-3.2404.0                           all          GNU R statistical computation and graphics system
ii  r-base-core                                   4.4.1-3.2404.0                           amd64        GNU R core of statistical computation and graphics system
ii  r-base-dev                                    4.4.1-3.2404.0                           all          GNU R installation of auxiliary GNU R packages
ii  r-base-html                                   4.4.1-3.2404.0                           all          GNU R html docs for statistical computing system functions

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?