将r-base从v3.6升级到v4.0 Linux

问题描述

我正在尝试安装R-base 4.0,但它一直在安装v3.6。我尝试过:

#include <type_traits>
#include <functional>


template<typename T>
concept Node_ = std::is_object_v<T>; 

template<typename T>
concept Tree_ = requires (T t) {
    { t.root } -> Node_;
    /* implement child tuple constraints here */
};

// Generic tree object 
template<Node_ NodeT /*,Tree_ ... ChildrenT*/>
struct tree {
    NodeT root;
    /* implement child tuple here */
};

struct test_tree_int { int root; }; // Should satisfy tree concept
struct test_tree_intref { int& root; }; // Shouldnt satisfy tree concept


static_assert(Tree_<tree<int>>);
static_assert(Tree_<test_tree_int>);
//static_assert(Tree_<test_tree_intref>); /// Compilation fails

和v3.6,未安装4.0。接下来,我尝试了:

sudo apt install deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/
sudo apt-get install r-base

它不起作用。

如何升级到Rv4.0?我正在使用Pop_Os,没有Ubuntu。可能是问题所在吗?

解决方法

首先,您的首行是错误的。没有这样的readonly命令。您应该手动编辑apt源文件(尽管这些天可能还会有GUI解决方案)。

第二,您通过不运行SELECT(或同等apt install deb)来省略了实际上使用新存储库的过程。您必须更新本地索引。

第三,一种首选方法是像(几乎)在第二段中那样进行升级。但是升级不需要软件包参数!

第四,这与Pop!OS无关,因为我们在这里只谈论sudo apt updatesudo apt-get update

为完整起见,我做了一些博客和视频,介绍了将R 3.6。*升级到R 4.0。*的过程。更多信息here(如果您愿意)。

PS第五,正如r2evans在评论中指出的,请务必选择正确的发行版。我直接运行Ubuntu,因此“焦点”更多。您可能需要Ubuntu 4.0中的R 4.0。*与您的Pop!OS版本相匹配。