怎么修改ubuntu的軟件源

小新
2612
2021-04-16 10:29:13

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

怎么修改ubuntu的軟件源

具體操作步驟:

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

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

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

3、再輸入命令打開sources.list文件進(jìn)行修改。

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