When installing local DEB packages, you should use dpkg instead of apt, since apt is designed for installing packages from the remote repositories. To install your package with dpkg, use the following command:
sudo dpkg -i /path/to/my/package.deb
Replace /path/to/my/package.deb with the actual path of your own package.
In some cases, this command may fail with missing dependency errors. If this is the case, issue the following command:
sudo apt --fix-broken install
This will install the dependencies. After that, re-run the first dpkg command to install your package.
Alternatively, the program gdebi can be used instead of dpkg, since it has better resolution of dependencies without needing to apt --fix-broken install. To install gdebi, run this command:
sudo apt install gdebi-core
Now you can install your program directly using:
sudo gdebi /path/to/my/package.deb
cdto the place where the deb is and install in bysudo apt ./program.deb.aptwould fix the dependencies automatically. – Pilot6 Jun 07 '20 at 15:32.deband runsudo apt ./program.deb. It shows me errorInvalid operation ./program.debThen I changed tosudo apt install ./program.deband now I'm experiencing the same issue like in my first post. Butsudo dpkg -i /myprogram.debworks fine – Serp Jun 07 '20 at 15:57/var/cache/apt/archivesand runningsudo apt-get install --assume-yes --no-install-recommends /var/cache/apt/archives/*.deb– Alex Martian Feb 12 '23 at 08:40