Mailing List Archive

Updating An Unconnected Machine
Hello,

I have Gentoo installed on a machine that has no connection to
the Internet. The configuration of this machine is very similar
to another machine, which _has_ an Internet connection, also running
Gentoo. Only the CFLAGS variable differ.

Would it be possible to keep this unconnected Gentoo machine updated
by simply copying the entire portage directory, including distribution
files, from the connected machine?

I need to know what happens after doing "emerge --sync" followed
by "emerge -Du world". I assume that only the portage directory
is affected, that is, only those directories defined by the
PORTDIR, DISTDIR, PKGDIR, PORT_LOGDIR, PORTDIR_OVERLAY, and
PORTAGE_TMPDIR variables in the file make.conf. If this is
true, then copying those directories to the the unconnected
machine would allow me to update that machine, using emerge,
in parallel with the conected machine and without needing an
Internet connection.

Would this method be feasible? Unless I am overlooking some details
of the emerge process, I don't see any problems with it.

Frank Peters
Re: Updating An Unconnected Machine [ In reply to ]
you can copy portage and distro files from connected machine (i.e it
will just serve as your local mirror), but you need to run emerge -Du
world on the unconnected machine, since it has different CFLAGS

On 04/29/10 11:42, Frank Peters wrote:
> Hello,
>
> I have Gentoo installed on a machine that has no connection to
> the Internet. The configuration of this machine is very similar
> to another machine, which _has_ an Internet connection, also running
> Gentoo. Only the CFLAGS variable differ.
>
> Would it be possible to keep this unconnected Gentoo machine updated
> by simply copying the entire portage directory, including distribution
> files, from the connected machine?
>
> I need to know what happens after doing "emerge --sync" followed
> by "emerge -Du world". I assume that only the portage directory
> is affected, that is, only those directories defined by the
> PORTDIR, DISTDIR, PKGDIR, PORT_LOGDIR, PORTDIR_OVERLAY, and
> PORTAGE_TMPDIR variables in the file make.conf. If this is
> true, then copying those directories to the the unconnected
> machine would allow me to update that machine, using emerge,
> in parallel with the conected machine and without needing an
> Internet connection.
>
> Would this method be feasible? Unless I am overlooking some details
> of the emerge process, I don't see any problems with it.
>
> Frank Peters
>
Re: Updating An Unconnected Machine [ In reply to ]
On Thu, 29 Apr 2010 13:09:59 -0600
Dmitri Pogosyan <pogosyan@phys.ualberta.ca> wrote:

> you can copy portage and distro files from connected machine (i.e it
> will just serve as your local mirror), but you need to run emerge -Du
> world on the unconnected machine, since it has different CFLAGS
>

Yes, it is my intention to run "emerge -Du world" on the
unconnected machine.

I suppose my actual question is whether or not "emerge --sync"
updates anything else other than the ebuilds and other associated
files of the portage directory, and I suppose that it does not.

So copying the updated portage tree (updated via "emerge --sync")
and copying the distribution files (acquired via "emerge -Du world")
from the connected to the unconnected machine will allow an update
by running "emerge -Du world" on the unconnected machine.

I thought that I may be missing some details somewhere and that's why
I raised the question on this list.

Frank Peters
Re: Updating An Unconnected Machine [ In reply to ]
Frank Peters wrote:
> I have Gentoo installed on a machine that has no connection to
> the Internet. The configuration of this machine is very similar
> to another machine, which _has_ an Internet connection, also running
> Gentoo. Only the CFLAGS variable differ.
>
> Would it be possible to keep this unconnected Gentoo machine updated
> by simply copying the entire portage directory, including distribution
> files, from the connected machine?
>

I normally do that but with a different method: I copy the latest
portage snapshot.tar.lzma to /var/tmp/emerge-webrsync and then run
emerge-webrsync.
Re: Updating An Unconnected Machine [ In reply to ]
On 04/30/10 13:27, Frank Peters wrote:
> On Thu, 29 Apr 2010 13:09:59 -0600
> Dmitri Pogosyan <pogosyan@phys.ualberta.ca> wrote:
>
>> you can copy portage and distro files from connected machine (i.e it
>> will just serve as your local mirror), but you need to run emerge -Du
>> world on the unconnected machine, since it has different CFLAGS
>>
>
> Yes, it is my intention to run "emerge -Du world" on the
> unconnected machine.
>
> I suppose my actual question is whether or not "emerge --sync"
> updates anything else other than the ebuilds and other associated
> files of the portage directory, and I suppose that it does not.
>
> So copying the updated portage tree (updated via "emerge --sync")
> and copying the distribution files (acquired via "emerge -Du world")
> from the connected to the unconnected machine will allow an update
> by running "emerge -Du world" on the unconnected machine.
>
> I thought that I may be missing some details somewhere and that's why
> I raised the question on this list

I don't think there's anything wrong with that. Gentoo (and by
extension, portage) is an OS with comparatively very little magic
compared to other distros. I'm sure that you are aware that with your
current scheme, you can only install on the unconnected machine,
programs that is also installed on the host machine (and perhaps ones
which you run 'ebuild fetch' manually).

And probably you should take care not to overwrite the unconnected
machine's "world file" if you plan to have different set of programs
installed on both machine.

Portage creates downloadable daily .tar.bz2-ed snapshots of /usr/portage
for use on newly installed machine (look at the "Installing Portage"
step in the familiar handbook). You might want to look at what they're
packaging there (or even use that archive, perhaps).
Re: Updating An Unconnected Machine [ In reply to ]
On 04/29/2010 03:09 PM, Dmitri Pogosyan wrote:
> you can copy portage and distro files from connected machine (i.e it
> will just serve as your local mirror), but you need to run emerge -Du
> world on the unconnected machine, since it has different CFLAGS
>

With portage (and not necessarily other package managers) it updates
everything it needs to when you run any command, like an emerge -pu world.

I'd also note that I think the default rsync install in gentoo gives you
an rsyncd.conf that will share /usr/portage. If you get rid of the
distfiles exclude in it that might be a really easy option for you.
Just change your make.conf to point to your other internal box and do an
emerge --sync.

I think that paludis might need a few extra commands to regenerate its
cache files, but I'm not 100% on how portage metadata caching works and
how other PMs handle this.

When I make chroots I usually just bind mount or copy /usr/portage as
needed. Just used the rsync trick to update my EC2 ami an hour ago...

Rich