Ubuntu 16.04更换阿里apt源

打开这个文件

vim /etc/apt/sources.list

使用vim编辑时,可以用gggdG快捷方式清空该文件内容。

将以下内容复制黏贴进去

deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe

在执行更新即可

apt-get update

使用快捷的、一行命令搞定的方法:

cat > /etc/apt/sources.list <<EOF
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
EOF
apt update && apt upgrade -y

最近更新

猜你喜欢

最近的文章

在docker容器中运行ubuntu桌面版,并通过VNC连接

拉取镜像:docker pull dorowu/ubuntu-desktop-lxde-vnc运行容器:docker run -dit --name ub...…

vnc docker继续阅读
更早的文章

docker下phpmyadmin连接到容器中mysql数据库的方法

1.查看myql的docker所在的网络docker psdocker inspect app_mysql_12.运行镜像,并制定mysql容器名称和对应...…

docker phpmyadmin mysqk继续阅读