Re: [gentoo-user] Re: update gentoo without network [SOLVED]
Neil Bothwick wrote: > On Mon, 18 Jan 2016 19:39:50 +0100, Raffaele BELARDI wrote: > >> Just tested, it works: >> >> 1. cp -a /var/db/pkg from system A to removable media >> 2. chroot ; emerge-webrsync ; emerge --fetchonly -uDvN world >> 3. cp -a /usr/portage from removable media to system A >> 4. next week, goto 1 > > Interesting, that's worthy of an entry in the wiki for anyone else > looking to maintain a Gentoo system without Internet access. I would > suggest that you update portage within the chroot. What you are doing is > lying to portage about what is actually installed, that shouldn't be a > problem most of the time given what you are using it for, but different > versions of portage on the two systems may cause problems at some time in > the future. Good suggestion about portage update. I'll check how to create a wiki entry. raffaele
Re: [gentoo-user] Re: update gentoo without network [SOLVED]
On Mon, 18 Jan 2016 19:39:50 +0100, Raffaele BELARDI wrote: > Just tested, it works: > > 1. cp -a /var/db/pkg from system A to removable media > 2. chroot ; emerge-webrsync ; emerge --fetchonly -uDvN world > 3. cp -a /usr/portage from removable media to system A > 4. next week, goto 1 Interesting, that's worthy of an entry in the wiki for anyone else looking to maintain a Gentoo system without Internet access. I would suggest that you update portage within the chroot. What you are doing is lying to portage about what is actually installed, that shouldn't be a problem most of the time given what you are using it for, but different versions of portage on the two systems may cause problems at some time in the future. -- Neil Bothwick Windows Error:01F Reserved for future mistakes. pgpAPhnPe_mvc.pgp Description: OpenPGP digital signature
Re: [gentoo-user] Re: update gentoo without network
On Mon, 18 Jan 2016 15:28:27 +0100, Raffaele BELARDI wrote: > > Download the latest portage snapshot on B > > Unpack it on A > > Run emerge -ufp @world on A and capture the output > > Use that on B to download the files > > Copy them back to A and emerge -u @world > > > > That avoids the use of a chroot altogether but involves two round > > trips across the sneakernet. You could possible save some of that by > > transferring the portage snapshot and download list as email > > attachments, assuming A has email. > Yes, I used that procedure in the past but it requires more human > effort so I'd prefer the chroot approach; also I found that sometimes > the list of files downloaded by system B was not complete and I had to > further iterate the procedure. At the time I assumed it was due to the > two systems being based on different architectures (~amd64 and ~x86), > but did not really spend much time investigating. The architecture is irrelevant, the fetching machine doesn't have to run Gentoo, or even Linux you are simply giving it a list if URLs to fetch. The output from emerge -f gives multiple URLs for each file. Instead of taking only the first one, whch may be the cause of the failures, there is an option to wget to not download duplicates, so you can pass it the full list and it keeps trying until it succeeds. As for the effort, you could automate part of the process with cron and procmail scripts. Your current approach also requires more effort than you are currently giving it, that's why it doesn't work :( -- Neil Bothwick Actually, Microsoft is sort of a mixture between the Borg and the Ferengi. pgpBoXTG1IyEI.pgp Description: OpenPGP digital signature
Re: [gentoo-user] Re: update gentoo without network
Neil Bothwick wrote: > On Mon, 18 Jan 2016 15:05:35 +0100, Raffaele BELARDI wrote: > > If you don't mind a two step approach, you could > > Download the latest portage snapshot on B > Unpack it on A > Run emerge -ufp @world on A and capture the output > Use that on B to download the files > Copy them back to A and emerge -u @world > > That avoids the use of a chroot altogether but involves two round trips > across the sneakernet. You could possible save some of that by > transferring the portage snapshot and download list as email attachments, > assuming A has email. > Yes, I used that procedure in the past but it requires more human effort so I'd prefer the chroot approach; also I found that sometimes the list of files downloaded by system B was not complete and I had to further iterate the procedure. At the time I assumed it was due to the two systems being based on different architectures (~amd64 and ~x86), but did not really spend much time investigating. raffaele
Re: [gentoo-user] Re: update gentoo without network
On Mon, 18 Jan 2016 15:05:35 +0100, Raffaele BELARDI wrote: > > On Mon, 18 Jan 2016 12:38:13 +0100, Raffaele BELARDI wrote: > > > >> I suppose the database I'm looking for is /var/db/pkg, right? > > > > /var/lib/portage/world - this needs to be in sync in the two > > environments. > > Ok but that's a 'static' snapshot of the packages; I also need to > update in the chroot the list of currently installed packages and their > versions and that's in /var/db/pkg, I think. I'll test it this evening. Yes, you do. > > Are the two computers networked together? If so, you could run > > http_replicator on B and it would download the packages for A. > > No, the computers are on completely separated networks. The only way to > bypass the security policy on one of the two networks is through > removable media ;-) I used a similar, but networked approach to build packages for slow machines in containers in a faster computer. Because I was building in the container, not just downloading, I didn't have to worry about the package database, I just synced /var/lib/portage/world* and etc/portage (excluding make.conf) and used a shared $PKG_DIR If you don't mind a two step approach, you could Download the latest portage snapshot on B Unpack it on A Run emerge -ufp @world on A and capture the output Use that on B to download the files Copy them back to A and emerge -u @world That avoids the use of a chroot altogether but involves two round trips across the sneakernet. You could possible save some of that by transferring the portage snapshot and download list as email attachments, assuming A has email. -- Neil Bothwick Time for a diet! -- [NO FLABBIER]. pgpjKQxVMrLFf.pgp Description: OpenPGP digital signature
Re: [gentoo-user] Re: update gentoo without network
Neil Bothwick wrote: > On Mon, 18 Jan 2016 12:38:13 +0100, Raffaele BELARDI wrote: > >> I suppose the database I'm looking for is /var/db/pkg, right? > > /var/lib/portage/world - this needs to be in sync in the two environments. > Ok but that's a 'static' snapshot of the packages; I also need to update in the chroot the list of currently installed packages and their versions and that's in /var/db/pkg, I think. I'll test it this evening. > Are the two computers networked together? If so, you could run > http_replicator on B and it would download the packages for A. No, the computers are on completely separated networks. The only way to bypass the security policy on one of the two networks is through removable media ;-) raffaele
Re: [gentoo-user] Re: update gentoo without network
On Mon, 18 Jan 2016 12:38:13 +0100, Raffaele BELARDI wrote: > > I have gentoo system A (~x86) on a network that does not allow portage > > access to internet due to some authentication issue. System B (~amd64) > > is on another network with no such restrictions. > > > > To bypass the restrictions I made a copy of A on a removable media, > > chroot into it from B and 'emerge-webrsync; emerge --fetchonly' from > > there. Then attach the media to A and overwrite /usr/portage with the > > updated one from the removable media. > > > > This works but updating the chroot from B always re-downloads all the > > packages since the first time I created the chroot, not only those > > from the last update. I suppose portage maintains a database of the > > installed packages that I need to copy back to the removable media > > after each system A update, but where is it? > > I suppose the database I'm looking for is /var/db/pkg, right? /var/lib/portage/world - this needs to be in sync in the two environments. Are the two computers networked together? If so, you could run http_replicator on B and it would download the packages for A. -- Neil Bothwick OK Scotty, NOW! Detonate and energize! I mean... pgpCkiCF4mTHG.pgp Description: OpenPGP digital signature