溫馨提示×

ubuntu如何修改sources.list源

小新
3693
2021-04-15 08:58:17
欄目: 智能運維

ubuntu修改sources.list源的方法:1.打開終端;2.輸入“sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup”命令備份源列表;3、輸入“sudo vim /etc/apt/sources.list”命令打開sources.list文件進行修改;4、使用新的源替換掉文件中所有的內(nèi)容;5.輸入命令刷新源列表,使修改生效即可。

ubuntu如何修改sources.list源

具體操作步驟:

1.使用快捷鍵【Ctrl+Alt+T】打開終端。

2.輸入以下命令備份源列表。

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

3.再輸入命令打開sources.list文件進行修改。

sudo vim /etc/apt/sources.list

4.使用以下源替換掉文件中所有的內(nèi)容,保存編輯好的文件。

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

5、最后輸入以下命令刷新源列表,使修改生效即可。

sudo apt-get update

sudo apt-get upgrade

sudo apt-get install build-essential

0