#配置Ubuntu
配置一个basic虚拟机,之后生成克隆虚拟机,用于安装MP-SPDZ库,进行实验
## 查看系统版本
cat /proc/version
## 换源(鱼香ROS一键换源)
wget http://fishros.com/install -O fishros && . fishros
更新
sudo apt-get update
## python重定向
sudo apt install python-is-python3
更新软件包列表
>sudo apt-get update
sudo apt-get upgrade
## 下载MP-SPDZ依赖(Linux)
>sudo apt-get install automake build-essential clang cmake git libboost-dev libboost-thread-dev libgmp-dev libntl-dev libsodium-dev libssl-dev libtool python3
## docker安装
### 下载docker的依赖
>sudo apt-get install ca-certificates curl gnupg lsb-release
(提示已安装)
### 添加docker官方的GPG密钥:
>curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
### 添加docker软件源
>sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
密钥存储在过时的 trusted.gpg 密钥环中(/etc/apt/trusted.gpg)
解决:
>cd /etc/apt
sudo cp trusted.gpg trusted.gpg.d
### 安装docker
>sudo apt-get install docker-ce docker-ce-cli containerd.io
启动docker验证是否成功安装
>systemctl start docker
![Alt text](image-1.png)
### 安装工具
>sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
重启docker
>service docker restart
### 验证是否安装成功
>sudo docker run hello-world
这是第一次运行这个代码,所以拉取helloworld代码
查看helloworld镜像
>sudo docker images
运行hello-world镜像
>sudo docker run hello-world
## 在克隆机安装open-vm-tools-desktop
sudo apt-get autoremove open-vm-tools//先卸载
sudo apt-get install open-vm-tools-desktop//重新安装
sudo reboot
可以复制文件了
## 安装pip
>sudo apt install python3-pip
### 配置pip的国内镜像源
>cd ~ # 进入家目录
mkdir .pip # 新建.pip隐藏文件夹
- 或者 mkdir -p .config/pip
cd .pip # 进入.pip文件夹
- 或者 cd .config/pip
touch pip.conf # 新建pip.conf文件
vi pip.conf # 用vi编辑pip.conf文件
>[global]
index-url=https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
执行
>pip install --upgrade pip ipython
### warning意思是没有配置环境变量
主目录的隐藏文件
打开配置文件,添加路径path
可以直接定向到ipython了,在命令行中直接运行 pip, pip3, pip3.10, ipython, 和 ipython3 命令,而不会看到警告信息。