文章目录
下载镜像
因为会经常皮坏了,所以要下载下来用。
docker pull ubuntu
启动容器
docker run -d --name linux -i -t ubuntu
阿里镜像
玩耍怎么能用2G网
查看系统版本
在容器中执行
cat /etc/os-release
配置文件导出
docker cp linux:/etc/apt/sources.list /
需要管理员权限的命令行
会出现在C盘根目录下
修改
官方教程:https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.3e221b11W3dydF
我的是20版本
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
配置文件导入
docker cp /source.list linux:/etc/apt
查看效果
apt-get update