ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

ubuntu20.04下安装lotus

2021-07-05 15:06:00  阅读:358  来源: 互联网

标签:ubuntu20.04 universe lotus com sudo multiverse ubuntu 安装 restricted


所有操作在root用户下完成
更换源
Ubuntu 的软件源配置文件是 /etc/apt/sources.list。将系统自带的该文件做个备份,将该文件替换为下面内容,即可使用国内的软件源镜像。
一定要备份,一定要备份,一定要备份,重要的事情说三遍。
1.备份原始源文件source.list

sudo  cp   /etc/apt/sources.list   /etc/apt/sources.list.bak

2.修改源文件sources.list
(1)终端执行命令:

sudo chmod 777 /etc/apt/sources.list 

更改文件权限使其可编辑;
(2)执行命令:

 sudo gedit /etc/apt/sources.list 

打开文件进行编辑;
(3)删除原来的文件内容,复制下面的任意一个到其中并保存(常用的是阿里源和清华源);
3.更新源
桌面终端执行命令:

sudo apt update

更新软件列表,换源完成。
阿里云【推荐】

deb http://mirrors.aliyun.com/ubuntu/ groovy main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ groovy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ groovy-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ groovy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ groovy-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ groovy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ groovy-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ groovy-backports main restricted universe multiverse
# 预发布软件源,不建议启用
#deb http://mirrors.aliyun.com/ubuntu/ groovy-proposed main restricted universe multiverse
#deb-src http://mirrors.aliyun.com/ubuntu/ groovy-proposed main restricted universe multiverse

官方

deb http://cn.archive.ubuntu.com/ubuntu/ groovy main universe restricted multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ groovy main universe restricted multiverse #Added by software-properties
deb http://security.ubuntu.com/ubuntu/ groovy-security main universe restricted multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ groovy-security main universe restricted multiverse #Added by software-properties
deb http://cn.archive.ubuntu.com/ubuntu/ groovy-updates main universe restricted multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ groovy-updates main universe restricted multiverse #Added by software-properties

安装go
下载go

1、下载地址
	安装包下载地址为:https://golang.org/dl/ 或者 https://golang.google.cn/dl/
	选择 go1.14.4.linux-amd64.tar.gz下载
2、解压到/usr/local目录
	$ sudo tar -zxvf go1.14.4.linux-amd64.tar.gz -C /usr/local
3. 设置环境变量
	$ sudo vim /etc/profile
	# 在文件末尾加上路径
	export GOROOT=/usr/local/go
	export GOPATH=$HOME/go
	export GOBIN=$GOPATH/bin
	export PATH=$GOPATH:$GOBIN:$GOROOT/bin:$PATH
4. 使环境变量生效
	$ source /etc/profile
    # 在关闭终端后,重新打开环境变量又会失效,所以要修改.bashrc文件
	$ cd ~
	$ sudo vim .bashrc
    # 在文件末尾加入如下命令
	  source /etc/profile
    #重新加载配置文件
        $ . ~/.bashrc
5、上述搭建的go环境是在普通用户king下,如果想在root下go环境也起作用
# 切换到root用户
    $ sudo su 
# 进入当前的用户目录下
    $ cd ~
    $ vim .bashrc 
# 在文件末尾加入如下命令
  source /etc/profile
#重新加载配置文件
    $ . ~/.bashrc

装插件

sudo apt update 
sudo apt install curl
sudo apt install vim
sudo apt install pacman
sudo apt install make
sudo apt install cargo
rustup安装
curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
rustc --version
lhwloc 安装
sudo apt install libhwloc-dev
sudo apt install mesa-opencl-icd ocl-icd-opencl-dev
sudo apt install gcc git bzr jq pkg-config mesa-opencl-icd ocl-icd-opencl-dev

克隆(Clone)

 git clone https://github.com.cnpmjs.org/filecoin-project/lotus.git 
 cd lotus/

编译

#Go
export GOROOT=/usr/local/go // 程序安装的位置
export GOPATH=~/Downloads/GoCode // 项目位置
export PATH=$PATH:$M3_HOME/bin:$GOROOT/bin:$GOPATH  //总的路径
make  ##【必须挂在代理】
make clean

启动

lotus daemon

标签:ubuntu20.04,universe,lotus,com,sudo,multiverse,ubuntu,安装,restricted
来源: https://blog.csdn.net/qq_34865347/article/details/118484784

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有