The two variants look for the package in different locations (unless the current directory is the root directory).
sudo apt install ./path/to/package/name.deb
looks for a package file named name.deb
, in the subdirectories path
, to
, package
, starting from the current directory (.
). This only works if the current directory contains a directory named path
, which itself contains a directory named to
, which itself contains a directory named package
, which contains the file name.deb
.
sudo apt install /path/to/package/name.deb
looks for a package in the directory /path/to/package
, i.e. the same sequence as above, but starting from the root directory, not the current directory.
Put another way, ./
isn’t part of the apt
syntax, it’s part of the file’s path, and interpreted as usual for paths.