Home | Mirror | Search

2. Apt-Get

apt 命令預設從cdrom安裝

註釋/etc/apt/sources.list中的deb cdrom項, apt會從互聯網上安裝

netkiller@Linux-server:~$ sudo vi /etc/apt/sources.list
# deb cdrom:[Ubuntu-Server 6.10 _Edgy Eft_ - Release i386 (20061025.1)]/ edgy main restricted
		
apt-setup

安裝是首先會下載包到/var/cache/apt/archives/目錄

2.1. Search

Searching a software package

$ apt-cache search package
			

列出軟件包的詳細信息:

$ apt-cache show package
			

列出軟件包的依賴關係:

$ apt-cache depends package
			

列出軟件包, 以及逆向依賴的軟件包的詳細版本信息:

$ apt-cache showpkg package
			

2.2. Installation

$ sudo apt-get install package
			

*.deb

sudo dpkg -i *.deb
			

2.3. Update

$ apt-get update
$ apt-get upgrade
			

Smart software update

$ apt-get dist-upgrade
			

2.4. Remove

刪除系統中的foo軟件包

apt-get remove foo
			

刪除系統中的package軟件包及其配置檔案

$ sudo apt-get remove --purge package
			
comments powered by Disqus