Online Documentation Server
 ПОИСК
ods.com.ua Web
 КАТЕГОРИИ
Home
Programming
Net technology
Unixes
Security
RFC, HOWTO
Web technology
Data bases
Other docs

 


 ПОДПИСКА

 О КОПИРАЙТАХ
Вся предоставленная на этом сервере информация собрана нами из разных источников. Если Вам кажется, что публикация каких-то документов нарушает чьи-либо авторские права, сообщите нам об этом.




Basic Linux Training

Lesson 7: Upgrading Software and Other Administrative Tasks


Table of Contents


Upgrading from a Previous Version

After 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.

  • Backup your current configuration files - some packages will simply overwrite your existing files, and any changes you have made will be lost.
  • Make a list of the packages you plan to remove and replace.
  • Use the boot kernel floppy to boot your system - this makes it possible to remove and replace files that would be difficult or impossible to reach if you had booted from the hard disk. Log in as root. Mount your Linux partitions under /mnt (while still logged into the install floppy). For example, to mount your root ext2fs partition as the second partition on your first IDE hard disk, you would use
  • 	mount /dev/hda2 /mnt -t ext2
    
  • If you have other partitions that are part of your Linux filesystem, mount them after you've mounted the root partition.
  • Once all the partitions are mounted, you need to activate swap (if you have a swap partition or swap file).
  • Remove the packages using pkgtool - select the option 'Remove installed packages', and toggle your selections with the Spacebar as you go through the list using the cursor (arrow) keys. When your choices are all made and correct, press Enter and old packages will be cleanly removed.

Adding packages

If 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 gzip

Almost 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.tar
Or 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.gz
You 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.


Backups

Now 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.


Assignments

Textbook: Running Linux
  • Chapter 7: Upgrading Software, p.167-185
  • Chapter 8: Other Administrative Tasks, p.199-250
  • Bibliography, System Administration, p.605

Terms and Concepts:

Define and add these to your glossary:

  • ./configure
  • .gz
  • .tar.gz
  • .tar
  • .tgz
  • .Z
  • .z
  • /etc/ld.so.conf
  • /lib
  • /usr/lib
  • binary distribution
  • dynamically linked
  • ldconfig
  • make
  • Makefile
  • source distribution
  • statically linked
  • stub
  • symbolic link
  • trojan horse
  • virus

Online:

Check you CD-ROM or the LDP site online at
http://sunsite.unc.edu/LDP/HOWTO/HOWTO-INDEX.html - HOWTO Index


Go to Basic Linux Index


http://home1.gte.net/henryw/basic/basic07.html

Date last revised: 26 May 1998


Copyright © 1997, 1998 Henry White. All Rights Reserved.
Reproduction or redistribution without prior written consent is prohibited.
Address reprint requests and other inquiries to henryw@gte.net.



With any suggestions or questions please feel free to contact us