如何确切知道哪些软件包在Ubuntu中具有安全更新?

我试图得到一个标记为具有“安全更新”的软件包列表

我的基础系统是Ubuntu 14.04

例如,Ubuntu 14.04上有一个脚本,它将列出可用更新的数量。 dynamic的motd使用它。

/usr/lib/update-notifier/apt-check 

运行没有参数给以分号分隔的输出到stderr,例如:

 $ /usr/lib/update-notifier/apt-check 60;11 <-- (this is actually standard error) 

这个脚本有“人类可读的”和“包名”标志。 大! 但是,“软件包名称”只是抛出了正在更新的软件包,并没有把它们放到安全/非安全堆中。

我如何知道“安全更新”桶中的内容?

我尝试过这样的事情:

 apt-get -s dist-upgrade | grep "^Inst" | grep -i security 

那个不适合我

我正在考虑拆开apt-check脚本并重新使用它,但是我想知道在这样做之前是否有现有的设备可以做我想做的事情。

更新

我最终修改了python脚本“/ usr / lib / update-notifier / apt-check”,并且基本上增加了输出来打印包详细信息,只要脚本检查了“isSecurityUpgrade()”函数。 (有关详细信息,请参阅脚本)

编辑:我的道歉不要求在评论中,但我太新了,没有代表。

如果您正在寻找来自安全回收站的信息,我将使用下面的cron从我们的未受监控的服务器每周向我发送一次电子邮件。

 #!/bin/bash #-------------------------------------------------------------------------------------------------# #- Name....: checkSecurityupdates.sh #- Notes...: #-------------------------------------------------------------------------------------------------# # create fresh securities file each run grep "-security" /etc/apt/sources.list | sudo grep -v "#" > /etc/apt/security.sources.list echo "created security specific source list" # Create the security file list echo 'n' | apt-get upgrade -o Dir::Etc::SourceList=/etc/apt/security.sources.list >> /root/securities-to-update.txt echo "created list of security updates" # What's the mimetype get_mimetype(){ # warning: assumes that the passed file exists file --mime-type "$1" | sed 's/.*: //' } # some variables from="[email protected]" to="[email protected]" subject=`hostname` boundary="ZZ_/afg6432dfgkl.94531q" body="Please see attached" declare -a attachments attachments=( "securities-to-update.txt" ) # Build headers { printf '%s\n' "From: $from To: $to Subject: $subject Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=\"$boundary\" --${boundary} Content-Type: text/plain; charset=\"US-ASCII\" Content-Transfer-Encoding: 7bit Content-Disposition: inline $body " # now loop over the attachments, guess the type # and produce the corresponding part, encoded base64 for file in "${attachments[@]}"; do [ ! -f "$file" ] && echo "Warning: attachment $file not found, skipping" >&2 && continue mimetype=$(get_mimetype "$file") printf '%s\n' "--${boundary} Content-Type: $mimetype Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=\"$file\" " base64 "$file" echo done # print last boundary with closing -- printf '%s\n' "--${boundary}--" } | sendmail -t -oi echo "sent security updates list" # cleanup security files rm /etc/apt/security.sources.list rm /root/securities-to-update.txt