[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to clone apt repository to newest only?



On Tue, Dec 26, 2023 at 10:19:26PM +0900, 이강우(KangWoo Lee) wrote:
> For example, I want to install the most recent packages when installing an
> OS in a specific closed network environment.
> 
> Of course, I could use a recently created DVD iso file, but I would need to
> have an internet connection to apply files that have been updated since
> this ISO was created, so I only want to copy and apply the most recent
> packages.
> 
> Is there any way to do this?

There are many ways, and I can't even name all of them.  I'll just
describe one way.

Assume that all of your systems are running the same release, on
the same architecture.  You might have one system (same release, same
architecture, same set of packages) that DOES have Internet access.
Maybe it's a laptop that you take to another location, or whatever.

So, periodically, you take the laptop to your grandma's house, or
whatever it is.  While there, you do an "apt-get update" and an
"apt-get dist-upgrade".  This brings in new package lists (in the
/var/lib/apt/lists/ directory), and possibly some new *.deb package
files (in /var/cache/apt/archives/).

After that's done, you bring the laptop to the isolated network.  Then
you rsync the /var/lib/apt/lists/ directory to all the other computers.
Next, you share your /var/cache/apt/archives/ via NFS, and mount it on
all of the other computers.

Finally, you do an "apt-get dist-upgrade" on all the other computers.
They'll use the lists that you copied to them, and the NFS-shared
package archive.

Once that's all done, unmount the /var/cache/apt/archives/ directory
from the other systems, and you're all set for a while.

If the laptop starts to fill up, you can do "apt-get autoclean", but
be very careful NEVER to run "apt-get clean".


Reply to: