-1

I need to make a list of deb files, which allows me to install things without Internet.

As we know, when we execute apt-get install XXX, we can find some deb files at /var/cache/apt/archives/. With these deb files, we can execute apt install ./*.deb to do the installation locally (without Internet).

So here is what I've done:

sudo apt-get install pkg1
sudo apt-get install pkg2
...
...
sudo cp /var/cache/apt/archives/*.deb ~/deb/

Now, I get all necessary deb files in ~/deb.

Then, I copy ~/deb to another new Ubuntu 16.04.3 and execute apt install ./deb/*.deb.

To my surprise, I found some weird errors:

1) Some debs conflict. For example, when I execute apt install ./deb/*.deb, it says that a.deb and b.deb conflict, I have to remove one of them to finish the installation.

2) After executing apt install ./deb/*.deb, the ssh of system is broken, I have to execute apt update && apt install openssh-server openssh-client to repair it.

I can't understand why the deb files coming from official source can't be installed locally properly.

Yves
  • 1,288
  • 6
  • 19
  • 34

1 Answers1

0

For local files you can use dpkg or gdebi.

E.g. dpkg -i /path/to/file.deb

Or

sudo apt-get install gdebi
gdebi /path/to/file.deb
Dawoodjee
  • 681
  • Are you sure? I was told that dpkg was dangerous because it can't find the dependencies packages automatically while installing, this is why I use apt install ./*.deb. – Yves Jun 26 '18 at 09:28
  • If dependencies aren't found, you will get a warning and a suggestion to run sudo apt-get install -f. Run that, then run your dpkg command again just to make sure. – Dawoodjee Jun 26 '18 at 11:14