服务器
    作者:鲁畅

    Linux实验室 五种方法找到可更新软件

         [ 中关村在线 原创 ] 暂无评论
    返回分页阅读

    本文导航:

    1apt,aptitude获取可更新软件包列表

      对于很多Linux新手来说,Linux系统没有图形界面,也看不到哪些软件安装成功,哪些出了新版本需要更新,全然不知。而保持计算机中软件的更新是保护系统的最重要环节之一,也就是说直到那些软件需要更新十分重要。

      那么,今天我们就来聊一聊,究竟有哪些方法能够实现调取Linux系统中所有需要更新的软件包列表呢?笔者一共总结了apt,aptitude,apt-check,yum和up2date五种方法,你喜欢那个?

    Linux实验室 五种方法调出可更新软件列表

    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   
    ...

      另,需要注意的是,这种方法不会只支持本地搜索。

    2apt-check,yum和up2date命令更新

    apt-check脚本搜索法

      用这个apt-check脚本可以在Ubuntu 14.04上输出更为简洁的更新列表。

    # /usr/lib/update-notifier/apt-check -p
    bind9-host
    python3-problem-report
    liblwres90
    linux-headers-generic
    libdns100
    

    libisccfg90

    ...

    # /usr/lib/update-notifier/apt-check --human-readable
    33 packages can be updated.
    30 updates are security updates.

    yum命令

      Yum是一个软件包管理器,一般可以用在基于RPM的系统上进行安装,更新和删除软件包。它的优势在于能够自动分别软件的依赖程度,并给出推荐安装升级的安装包。也会列出可用于已安装软件包的更新:

    yum list updates
    Loaded plugins: fastestmirror, refresh-packagekit, security
    Loading mirror speeds from cached hostfile
     * base: centos.hyve.com
     * epel: mirrors.coreix.net
     * extras: centos.hyve.com
     * rpmforge: www.mirrorservice.org
     * updates: mirror.sov.uk.goscomb.net
    
    kernel.x86_64                                                     2.6.32-504.3.3.el6  
    ...

    up2date命令

      up2date可以说是一个非常实用的程序了。up2date这个应用是从红帽网络RHN上下载安装的程序。它的优势在于可以自动解析依赖关系,并下载可能需要的任何其他软件包。 它具有-l选项,可以显示哪些软件包更新可用于下载和安装。

    up2date -l

      当然,除了上面这五种方法,还有很多其他途径,比如说apt-get命令,或者用Apticron工具将需要更新的列表推送到你的邮箱中。

      另外需要注意的是在进行这些操作前要考量目前的系统环境,因为更新可能会导致系统重启。

    返回分页阅读

    本文导航:

    关注排行榜

    产品品牌

    文章推荐

    互动沙龙

    相关内容 网友评论 返回首页
    专家咨询