This is a small bash utility function to allow renaming deb
archives according to their version.
rename-deb ()
{
base="${1%.deb}";
version="$(dpkg-deb -f $1 Version)" || return 1;
new="$base-$version.deb";
mv -i "$1" "$new";
echo "$1 -> $new"
}
You can either run it one time in your shell, or define it in your ~/.bash_aliases
.
Example:
$ rename-deb zoom_amd64.deb
zoom_amd64.deb -> zoom_amd64-5.5.7011.0206.deb
The dpkg-dev package contains the dpkg-name(1) tool which can do this using the canonical filename format.
Thanks, I was not familiar with
dpkg-name
. Sounds like a better solution.