ubuntu更新源小常識

1:去掉linux 系統vi中出現^M字符的方法 linux

去掉linux系統vi中出現^M字符的方法:
^M符號是windows系統下的換行符,在windows下的文本經過bin模式ftp上傳到了unxi空間出現的,要去掉這些結束符,咱們能夠用dos2unix命令去掉,也能夠直接在vi中操做去掉,實現方法以下:
在test.txt文件中有以下內容:
eeesdgtdfg
dfgdfgfdgfd ^M
ineesert into pusfdgdfgfd)ff;^M
adwwfdfed
adfdsdfsfdsf.^M
在命令模式下運行命令 :%s/^M//g 回車
注意:裏面的^M 必須是同時按 Ctrl+V+M
,表示回車。
不是直接輸入 ^M,也不是粘帖複製。
命令完成後,用:x 保存退出後,再次用vi打開就所有被替換掉了。 ubuntu

2:沒法得到鎖 /var/lib/apt/lists/lock – open windows


在網上搜索到的解決方案──「將/var/lib/apt/list/lock刪除掉便可」──實際上是一種極端的狀況,也就是在上次更新沒有正常關閉的狀況下使用。

在大部分狀況下,問題的緣由在於其它的程序如系統的自動更新、新立得等正在使用apt-get進程,因此解決方法也就是將這一進程關閉。具體以下:

一、ps-aux 查出apt-get進程的PID,一般是一個四位數字。
二、用sudo kill PID代碼 殺死進程
三、用sudo apt-get update,sudo apt-get dist-upgrade升級。 spa

3:將gb2312 轉碼utf8 unix

iconv -f gb2312 -t utf8 source.list -o source.list rest

每次升級ubuntu都有更換更新源(gengxinyuan),其實更新源地址沒必要上網找,直接本身更改就能夠了。更新源的地址基本上是這樣的: 進程

        deb http://ubuntu.srt.cn/ubuntu/ oneiric main universe restricted multiverse ip

      這個是11.10的更新源地址,其中 oneiric就是ubuntu 11.10的開發代號,因此咱們只須要將電腦中的更新源列表裏的開發代號替換爲ubuntu 12.04的開發代號就能夠了,用ctrl+F查找出來所有替換就能夠了。所以之後再換版本就不用本身上網搜索更新源了。ubuntu 12.04的開發代號是Precise Pangolin,譯爲精確的穿山甲。因此只需將oneiric替換爲precise便可 ci

一、首先備份Ubuntu 11.10源列表
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup (備份下當前的源列表,有備無患嘛)
資源


二、修改更新源
sudo gedit /etc/apt/sources.list (打開Ubuntu 11.10源列表文件)


三、用ctrl+F查找全部的oneiric,而後所有替換爲precise

四、通知ubuntu啓用新的更新源   sudo apt-get update


//固然若是你比較懶,或者是全新安裝的ubuntu,那你能夠直接把下面的代碼複製到sources.list中

#臺灣源
deb http://tw.archive.ubuntu.com/ubuntu/ precise  main universe restricted multiverse 
deb-src http://tw.archive.ubuntu.com/ubuntu/ precise  main universe restricted multiverse 
deb http://tw.archive.ubuntu.com/ubuntu/ precise-security universe main multiverse restricted 
deb-src http://tw.archive.ubuntu.com/ubuntu/ precise-security universe main multiverse restricted 
deb http://tw.archive.ubuntu.com/ubuntu/ precise-updates universe main multiverse restricted 
deb-src http://tw.archive.ubuntu.com/ubuntu/ precise-updates universe main multiverse restricted


#網易 Ubuntu 11.10 源(速度很快)
deb http://mirrors.163.com/ubuntu/ precise main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ precise main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ precise-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ precise-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ precise-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ precise-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ precise-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ precise-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ precise-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ precise-updates universe main multiverse restricted


#骨頭源,骨頭源是bones7456架設的一個Ubuntu源 ,提供ubuntu,deepin
deb http://ubuntu.srt.cn/ubuntu/ precise main universe restricted multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ precise main universe restricted multiverse
deb http://ubuntu.srt.cn/ubuntu/ precise-security universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ precise-security universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ precise-updates universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ precise-proposed universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ precise-proposed universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ precise-backports universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ precise-backports universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ precise-updates universe main multiverse restricted


#mirror.lupaworld.com的源,速度很快
deb http://mirror.lupaworld.com/ubuntu/archive/ precise main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ precise-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ precise-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ precise-backports main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/ubuntu-cn/ precise main restricted universe multiverse



#ubuntu.cn99.com源(推薦):
deb http://ubuntu.cn99.com/ubuntu/ precise main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ precise-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ precise-backports main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu-cn/ precise main restricted universe multiverse


//教育網源
若是你是在校大學生,可使用校園網/教育網,就是用教育網的資源吧,中科大,蘭大、廈門大學都有不少資源,尤爲是支持ipv6的,那更新速度就按兆算了。
中科大:http://mirrors.ustc.edu.cn/
廈門大學:http://mirrors.xmu.edu.cn/howto/
#電子科技大學 deb http://ubuntu.uestc.edu.cn/ubuntu/ precise main restricted universe multiverse deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-security main restricted universe multiverse deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise main restricted universe multiverse deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-security main restricted universe multiverse deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse #中國科技大學 deb http://debian.ustc.edu.cn/ubuntu/ precise main restricted universe multiverse deb http://debian.ustc.edu.cn/ubuntu/ precise-backports restricted universe multiverse deb http://debian.ustc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse deb http://debian.ustc.edu.cn/ubuntu/ precise-security main restricted universe multiverse deb http://debian.ustc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse deb-src http://debian.ustc.edu.cn/ubuntu/ precise main restricted universe multiverse deb-src http://debian.ustc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse deb-src http://debian.ustc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse deb-src http://debian.ustc.edu.cn/ubuntu/ precise-security main restricted universe multiverse deb-src http://debian.ustc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse #北京理工大學 deb http://mirror.bjtu.edu.cn/ubuntu/ precise main multiverse restricted universe deb http://mirror.bjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb http://mirror.bjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb http://mirror.bjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb http://mirror.bjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise main multiverse restricted universe deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe #蘭州大學 deb ftp://mirror.lzu.edu.cn/ubuntu/ precise main multiverse restricted universe deb ftp://mirror.lzu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb ftp://mirror.lzu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb ftp://mirror.lzu.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb ftp://mirror.lzu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe deb ftp://mirror.lzu.edu.cn/ubuntu-cn/ precise main multiverse restricted universe #上海交通大學 deb http://ftp.sjtu.edu.cn/ubuntu/ precise main multiverse restricted universe deb http://ftp.sjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb http://ftp.sjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb http://ftp.sjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb http://ftp.sjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe deb http://ftp.sjtu.edu.cn/ubuntu-cn/ precise main multiverse restricted universe deb-src http://ftp.sjtu.edu.cn/ubuntu/ precise main multiverse restricted universe deb-src http://ftp.sjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb-src http://ftp.sjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb-src http://ftp.sjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb-src http://ftp.sjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe

相關文章
相關標籤/搜索