Is it safe to manually perform 'apt-get update' 's operation?
6
votes
2
answers
2653
views
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..
>
> 1. 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**)
> 2. 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..
1. **Get the list of packages to download** from the *'/etc/apt/sources.list'* conf file at the target machine..
2. **Download the meta-data** files Packages.gz **at another machine**..
3. **Copy** these files **to target machine's *'/var/lib/apt/lists'*** under appropriate filename.
4. **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.
5. **Download these packages** again **at the second machine**.
6. **Copy them to the target machine**.
7. **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
Asked by Rangaraj KS
(177 rep)
Aug 31, 2015, 06:44 AM
Last activity: Oct 7, 2019, 08:12 PM
Last activity: Oct 7, 2019, 08:12 PM