ubuntu軟體源更新不了,解決方法
在ubuntu14.05.04中,出現ubuntu軟體源更新不了,可以通過更換軟體源來解決。
編輯sources.list,最好在編輯之前,先備份sources.list,以防萬一修改錯誤,還能恢復。
vi /etc/apt/sources.list
清空sources.list,貼上以下內容到sources.list:
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
debhttp://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-srchttp://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
trusty為ubuntu14.04.5的版本代號,其他版本的ubuntu需要修改為對應的版本代號。
在vi編輯器的命令列模式中,輸入命令替換字串:
:%s/precise/trusty
%s/precise/trusty表示替換每一行中所有的precise為trusty。
如果安裝了圖形介面,也可以通過ubuntu的系統設定來修改軟體源。