You didn't specify a path to a file, so apt is assuming "LocalSend-1.14.0-linux-x86-64.deb" is a package name and looking for it in the repositories.I am running this command in the directory with the deb file so I don't know why it says that it could not locate the package.
Unix / Linux generally does not include your current working directory in search path, so if you want to operate on a file in CWD you need to say so, e.g. 'apt install ./LocalSend-1.14.0-linux-x86-64.deb' (where './' denotes "this directory" with respect to CWD, '../' would mean parent directory WRT CWD etc.), or provide an absolute path to the file, e.g. 'apt install ~/Downloads/localsend/LocalSend-1.14.0-linux-x86-64.deb' (where '~' expands to /home/neo).
CWD implicitly being top of your search path is, again, a Windows (or more accurately DOS) thing.
No, he's calling dpkg --audit and, if it returns without error, echoing the exit code to the terminal. Linux is not Windows, and && is not an append, it's a conditional. STDERR has nothing to do with anything here, and there are no redirections involved.You are calling the dpkg command with the audit parameter and then appending the standard error output to somewhere but I don't follow theCode:
dpkg --audit && echo "$?"
echo "$?" part ?
'$?' is just a special variable that contains the exit code of the previous command.
Aside, the && is redundant. That command line is effectively "if the exit code of 'dpkg --audit' is '0' (no error), then print the exit code of 'dpkg --audit'".
If $? wasn't '0' then echo would not be executed, so if what you really want is to print the exit code then 'dpkg --audit; echo $?' is better since the 'echo' runs regardless.
One might as well just do 'dpkg --audit && echo "dpkg found no problems"', and get a nice human readable message.
Because apt will try to automatically resolve and install missing dependencies from what is available in the repositories. Dpkg is a lower-level tool, it will install exactly what you tell it to (and only what you tell it to), and if that is impossible because all dependencies are not already satisfied, it will fail.Why do I use apt instead of dpkg ?
Statistics: Posted by steve_v — 2024-07-09 08:01