docker 环境创建
配置apt国内镜像源
- 备份源
cp /etc/apt/sources.list /etc/apt/sources.list_backup
vim /etc/apt/sources.list
备注:ggVG全选中,按下dd即可清除内容
编辑内容:
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
如果出现vim不可用,可使用echo
echo 'deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse' > /etc/apt/sources.list
echo 'deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse' > /etc/apt/sources.list
echo 'deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse' >> /etc/apt/sources.list
- 更新列表
apt-get update
ssh 远程连接
apt-get install openssh-server
遇到问题:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
openssh-server : Depends: openssh-client (= 1:7.6p1-4ubuntu0.4) but 1:8.2p1-4ubuntu0.1 is to be installed
Depends: openssh-sftp-server but it is not going to be installed
Recommends: libpam-systemd but it is not going to be installed
Recommends: ncurses-term but it is not going to be installed
Recommends: xauth but it is not going to be installed
Recommends: ssh-import-id but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
解决方案:
下载对应的客户端
apt-get install openssh-client=1:7.6p1-4ubuntu0.4
- 启动ssh
/etc/init.d/ssh restart
- 配置ssh远程登录
vim /etc/ssh/sshd_config
设置
PermitRootLogin yes
- 重启ssh
/etc/init.d/ssh restart
- 问题:ImportError: libGL.so.1: cannot open shared object file: No such file or directory
apt install libgl1-mesa-glx
问题:apt更新签名问题
Get:1 http://mirrors.aliyun.com/ubuntu bionic InRelease [242 kB]
Err:1 http://mirrors.aliyun.com/ubuntu bionic InRelease
Couldn’t create temporary file /tmp/apt.conf.51Jnba for passing config to apt-key
Get:2 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease [74.6 kB]
Err:2 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease
Couldn’t create temporary file /tmp/apt.conf.I69fNe for passing config to apt-key
Get:3 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease [242 kB]
Err:3 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease
Couldn’t create temporary file /tmp/apt.conf.4BqRgj for passing config to apt-key
Get:4 http://mirrors.aliyun.com/ubuntu bionic-security InRelease [88.7 kB]
Err:4 http://mirrors.aliyun.com/ubuntu bionic-security InRelease
Couldn’t create temporary file /tmp/apt.conf.F6OLEo for passing config to apt-key
Get:5 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease [88.7 kB]
Err:5 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease
Couldn’t create temporary file /tmp/apt.conf.qNuAzr for passing config to apt-key
Reading package lists… Done
W: GPG error: http://mirrors.aliyun.com/ubuntu bionic InRelease: Couldn’t create temporary file /tmp/apt.conf.51Jnba for passing config to apt-key
E: The repository ‘http://mirrors.aliyun.com/ubuntu bionic InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://mirrors.aliyun.com/ubuntu bionic-backports InRelease: Couldn’t create temporary file /tmp/apt.conf.I69fNe for passing config to apt-key
E: The repository ‘http://mirrors.aliyun.com/ubuntu bionic-backports InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease: Couldn’t create temporary file /tmp/apt.conf.4BqRgj for passing config to apt-key
E: The repository ‘http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://mirrors.aliyun.com/ubuntu bionic-security InRelease: Couldn’t create temporary file /tmp/apt.conf.F6OLEo for passing config to apt-key
E: The repository ‘http://mirrors.aliyun.com/ubuntu bionic-security InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://mirrors.aliyun.com/ubuntu bionic-updates InRelease: Couldn’t create temporary file /tmp/apt.conf.qNuAzr for passing config to apt-key
E: The repository ‘http://mirrors.aliyun.com/ubuntu bionic-updates InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
解决方案:
chmod 777 /tmp
参考:https://bbs.huaweicloud.com/blogs/308763
问题:ERROR: Could not build wheels for pycuda which use PEP 517 and cannot be installed directly
解决方案:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pycuda --no-binary :all: