对于很多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... Done gnupg/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 ...
另,需要注意的是,这种方法不会只支持本地搜索。