Hoặc với dpkg:
dpkg -l | awk '/^.i/ {print $2}' | xargs apt-cache policy | awk '/^[a-z0-9.\-]+:/ {pkg=$1}; /\*\*\*/ {OFS="\t"; ver=$2; getline; print pkg,ver,$2,$3}'|grep -v /var/lib/dpkg/status| sed -e 's/://'|awk '{printf "%-40s %-36s %-36s %-16s \n",$1,$2,$3, $4}' | grep -i yourkeyword
Ví dụ
dpkg -l | awk '/^.i/ {print $2}' | xargs apt-cache policy | awk '/^[a-z0-9.\-]+:/ {pkg=$1}; /\*\*\*/ {OFS="\t"; ver=$2; getline; print pkg,ver,$2,$3}'|grep -v /var/lib/dpkg/status| sed -e 's/://'|awk '{printf "%-40s %-36s %-36s %-16s \n",$1,$2,$3, $4}' | grep -i multimedia
trả về:
audacious 1:3.8.2-dmo1 http://www.deb-multimedia.org stretch/main
audacious-plugins 1:3.8.2-dmo1 http://www.deb-multimedia.org stretch/main
audacious-plugins-data 1:3.8.2-dmo1 http://www.deb-multimedia.org stretch/main
snipp
Điều này cho tôi thấy các gói từ deb-multidia.org. Kết quả tương tự vớidpkg-query -W -f='${Section}\t\t${Package}\n' | awk '/^.i/ {print $2}' | xargs apt-cache policy | awk '/^[a-z0-9.\-]+:/ {pkg=$1}; /\*\*\*/ {OFS="\t"; ver=$2; getline; print pkg,ver,$2,$3}'|grep -v /var/lib/dpkg/status| sed -e 's/://'|awk '{printf "%-40s %-36s %-36s %-16s \n",$1,$2,$3, $4}' | egrep -i multimedia