Ubuntu – How to get the full name of the .deb package in command output

command linedpkgpackage-management

Is there any command which can return the full name of the .deb package in ubuntu system if I provided only the name of the package. I know there is a command which gives the information about the package such as version, architecture, etc, but I need the full name in single output which I can use for further use in my web application.

For example:

$ some command Lighttpd
lighttpd_1.4.35-4ubuntu2_amd64.deb

Best Answer

Run below command

apt-cache show lighttpd | grep Filename

Output looks like below.

Filename: pool/universe/l/lighttpd/lighttpd_1.4.35-4ubuntu2_amd64.deb

Below command will give u only the deb file name without the path. apt command can be used instead of apt-cache.

apt-cache show lighttpd | grep Filename | rev | cut -d'/' -f 1 | rev

Output:

lighttpd_1.4.35-4ubuntu2_amd64.deb