Ubuntu apt 常用指令備忘錄

升級或更新

apt-get update 更新 /etc/apt/sources.list 套件清單

 

apt-get upgrade 更新系統上沒有套件相依性問題的套件

apt-get dist-upgrade 依照套件相依性更新所有已安裝套件

apt-get check 自動更新套件快取,檢查所有套件是否有相依性問題

apt-get source <name> 若 sources.lst 中有設定 deb-src 就可抓到程式的源碼

 

移除套件

apt-get remove <name> 移除軟體本身,不移除相依套件

apt-get autoremove <name> 移除軟體和相依套件

apt-get purge <name> 移除軟體和相依套件,還有一些相關設定檔

 

清除套件暫存檔

apt-get clean 清除所有套件暫存安裝檔 /var/cache/apt/archives

apt-get autoclean 清除所有舊版套件暫存檔案,只保留最新版本

 

 

apt-cache showpkg <name> 顯示套件的所有資訊

apt-cache search <name> 搜尋套件部分名稱

 

dpkg -i <name>.deb 手動安裝套件

dpkg -l <name> 查詢已安裝套件

dpkg -r <name> 移除已安裝套件,但會留下設定檔

 

/etc/apt/sources.list 備用mirror site ,引用這裡

http://ftp.twaren.net

http://free.nchc.org.tw

http://opensource.nchc.org.tw

posted @ 2014-03-29 23:13  a-jay  阅读(144)  评论(0编辑  收藏  举报