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
cd
to the place where the deb is and install in bysudo apt ./program.deb
.apt
would fix the dependencies automatically. – Pilot6 Jun 07 '20 at 15:32.deb
and runsudo apt ./program.deb
. It shows me errorInvalid operation ./program.deb
Then I changed tosudo apt install ./program.deb
and now I'm experiencing the same issue like in my first post. Butsudo dpkg -i /myprogram.deb
works fine – Serp Jun 07 '20 at 15:57/var/cache/apt/archives
and runningsudo apt-get install --assume-yes --no-install-recommends /var/cache/apt/archives/*.deb
– Alex Martian Feb 12 '23 at 08:40