|
Basic Linux TrainingLesson 7: Upgrading Software and Other Administrative Tasks
Table of ContentsUpgrading from a Previous VersionAfter you have Linux up and running, you may want to leave well enough alone - at least, for awhile. But sooner or later you're going to you'll read or hear about some program and decide you want to install it. Or you may want to upgrade some of the software you already have to take advantage of some new feature or bug fix.Most of the major distributions update their releases every 3 to 6 months. You probably will not need to upgrade all of your software that often. The best policy is to only upgrade what needs to be upgraded - if there is some compelling reason to do so. Trying to stay on top of everything wastes time you could be using what you already have; this may be alright for hard-core geeks, programmers and sysadmins, but it's not necessary for the average user. Any time you make changes to your system, hardware or software, you would be wise to make a backup. Nasty things can and do happen; so be prepared for them. Some people feel it is better to backup everything you want saved and then reinstall from scratch; I subscribe to this. This is especially true of disk sets A and N. It's tricky to know which packages are related, your libraries and dependencies, etc., so unless you really know what you're doing there is considerable risk that you'll screw up your system with a partial upgrade. Besides, you've been through the setup program so you're familiar with it, and this will give you an opportunity to do something new without having to learn new skills - you already know how to do it. If you need to revise your partitioning scheme, this is a perfect time to do that as well. The latest version of pkgtool should provide a clean upgrade without going through a complete re-installation. RPM works similarly: remove the old software packages first, then replace them with the latest versions. You can use any of these tools with any any distribution; you do NOT have to be using Red Hat to use RPM. These are available at ftp://sunsite.unc.edu/pub/Linux/utils/package/ if you are interested. (Again, reading the documentation first and keeping notes during the procedure is the best policy.) The following sequence applies to Slackware using pkgtool, and will require some adjustments if you are using RPM.
mount /dev/hda2 /mnt -t ext2
Adding packagesIf there's something on the CD-ROM you want to install, just go through the setup program - no need to reboot. Or you can use the pkgtool program.The key is that you are always logged in as root when you add or remove packages. This is the only way you can be sure all the files and directories will be created and the links made.
tar and gzipAlmost always file are compressed to save storage space and transmission time over the Internet. The preferred format uses the GNU utility gzip which has a .gz extension. Unlike pkzip (which you may be familiar with in DOS/Windows), gzip does not compress more than one file; and, unlike with pkzip, by using gzip the original file is automatically deleted - which can give you a rude awakening if you're not prepared for it. Similarly, the gunzip utility also deletes the original file.To combine files into one large archive and retain the original directory structure, the tar utility is used. You cannot use absolute pathnames with tar, however, because the leading slash is stripped off to prevent overwriting existing files when a tar file is unarchived. You can combine these two utilities - first using tar to create an archive of the directory, subdirectories, and hidden files, then using gzip to compress that archive and delete it so that you are left with the original directory files intact and a tarred and gzipped file of it. The commands would be something like the following. tar cvf newarchive.tar .Note the trailing dot to specify the current directory will be tarred into the file newarchive.tar gzip newarchive.tarOr you could combine these on the same command line using a pipe; or use another feature of the tar utility to gzip on the fly. tar cvzf newarchive.tar.gzYou should read the section in your textbook carefully, as well as the man pages, and try using the various combinations on files and directories that can be replaced. Please note that you will tar first, then gzip to create an archive; gzip deletes the original file - in this case, filename.tar. You probably do not want to delete all the individual files in a directory which you will do by running gzip without tarring the files first.
BackupsNow you really have no excuse for not making backups - just set up a cron job to backup your system files (configuration files) and your data files (your work).Without effort, without pain, without excuse.
AssignmentsTextbook: Running Linux
Terms and Concepts: Define and add these to your glossary:
Online:
Check you CD-ROM or the LDP site online at
http://home1.gte.net/henryw/basic/basic07.html |
|||||||||||||||||
With any suggestions or questions please feel free to contact us |