對於很多Linux新手來說,Linux系統沒有圖形界面,也看不到哪些軟體安裝成功,哪些出了新版本需要更新,全然不知。而保持計算機中軟體的更新是保護系統的最重要環節之一,也就是說直到那些軟體需要更新十分重要。
那麼,今天我們就來聊一聊,究竟有哪些方法能夠實現調取Linux系統中所有需要更新的軟體包列表呢?筆者一共總結了apt,aptitude,apt-check,yum和up2date五種方法,你喜歡那個?
apt命令(適用於Ubuntu 14.04以上版本)
在7月21日的Linux實驗室中,我們討論了apt這個命令的應用場景,足見這個Ubuntu 14.04的新命令的方便。如果你需要調出所有需要更新軟體包的列表,並展示現在的版本和最新版本,只需要輸入這個命令:
sudo apt list --upgradable
Listing... Donegnupg/stable 1.4.18-7+deb8u2 amd64 [upgradable from: 1.4.18-7+deb8u1]gpgv/stable 1.4.18-7+deb8u2 amd64 [upgradable from: 1.4.18-7+deb8u1]libgcrypt20/stable 1.6.3-2+deb8u2 amd64 [upgradable from: 1.6.3-2+deb8u1]libidn11/stable 1.29-1+deb8u2 amd64 [upgradable from: 1.29-1+deb8u1]linux-image-3.16.0-4-amd64/stable 3.16.36-1+deb8u1 amd64 [upgradable from: 3.16.7-ckt25-2+deb8u3]
一般來講,這個命令醫改是在運行apt升級之後運行的。如果有任何的更新,它將會展示究竟有多少軟體需要升級,又有多拿些具體的軟體有最新版本。
aptitude命令
如果選擇用「aptitude」命令獲取,可以使用以下命令獲取可升級的軟體包列表。註:某些版本的aptitude不需要給~U加單引號。
aptitude search '~U'
...i scudcloud - ScudCloud is a non official desktop client for Slack i shim-signed - Secure Boot chain-loading bootloader (Microsoft-signed binary) i smbclient - command-line SMB/CIFS clients for Unix i strongswan - IPsec VPN solution metapackage i A strongswan-ike - strongSwan Internet Key Exchange (v2) daemon i A strongswan-plugin-openssl - strongSwan plugin for OpenSSL i A strongswan-starter - strongSwan daemon starter and configuration file parser i sudo - Provide limited super user privileges to specific users ...
另,需要注意的是,這種方法不會只支持本地搜索。