0

I am working in an air-gapped environment where there is no internet.

I would like to install certain packages that are in my home directory. These packages are put here through USB device. Now, I have 50 .deb files in my home directory. And I would like to install them using sudo apt install.

Can help me on how can I make the sudo apt install command recognize this path?

I am new to Ubuntu. So, can anyone provide step by step info please?

AdminBee
  • 21,637
  • 21
  • 47
  • 71
The Great
  • 121
  • 1
  • 7
  • have you try with `dpkg` command? – Romeo Ninov Jul 06 '21 at 07:32
  • 2
    Does this answer your question? [How to install a deb file, by dpkg -i or by apt?](https://unix.stackexchange.com/questions/159094/how-to-install-a-deb-file-by-dpkg-i-or-by-apt) – muru Jul 06 '21 at 08:22

2 Answers2

5

You can use different paths:

via apt - sudo apt install /path/to/package

or via dpkg - sudo dpkg -i /path/to/package

If you want to install all packages in directory you can use something like:

sudo apt install /path/to/packages/*
Romeo Ninov
  • 16,541
  • 5
  • 32
  • 44
  • 1
    Tjanks, upvoted. Will this pick the dependencies as well? If they are in the same folder? – The Great Jul 06 '21 at 07:40
  • 1
    @TheGreat, check my edited answer – Romeo Ninov Jul 06 '21 at 07:41
  • I would like to install all 50 packages which contains their dependancies as well. Currently I wrote single sudo apt install command but it failed due to dependency. But all my dependencies are in the folder as well. How can I make the command recpgnize the dependencies and install approproately? – The Great Jul 06 '21 at 07:42
  • 1
    @TheGreat, the last command in my answer should do the work – Romeo Ninov Jul 06 '21 at 07:57
2

another way if all packages (with depencecies are in one folder)

sudo apt-get -o dir::cache::archives="Path/to/folder/with/debs" install what ever.

Only tested from me with apt-get not with apt.

nobody
  • 284
  • 1
  • 12