What am I trying to do?
On the Mac with internet access, I would like to have packages such as nvm
, node
, npm
, wine32
, etc. to be installed on the Linux (Ubuntu 18.04) with no internet. The packages will be transferred via burned on a CD.
Usually how in Windows a user downloads an .exe
and transports that file to another computer and install there, essentially that is what I want to replicate.
What have I tried?
I’ve seen the https://packages.ubuntu.com
website but get confused on the architecture download part. There is no specification on what architecture to get. When I click on the links for a particular download, say https://packages.ubuntu.com/bionic/i386/wine32/download
, the link goes nowhere for me. There is no download for me. Sometimes I see packages ending in .deb
or .tar.xz
and unsure of which one to download.
In order:
- How do I properly get packages I need on the Mac to be ready to install on Linux? (Is there a proper website to use to download said packages or command line?)
- How do I install it on Linux using the terminal? (I’ve read around to do
apt
ordkpg
?)
>Solution :
One option would be to use the --download-only
option with apt
, which will include all of the dependencies required by packages. You will, however, need to first create a VM of 18.04 – ideally the very same version you’ve air-gapped – on your Mac.
The process would go something like this:
-
Create a VM of Ubuntu 18.04 on the Mac using VirtualBox or another tool of your choice
-
On the VM, open Terminal and download the packages you need:
sudo apt --download-only -o Dir::Cache="/home/{user}/Downloads" \ -o Dir::Cache::archives="./" install {package name}
Although this will look like it’s going to install the software, the
--download-only
option limitsapt
to just downloading the packages plus dependencies. TheDir::Cache
option allows you to specify where you want the.deb
files placed. -
Once you’ve obtained all of the packages that you need, copy the files to a USB stick or optical disc and install them on the air-gapped system:
sudo apt install /path/to/package.deb
This can be annoying the first time but, if you are regularly working with air-gapped systems, this option will allow you to create predictable and consistent installation media which will continue working long after a version of Ubuntu is no longer supported.