aptitudeが嫌いな人のための低速な aptitude search '~o'

Format
Shell
Post date
2019-07-08 15:23
Zeitraum der Veröffentlichung
Unbegrenzt
  1. #!/bin/sh
  2. testpkg(){
  3. apt-cache showpkg "$1" |
  4. perl -ne 'if(/^([a-z]+):/i){$s=$1}elsif($s eq"Versions"&&/^[^\s]/){while(/\(([^\)]+)\)/g){push(@s,$1)}}END{exit((!grep{$_ ne"/var/lib/dpkg/status"}(@s))&&grep{$_ eq"/var/lib/dpkg/status"}(@s))}'
  5. }
  6. dpkg-query --show --showformat '${db:Status-Abbrev}${Package}\n' | while read line; do
  7. if echo "$line" | grep -q ^i; then
  8. testpkg "${line#???}" || echo "${line#???}"
  9. fi
  10. done
Download Printable view

URL of this paste

Embed with JavaScript

Embed with iframe

Raw text