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.輸入命令刷新源列表,使修改生效即可。
具體操作步驟:
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