1. 程式人生 > >ubuntu下安裝新立得(Synaptic)出現安裝錯誤的解決嘗試

ubuntu下安裝新立得(Synaptic)出現安裝錯誤的解決嘗試

今天打算新配一套linux下的vanet道路模擬平臺,ns2+SUMO.在安裝依賴包時打算使用新立得,可是安裝出錯。報錯依賴包不正確。

原意是有些依賴包的版本過高或過低。一種方法是手動的修改每個包的版本(aptitude)。但是總是出現問題,找不到包,或者安裝後沒效果。可能是我安裝的問題。但是還是感覺這樣比較麻煩。後來在網上看到有人說包的源會影響依賴關係。所以就開始從這方面下手。最後通過換源問題得到了解決。方法如下:

(1)cd etc/apt/ 進入apt目錄,

(2)sudo gedit sources.list 編輯源目錄

用一下源替換原有的源:

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to    
# newer versions of the distribution.    
deb http://cn.archive.ubuntu.com/ubuntu/ precise main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise main restricted
       
## Major bug fix updates produced after the final release of the    
## distribution.    
       
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu    
## team. Also, please note that software in universe WILL NOT receive any    
## review or updates from the Ubuntu security team.    
deb http://cn.archive.ubuntu.com/ubuntu/ precise universe
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise universe
       
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu     
## team, and may not be under a free licence. Please satisfy yourself as to     
## your rights to use the software. Also, please note that software in     
## multiverse WILL NOT receive any review or updates from the Ubuntu    
## security team.    
deb http://cn.archive.ubuntu.com/ubuntu/ precise multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise multiverse
       
## N.B. software from this repository may not have been tested as    
## extensively as that contained in the main release, although it includes    
## newer versions of some applications which may provide useful features.    
## Also, please note that software in backports WILL NOT receive any review    
## or updates from the Ubuntu security team.    
       
deb http://cn.archive.ubuntu.com/ubuntu/ precise-security main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-security main restricted
deb http://cn.archive.ubuntu.com/ubuntu/ precise-security universe
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-security universe
deb http://cn.archive.ubuntu.com/ubuntu/ precise-security multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-security multiverse
       
## Uncomment the following two lines to add software from Canonical's    
## 'partner' repository.    
## This software is not part of Ubuntu, but is offered by Canonical and the    
## respective vendors as a service to Ubuntu users.    
deb http://archive.canonical.com/ubuntu precise partner
deb-src http://archive.canonical.com/ubuntu precise partner
       
## This software is not part of Ubuntu, but is offered by third-party    
## developers who want to ship their latest software.    
# deb http://extras.ubuntu.com/ubuntu precise main
# deb-src http://extras.ubuntu.com/ubuntu precise main
       
# codeblock     
deb http://ppa.launchpad.net/pasgui/ppa/ubuntu precise main
deb-src http://ppa.launchpad.net/pasgui/ppa/ubuntu precise main
       
# ubuntu tweak    
deb http://ppa.launchpad.net/tualatrix/ppa/ubuntu precise main
deb http://cn.archive.ubuntu.com/ubuntu/ precise-updates restricted main multiverse universe
deb-src http://ppa.launchpad.net/tualatrix/ppa/ubuntu precise main

(3)修改好後儲存退出文件

(4)sudo apt-get update

  (5)   再次安裝新立得成功

對於安裝其他包該方法是否適用有待驗證。不妨一試