[CentOS] Yum w/o direct connect

Sun Aug 6 15:40:35 UTC 2006
William L. Maltby <BillsCentOS at triad.rr.com>

On Sun, 2006-08-06 at 08:30 -0400, Ted Miller wrote:
> I am hoping someone else is already doing what I need to do, and can give
> me some pointers.
> 
> Situation:
> 1. I am running Centos 4.3 x86_64 on a machine at home, without broadband
> access.  I have dial-up access, but that doesn't work very well for
> something like "yum update", so I am still running 4.3 as issued on the CDs.
> 2. I have high speed access at work, and I have a USB drive to move files
> from work to home.

If it's decent sized, just put your masters of everything right there.
Then mount appropriate parts (remember that we can mount subdirs too
these days, IIRC) over /var yum and rpm dirs or *better*, update config
files in /etc to point to the mountable drives dirs. Makes backups to
the HDs.

If the USB is not large enough, use a CD (CD-RW or DVD-RW would be
great). These can be used in standard form (ISO-9660 or whatever, as
well as ext2, udf or as raw archives like tar or cpio) to best meet your
needs. In the U.S., CD-RW is cheap these days, after rebates or even in
big discount stores. Internal especially.

> <snip>

I haven't had to do what you are looking at, but Dag (rpmforge) has
mentioned "yam" in connection with doing things with local repos if this
is what you are facing.

I don't *know* that it will help, but I thought you should be made
aware, if not already on to that.

> Proposed solution (other than get broadband):
> A. Make a "pretend repo" on the hard drive of home machine by:
>    1. Install yum "index" file for each repo in directories at home.  Use
>       rsync via dialup to keep those repo "indexes" up to date (after
>       initial install).  [A sample rsync command line would be helpful.]

Again, I haven't done this, but I would think the "index" master should
be on the portable media, with backup(s) on the HDs. That let's you know
exact status regardless of connect location.

>    2. Persuade yum to give me a list of packages (that I need to download
>       in order to execute a package install or update) and capture that
>       list in a format that I can feed into rsync (at work).

Yum has commands that help determine dependencies, as does rpm. You'll
need to do a little (very little?) massaging (bash, perl, sed, (g)awk or
some such) to get the format you want out of it.

>    3. Have a way to separate package list into three categories:
>       a. Packages already in correct version my local repository.
>       b. Packages needing an update in my local repo.
>       c. Packages I need to download wholesale.

I think if your master "index" is on the portable media, b. and c. are
side effects of running yum. BTW, a good (but slightly dangerous) way to
get this is to run yum update (or install) and then say NO when it asks
to confirm install. This NO is very important!

Anyway, the screen can be copied and pasted into a file to give you the
info that can be edited into a form you like.

There are also "deplist", "provides" and "whatprovides" options (yum)
and "provides", "requires", "whatprovides" and "whatrequires" (rpm) that
might be helpful.

With rpm, the "queryformat" option can reduce your editing. Placed in
the .rpmmacro file in $HOME, something like this:

   $ cat .rpmmacros
   %_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch}
   $

>    4. Have a way to copy packages needing updates to USB drive.

Should be no problem in Linux?

>    5. Take list of packages to work, and use rsync to transfer/update the
>       packages onto the USB drive.

Consider the "yam" and my above thoughts to see if maybe the need is
adequately addressed. Again, I've not done it, so I don't know. I just
know what I would start looking at to design my solution.

>    6. Bring USB drive home and dump contents into local repo.

As backup, right? If size of portable media permits, it can be master
and mounted as needed.

>    7. Run yum to do the updates.
> I think this is how to do things in general terms, but I could use a good
> bit of help in coming up with some scripts to automate/semiautomate the
> process.  I think #3 may be the hardest one to automate.

Unless someone has time and common interest, you may need to develop the
functional spec for the script, do some rudimentary coding (essentially,
what did you type at the console to do the job once or twice) and then
ask for help in refining and automating it. My guess is that will get
you more offers of assistance.

> 
> Anyone doing this?  Anyone good with rsync and yum, and care to give me a
> starting point, even if your try is untested?  Console approach is fine
> (GUI OK too), but I am new to yum (moving from Mandriva), and have used
> rsync a few times successfully, but am no master at it.

Just knowing how this list thinks (not me of course, I am such a nice
guy  ;-) I think a good starting point (*if* you haven't done it yet)
would be to hit the yum and rpm docs that the CentOS site can point you
to. Also, check out the Yam" stuff in case Dag has a bunch of the heavy
lifting already accomplished.

Get more familiar with rsync, just in case you have to stroke a little
harder on your own than you really would like.

> 
> Also, I have 4 install disks.  Which repos are on those disks, and which
> repos are on which ones?  Do any of them include CentOS Plus?

I recall threads that mention that the installs can be used for a lot,
but I have no details. A useful command might be

   find <cd mount point> -type d

Should find some directories with interesting names there.

> 
> Ted Miller
> CentOS 4.3 x86_64
> <snip sig stuff>

Sorry I could not be more specific help. But I figured on a Sunday, you
might not get a lot of replies to get you started, so thought I would
offer my thoughts.

HTH
-- 
Bill
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.centos.org/pipermail/centos/attachments/20060806/c99d4060/attachment-0005.sig>