AutoUpdate is a Perl script which performs a task similar to RedHat's up2date or autorpm. It can be used to automatically download and upgrade rpms from different (s)ftp or http(s) sites. Moreover, it can also be used to keep a server with a customized (RedHat) distribution plus all clients up to date. I have tried to write it in such a way that it is not RedHat specific and hence it should work with any other rpm based distribution as well.
The download mode will connect to a given remote site (currently file, ftp, http, https and sftp are supported) and compare all rpms found to either your rpm directory or, if no rpm directory is set, to the installed rpms. Then all updated versions of rpms you already have will be downloaded. The remote site can be given on the command line or in a configuration file.
The get mode is similar to the download mode, except that rpm names (without version) can be given on the command line and those rpms will then be searched for on the remote sites.
The update/install mode will compare rpms given on the command line or in the update directory to the installed ones. In update mode only new rpms for which an older version is installed will be upgraded. Install mode is similar but will also install rpms for which no old version was previously installed.
First all rpms (except kernel packages) will be upgraded. If there are unresolved dependencies, it will check if any other rpms in the update or rpm directory can be used to satisfy them and add all necessary ones.
Then it will install new kernel rpms (unless disabled) and, at your request, add the images to the boot manager.
You can think of autoupd as a smarter version of rpm -F and autoins as a smarter version of rpm -i respectivley rpm -U.
This mode is used to merge new rpms from the update directory into the rpm directory (removing the old ones).
This mode is used to purge old rpms from the update directory.
# autodld Found no new rpms at ftp.mat.univie.ac.at. New rpms from ftp.univie.ac.at: rsync-2.-13.i386.rpm Upgrading rpms: rsync-2.-13.i386.rpm Removing updated rpms: rsync-2.-13.i386.rpm
Alternatively, if you already have the rpms, you can use
to upgrade your system. If you use autoins instead, all rpms will be installed even if no older versions are present. This is similar to rpm -F and rpm -U with the two differences that AutoUpdate will select the right rpm (architecture, latest version) and it will try to resolve dependencies. Note that autoupd and autoins will not perform the download part, so unless you already have the rpms in your updates directory, nothing will happen!
Moreover, the command
autoget --url ftp://ftp.redhat.com/pub/redhat/linux/7.2/en/os/i386/RedHat/RPMS zip
will search the given url for an rpm named zip. If found, the rpm will be downloaded and installed. Of course, you can setup *.get config files for all sites you want to search. If you do this you can install the latest version of nedit using
# autoget nedit New rpms from ftp.univie.ac.at: nedit-5.5.5-20.i386.rpm lesstif-0.92.32-6.i386.rpm Downloaded total of 2 rpms. Installing rpms: lesstif-0.92.32-6.i386.rpm (new) nedit-5.5.5-20.i386.rpm Installed total of 2 rpms. Removing updated rpms: lesstif-0.92.32-6.i386.rpm nedit-5.5.5-20.i386.rpm
Note that it automagically found out that nedit requires lesstif and handled all dependencies for you. It can even read the requested rpms from a RedHat-type comps file. So if you forgot to choose Software Development you can just say
# autoget "@Software Development"
and it will install all rpms from this section for you. Similarly, if you forgot to select KDE, just say autoget "@KDE". To install all rpms from a comps file which are selected by default, use "@+" and to install everything from the comps file use "@++".
Finally, here is a more complicated task: Upgrading a RedHat 7.2 system to KDE3
# autodld --dldall --url ftp://keen/pub/rpm/kde3/ New rpms from keen: Xconfigurator-4.10.7-1.i386.rpm ark-3.0.0-1.i386.rpm arts-7:1.0.0-1.i386.rpm arts-devel-7:1.0.0-1.i386.rpm cups-libs-1.1.14-10.i386.rpm . . . noatun-3.0.0-1.i386.rpm qt-3.0.3-5.i386.rpm qt-MySQL-3.0.3-5.i386.rpm qt-ODBC-3.0.3-5.i386.rpm qt-PostgreSQL-3.0.3-5.i386.rpm qt2-2.3.1-2.i386.rpm qt2-Xt-2.3.1-2.i386.rpm qt2-designer-2.3.1-2.i386.rpm qt2-devel-2.3.1-2.i386.rpm qt2-static-2.3.1-2.i386.rpm cups-1.1.14-10.i386.rpm Downloaded total of 100 rpms. Upgrading rpms: hwdata-0.9-1.noarch.rpm (new) Xconfigurator-4.10.7-1.i386.rpm cups-libs-1.1.14-10.i386.rpm (new) qt2-2.3.1-2.i386.rpm (new) kde2-compat-126.96.36.199.5-2.i386.rpm (new) libusb-0.1.5-2.i386.rpm (new) arts-1.0.0-1.i386.rpm kdegames-3.0.0-1.i386.rpm kdebase-3.0.0-2.i386.rpm kdelibs-3.0.0-4.i386.rpm qt-3.0.3-5.i386.rpm . . . kuickshow-3.0.0-3.i386.rpm kxmlrpcd-3.0.0-1.i386.rpm libxslt-1.0.15-1.i386.rpm Upgraded total of 52 rpms.
Note that for this to work I had to rename arts-1.0.0-1.i386.rpm to arts-7:1.0.0-1.i386.rpm such that AutoUpdate can read off the EPOCH tag (7 in this case) from the file name, since there is no way to tell from the filename that arts-2.2.2-4.i386.rpm is older than arts-1.0.0-1.i386.rpm. This is not necessary if you download arts by hand or if you use an repositry with an autoinfo file.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Alternatively you can also redistribute it under the terms of the Perl Artistic License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Please see the included file LICENSE for a copy of the GNU General Public License. If this file is missing, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.