Quantcast
Channel: sleeplessbeastie's notes
Viewing all articles
Browse latest Browse all 770

How to get name of the source package

$
0
0

There are many applications that share the same source package, so I will show three different ways to print the name of the source package.

The first method is to print package information and filter out required information.

$ apt-cache showsrc linux-image-amd64 | grep Package: | awk '{print $2}'
linux-latest
$ apt-cache search --full "^vim-tiny\$" | grep "Package\|Source" | cut -d "" -f2 | tac | tr  "\n""" | awk "{print \$1}"
vim

The second method is to simulate source package download.

$ apt-get source -s liblzma5 | sed '$!d;s/Fetch source //'
xz-utils

The third method is to query Debian package database, but it only works for installed packages.

$ dpkg-query -W -f='${Source} ${Package}\n' sshfs | awk '{print $1}'
sshfs-fuse

Viewing all articles
Browse latest Browse all 770

Trending Articles