欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Ubuntu apt-get如何设置阿里云源代理?

程序员文章站 2022-04-07 10:01:31
由于 apt-get 默认的源为国外服务,在使用 apt-get 软件时下载速度很慢,这时我们可以为 apt-get 设置成国内镜像代理。 # vim /etc/apt/sources.li...

由于 apt-get 默认的源为国外服务,在使用 apt-get 软件时下载速度很慢,这时我们可以为 apt-get 设置成国内镜像代理。

# vim /etc/apt/sources.list

使用 vim 编辑 sources.list:

deb https://mirrors.cloud.aliyuncs.com/ubuntu/ trusty main restricted universe multiverse
deb https://mirrors.cloud.aliyuncs.com/ubuntu/ trusty-security main restricted universe multiverse
deb https://mirrors.cloud.aliyuncs.com/ubuntu/ trusty-updates main restricted universe multiverse
deb https://mirrors.cloud.aliyuncs.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb https://mirrors.cloud.aliyuncs.com/ubuntu/ trusty-backports main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

# apt-get update

update 之后可以愉快的使用 apt-get 了。