How to setup an offline Ubuntu repository on an Ubuntu machine not connected to the internet
The following procedure is useful if you have an airgapped device which is not connected to the internet and you would like to update it or simply to install something new from the repository. It is also useful on fresh installs if you have limited network connectivity or it is simply slow.
In the tutorial I am working with repository for Ubuntu Kinetic and I am using riscv64 architecture, however this tutorial will work for all modern Ubuntu releases and all officially supported architectures.
The first tool requried is aptly.
Aptly is avaliable in the Ubuntu repository:
sudo apt install aptly
Configuration
Save the configuration file in $HOME/.aptly.conf .
This example configuration file I am using is using the riscv64 architecture. Use the architecture you require, presumably amd64. I have disabled the GPG check because it is not required and makes all of this much harder to configure.
{
"rootDir": "/home/$USER/.aptly",
"downloadConcurrency": 16,
"downloadSpeedLimit": 0,
"architectures"…