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 2 2 Answers
Run below command
apt-cache show lighttpd | grep FilenameOutput looks like below.
Filename: pool/universe/l/lighttpd/lighttpd_1.4.35-4ubuntu2_amd64.debBelow 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 | revOutput:
lighttpd_1.4.35-4ubuntu2_amd64.deb 2 In short, no, because there is no direct correlation between an installed debian package, and the filename it was installed from.
You can of course construct the filename you've given an example of, by simply combining the various details about the package which are in the installed packages database, but it is not necessarily an accurate description of the file from which the package came. You could create a script to give you this inaccurate file name in several different languages.
3