Well, as you said, the name foo_VVV-RRR_AAA.deb
for a deb file is just a convention for naming .deb
files, where VVV
, RRR
and AAA
are the version, revision and architecture of the package foo
.
Also, this convention is suggested (dictated) when building packages with debuild or git-buildpackage.
If you agree with this convention is ok, if not, you can rename your .deb
files as you wish, but only by following these rules (in this case maybe you must to run dpkg --info <deb_file>
to find a simple information that normaly you can get using the above convention for a deb file name).
Now, as you can read at Filename - Wikipedia:
There is no general encoding standard for filenames.
Because file names have to be exchanged between software environments (think network file transfer, file system storage, backup and file synchronization software, configuration management, data compression and archiving, etc.) it is very important not to lose file name information between applications. This led to wide adoption of Unicode as a standard for encoding file names, although legacy software might be non-Unicode-aware.
[...] Filename maximum length is not standard and might depend on the code unit size. Although it is a serious issue, in most cases this is a limited one.
So, if there is no standard for file names in general, I am almost sure that there is not a special standard for .deb
file names. Or, if you are still confused, take the convention as a standard, and follow these rules.
Create a script, in my example foo
#!/bin/bash
# Create a temporary folder in /tmp
dir=$(mktemp -d)
# Extract the deb file
dpkg -x "$1" "$dir"
printf "\n%s\n\n" "$1"
# Show the package architecture information
dpkg --info $1 | \
awk '/Architecture/ {printf "defined dpkg architecture is:\t%s\n", $2}'
# Show the executable format via find and awk for ELF
find $dir -type f -exec file -b {} \; | \
sort -u | \
awk '/ELF/ {printf "executable format is: \t\t%s\n", $0}'
rm -rf "$dir"
exit 0
Usage
./foo <deb_file>
Example
% ./foo qtox_1.1\~git20150707.cfeeb03-97_i386.deb
qtox_1.1~git20150707.cfeeb03-97_i386.deb
defined dpkg architecture is: i386
executable format is : ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, stripped
Best Answer
Run below command
Output looks like below.
Below command will give u only the deb file name without the path.
apt
command can be used instead ofapt-cache
.Output: