debian 之apt-get / apt-cache vs. aptitude

debian中的安裝軟件所用的指令有:

apt-get:

apt-get update #修改/etc/apt/sources.list文件中的源後,執行該指令保證源文件最新。
apt-get install package #安裝一個新的軟件包
apt-get remove  package #卸載一個軟件包,不刪除該包的配置文件
apt-get --purge remove package #卸載一個軟件包並刪除配置文件
apt-get upgrade #更新所有已安裝的軟件包,最好不要用

apt-cache:

apt-cache search 關鍵字 #搜索與關鍵字匹配的包名
apt-cache show package #顯示軟件的信息,包括版本號,安裝狀態,依賴關係
apt-cache showpkg package #顯示軟件包的依賴狀態
apt-cache policy package #顯示軟件包的安裝狀態和版本信息
apt-cache depends package #顯示軟件包所依賴的關係

dpkg:

dpkg -l #查看已經安裝的軟件包,相當於rpm -qa
dpkg -i package #安裝已下載到本地的軟件包
dpkg -r package #刪除包,保留配置文件
dpkg -P package #刪除包和配置文件
dpkg -L package #列出該包所包含的文件

aptitude:

aptitude指令用法比apt-get更方便,二者極其相似。
aptitude update #更新軟件包列表相當於  apt-get update
aptitude install package #安裝指定的軟件包
aptitude search  package #根據模式來搜尋匹配到模式的包
aptitude remove  package  #僅刪除包,保留配置文件
aptitude purge  package   #刪除配置文件和包
aptitude show package #顯示指定包的詳細信息,該包應是文件名,而不是匹配模式
aptitude versions package #顯示包的版本信息
aptitude clean #刪除下載的包文件


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章