Ubuntu修改源

本文介绍了如何配置Ubuntu系统的软件源以使用阿里云镜像,并展示了如何修改sources.list文件的具体步骤。此外,还提供了/etc/resolv.conf文件的内容,用于设置DNS服务器。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

cd /etc/apt/

ls -l

看到sources.list

mv sources.list sources.list.bak


cat << EOF > sources.list

> # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
> # newer versions of the distribution.
>
> deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
> deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted
>
> ## Major bug fix updates produced after the final release of the
> ## distribution.
> deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
> deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
>
> ## Uncomment the following two lines to add software from the 'universe'
> ## repository.
> ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
> ## team. Also, please note that software in universe WILL NOT receive any
> ## review or updates from the Ubuntu security team.
> 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
>
> ## N.B. software from this repository may not have been tested as
> ## extensively as that contained in the main release, although it includes
> ## newer versions of some applications which may provide useful features.
> ## Also, please note that software in backports WILL NOT receive any review
> ## or updates from the Ubuntu security team.
> # deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted
> # deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted
>
> deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
> deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
> deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
> deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
> # deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
> # deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
> EOF


/etc/resolv.conf


# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
search lan


nameserver 8.8.8.8
nameserver 8.8.4.4

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值