RPM installation via http

Rick Stevens rstevens at vitalstream.com
Fri Sep 8 20:26:38 UTC 2006


On Fri, 2006-09-08 at 09:41 +0100, Stuart Sears wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Rick Stevens wrote:
> > On Wed, 2006-09-06 at 11:36 -0600, redhat at buglecreek.com wrote:
> >> Is anyone aware of a way to install multiple rpm packages via a http
> >> server on a local lan.  For example, two systems running the same
> >> version of redhat os. One server has apache running on it and has all
> >> the packages in /var/www/html/up2date/ via a sym link to
> >> /var/spool/up2date.  When I try to do rpm -Fvh
> >> http://192.168.100.2/up2date/*.rpm I get the following error: "error:
> >> File not found by glob: http://192.168.100.2/up2date/*.rpm"  When I try
> >> this with a specific rpm package name it works fine.  When I connect a
> >> browser to the http server all the packages are there.  I know I could
> >> use a nfs mount to accomplish this, but would like to do this via http
> >> if possible.  We have all the entitlements to cover the various boxes,
> >> but due to bandwidth issues at field offices it would be nice to be able
> >> to share these updates between like boxes on local lans without having
> >> to hit rhn or
> >> our HQ rhn proxy.
> > 
> > You have to remember that globbing on a command is processed by the
> > shell BEFORE the command is executed.  The glob won't work on HTTP or
> > FTP operations since the shell doesn't know how to use HTTP or FTP to
> > get filelists.  I think rpm itself is smart enough to do what you need,
> > so you might try the command:
> <snip interesting bit about update...>
> 
> Actually, despite this, rpm installs over ftp do support wildcards. I
> would expect this to be interfered with by the shell too, but I
> regularly run commands like this:
> 
> rpm -Uvh  ftp://server/pub/RPMS/zsh-*.rpm
> and it fetches all matching packages before attempting to install them
> (of course the horrendous dependency chain then comes into operation...)

Ah, but the FTP protocol supports globbing...HTTP does not.

> 
> HTTP on the other hand does not work. I think this is because of the
> command being run on the remote server - prolly a simple GET <filename>,
> which would require a complete, existing remote filename or the http
> server would respond with a 404 error.
> 
> I think the FTP command is running some form of mget <pattern> which is
> why wildcards work.

Yes.  As I said, FTP supports globbing.  Most FTP clients enable
globbing by default and it must be disabled if you want to use globs
literally:

	ftp> glob on
	ftp> glob off

> I believe that bash is not interfering at all - there will be no logical
> local completion for a path like "http://server/*.rpm" (or ftp://...) so
> I would guess the * is passed verbatim to rpm - it seems the only
> logical explanation to me.

It probably is.  I'm surprised that rpm doesn't recognize the limits of
http, but hey...
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-      To err is human, to forgive, beyond the scope of the OS       -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list