目录
1.安装docker ce
官网:https://docs.docker.com/engine/install/ubuntu/
参考:https://blog.csdn.net/weixin_43158056/article/details/93204238
1.更新源:
sudo apt-get update
2.清除老版本:
sudo apt-get remove docker docker-engine docker.io containerd runc
2.安装软件包以允许apt若要在HTTPS上使用存储库:
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
3.添加Docker的官方GPG密钥:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
4.使用以下命令设置稳定储存库。若要添加夜间或试验存储库,添加单词nightly或test(或两者兼而有之)stable在下面的命令中。了解夜间和试验通道.
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
5.安装DOCKER-CE
更新apt包装索引
sudo apt-get update
安装最新版本或转到下一步安装特定版本:
sudo apt-get install docker-ce docker-ce-cli containerd.io
安装完测试
sudo docker run hello-world
输出Hello from Docker!就是安装完成了
问题:Unable to find image 'hello-world:latest' locally docker: Error response from daemon
打开终端,输入以下命令,会新建一个空白文档
sudo gedit /etc/docker/daemon.json
在文档中添加,双引号为英文双引号,如果为红色说明有错误,蓝色没错
{
"registry-mirrors": ["https://alzgoonw.mirror.aliyuncs.com"]
}
输入命令重启docker,报错上面文档有错,注意双引号:
systemctl restart docker
sudo systemctl status docker
运行一遍,会出错
sudo docker run hello-world
关了,在运行一遍。
2.安装FeniCS
Linux系统需要注意:安装完毕后需要给你的用户使用docker的权限
sudo usermod -a -G docker $USER
curl -s https://get.fenicsproject.org | bash
FEniCS 安装在 Ubuntu,安装过程有可能中断,重新运行本条指令即可继续下载安装
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:fenics-packages/fenics
sudo apt-get update
sudo apt-get install --no-install-recommends fenics
sudo apt-get dist-upgrade
3.安装python3.6
在终端中输入下面的命令
wget http://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
tar -xvzf Python-3.6.4.tgz
cd Python-3.6.4
./configure --with-ssl
make
sudo make install
超级权限
sudo passwd root
输入两次密码
su root
输入密码
sudo make install
安装好后可以通过python3命令进行检查所安装版本,如下图所示
两个Python切换
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150
此步骤不需运行,只有需要python2时才需切换Python2为默认版本:
sudo update-alternatives --config python
4.安装anaconda
参考:https://blog.csdn.net/ITBigGod/article/details/85690257/
Anaconda和Python版本是对应的,所以需要选择安装对应Python2.7版本的还是Python3.6版本或其他版本的,根据自己的需要下载合适的安装包。
下载链接:https://www.anaconda.com/download/#linux
历史版本:
https://repo.anaconda.com/archive/
之前安装的python版本为3.6,下载对应anaconda3-4.4版本
在终端中输入:
cd ./Downloads
cd 后面的一段为上图所示位置后面的路径
接下来运行如下命令进行安装
bash Anaconda3-4.4.0-Linux-x86_64.sh
根据提示输入回车键
参考:https://blog.csdn.net/sowhatgavin/article/details/81877938?utm_source=blogxgwz5
执行安装执行如下命令开始安装
./Anaconda3-4.4.0-Linux-x86_64.sh
Welcome to Anaconda3 4.4.0 (by Continuum Analytics, Inc.)
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>
# 输入回车
===================================
Anaconda End User License Agreement
===================================
Copyright 2017, Continuum Analytics, Inc.
All rights reserved under the 3-clause BSD License:
...
...
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
--More--
# 按多次空格进行翻页
kerberos (krb5, non-Windows platforms)
A network authentication protocol designed to provide strong authentication
for client/server applications by using secret-key cryptography.
cryptography
A Python library which exposes cryptographic recipes and primitives.
Do you approve the license terms? [yes|no]
>>>
# 输入yes,同意license
Anaconda3 will now be installed into this location:
$HOME/anaconda3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
[/home/renshuai/anaconda3] >>>
# 输入安装路径,回车;如直接回车,则按默认路径安装
to PATH in your /vol-th/home/renshuai/.bashrc ? [yes|no]
[no] >>>
# 输入yes,则将anaconda的path添加到~/.bashrc文件;
# 输入no,或者直接回车就不会了。
一路按回车到底后输入yes继续安装
在如图所示下面回车继续
此后遇到yes和no的地方一律输入yes即可
4.检查是否安装成功:
打开一个新的终端,输入python:
在这里插入图片描述出现介绍了python的版本信息,而且后面带了anaconda的标识,这就说明Anaconda安装成功了,此时输入exit()退出python环境。