查看: 90|回覆: 0

[Debian] Debian更换软件源

[複製鏈接]

2

主題

0

回帖

0

積分

热心网友

金币
0
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2010-8-18
發表於 2020-2-16 15:12:00 | 顯示全部樓層 |閲讀模式

Debian更换软件源

展开
中国科技大学镜像网
地址
https://mirrors.ustc.edu.cn/debian/

#备份一下软件源

sudo cp /etc/apt/sources.list /etc/apt/sources.list_bak
一般情况下,将 /etc/apt/sources.list 文件中 Debian 默认的源地址 http://deb.debian.org/ 替换为 http://mirrors.ustc.edu.cn 即可。

sudo sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list

当然也可以直接编辑 /etc/apt/sources.list 文件(需要使用 sudo)。
用以下命令打开配置文件

sudo vi /etc/apt/sources.list

以下是debian 9.x (stretch)更新源

编辑/etc/apt/sources.list文件(需要使用sudo), 在文件最前面添加以下条目(操作前请做好相应备份)

deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb http://mirrors.aliyun.com/debian-security stretch/updates main
deb-src http://mirrors.aliyun.com/debian-security stretch/updates main
deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib

敲击i键进入插入模式,组合键ctrl+shift+v将复制内容粘贴至源文件中,敲击两次esc键进入命令模式,输入引号内键“:wq!"保存并退出
更改完 sources.list 文件后请运行 sudo apt-get update 更新索引以生效。

更多镜像
阿里云:http://mirrors.aliyun.com/
搜狐:http://mirrors.sohu.com/
网易:http://mirrors.163.com/

提醒:其中阿里云:http://mirrors.aliyun.com 有详细使用方法建议直接开打此网站学习使用

 



来源:https://www.cnblogs.com/xlpc/p/12316929.html
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即注册

本版積分規則

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部