ubuntu换源

2023-12-22 15:56:53

1 首先备份Ubuntu源列表

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

2 查看自己Ubuntu版本

命令 lsb_release -a
在这里插入图片描述
precise为源里面的关键字,根据实际情况,自行修改

3 修改更新源

先删除原文件里面的内容
sudo gedit /etc/apt/sources.list
用下面内容替换

deb     http://mirrors.aliyun.com/ubuntu/ precise           main restricted universe multiverse
deb     http://mirrors.aliyun.com/ubuntu/ precise-security  main restricted universe multiverse
deb     http://mirrors.aliyun.com/ubuntu/ precise-updates   main restricted universe multiverse
deb     http://mirrors.aliyun.com/ubuntu/ precise-proposed  main restricted universe multiverse
deb     http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise           main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-security  main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-updates   main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-proposed  main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse

4 更新

sudo apt-get update

文章来源:https://blog.csdn.net/jiangliuhuan123/article/details/135153508
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。