I am trying to keep one my Ubuntu systems up-to-date. The intended target is Not Connected to the internet. Am trying to get all the needed info from another machine with internet access.
After a bit of study, I found a way to achieve this. Can you please tell me if this is correct & safe?
Here is my understanding of the apt-get process..
- First, we run the command 'apt-get update' : This connects to all the repositories mentioned in the '/etc/apt/sources.list'.. And, downloads all the Packages.gz files like (in.archive.ubuntu.com/ubuntu/dists/trusty/main/binary-amd64/Packages.gz) & saves them in a similar name under '/var/lib/apt/lists' (for the above mentioned url the corresponding file is in.archive.ubuntu.com_ubuntu_dists_trusty_main_binary-amd64_Packages)
- Then, when we run 'apt-get upgrade' (or) 'apt-get install pkg_name', this checks the locally installed package list with the local meta-data downloaded & stored at '/var/lib/apt/lists'. And, then gets the download url from that & asks for user confirmation before downloading & installing the required packages.
This is my plan to keep the isolated machine up-to-date..
- Get the list of packages to download from the '/etc/apt/sources.list' conf file at the target machine..
- Download the meta-data files Packages.gz at another machine..
- Copy these files to target machine's '/var/lib/apt/lists' under appropriate filename.
- Run the 'apt-get --print-uris upgrade' (or) 'apt-get --print-uris --yes install pkg_name' to get the list of all the packages needed for that machine.
- Download these packages again at the second machine.
- Copy them to the target machine.
- Run the 'dpkg -i pkg_list' to install all the missing packages.
I am able to achieve my goal using this process.
My question is : Is this correct & reliable? Or is there an easier way to achieve this?
Rangaraj