這篇文章將為大家詳細(xì)講解有關(guān)ubuntu如何使用sudo apt-get update更新列表,小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。
我們提供的服務(wù)有:成都做網(wǎng)站、網(wǎng)站設(shè)計(jì)、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、夏津ssl等。為超過千家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的夏津網(wǎng)站制作公司
代碼如下:
#電子科技大學(xué)
deb http://ubuntu.uestc.edu.cn/ubuntu/ quantal main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ quantal-backports main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ quantal-proposed main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ quantal-security main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ quantal-updates main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ quantal main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ quantal-backports main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ quantal-proposed main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ quantal-security main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ quantal-updates main restricted universe multiverse
# sohu 更新服務(wù)器:
deb http://mirrors.sohu.com/ubuntu/ karmic main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ karmic-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ karmic-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ karmic-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ karmic-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ karmic main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ karmic-security main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ karmic-updates main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ karmic-proposed main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ karmic-backports main restricted universe multiverse
# 骨頭兄親自搭建并維護(hù)這個(gè)Ubuntu源(該源位于浙江杭州百兆共享寬帶的電信機(jī)房):
deb http://ubuntu.srt.cn/ubuntu/ karmic main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ karmic-security main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ karmic-updates main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ karmic-proposed main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ karmic-backports main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ karmic main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ karmic-security main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ karmic-updates main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ karmic-proposed main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ karmic-backports main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/ubuntu-cn karmic main restricted universe multiverse
# Archive.ubuntu.com更新服務(wù)器(歐洲,此為官方源,電信網(wǎng)通用戶使用):
deb http://archive.ubuntu.com/ubuntu/ karmic main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ karmic-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ karmic-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ karmic-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ karmic-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ karmic main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ karmic-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ karmic-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ karmic-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ karmic-backports main restricted universe multiverse
# Mirrors.shlug.org更新服務(wù)器(電信服務(wù)器,Ubuntu China Official Mirror, maintained by Shanghai Linux User Group):
deb http://cn.archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu karmic-backports main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu karmic-proposed main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic-backports main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic-proposed main restricted universe multiverse
# Mirror.lupaworld.com更新服務(wù)器(浙江省杭州市雙線服務(wù)器):
deb http://mirror.lupaworld.com/ubuntu karmic main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu karmic-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu karmic-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu karmic-backports main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu karmic-proposed main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic-security main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic-updates main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic-backports main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic-proposed main restricted universe multiverse
執(zhí)行命令更新
代碼如下:
sudo apt-get update
使用sudo apt-get update問題總結(jié)
代碼如下:
sudo apt-get update
顯示為
E: 無法獲得鎖 /var/lib/apt/lists/lock - open (11 Resource temporarily unavailable)
E: 無法對狀態(tài)列表目錄加鎖
直接把lock 文件刪除就是了..
sudo rm /var/lib/apt/lists/lock
我在網(wǎng)上查了一下,還有下面方法
先查看一下是否有使用apt-get的程序,終端輸入:ps -aux,找到使用apt-get的程序(最后一列),查看其PID號,然后殺死其進(jìn)程,輸入sudo kill PID,然后升級一下軟件源,sudo apt-get update,sudo apt-get dist-update.
Ubuntu 更新軟件源出錯(cuò)問題
當(dāng)執(zhí)行sudo apt-get update來更新軟件源時(shí),若出現(xiàn)以下類似錯(cuò)誤: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/maverick/Release.gpg Something wicked happened resolving 'cn.archive.ubuntu.com:http' (-5 - No address associated with hostname)
說明DNS解析出現(xiàn)了問題,應(yīng)著重查看以下方面:
1. cat /etc/resolv.conf
查看里面的domain, search和nameserver配置是否正確。
若通過代理上網(wǎng),請查看:
2. cat /etc/apt/apt.conf
在里面添加設(shè)置:
Acquire::http::proxy "http://xxxxx.xxxxx.xxxx:1080" , 注意是http, 不是https
3. 查看 “系統(tǒng)”--> “首選項(xiàng)”--> “網(wǎng)絡(luò)代理”,里面的代理是否設(shè)置正確
關(guān)于“ubuntu如何使用sudo apt-get update更新列表”這篇文章就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,使各位可以學(xué)到更多知識,如果覺得文章不錯(cuò),請把它分享出去讓更多的人看到。