PDA

View Full Version : How to update unix programs?


Ellen
02-25-2002, 01:07 PM
Hello,

I would like to know how one is supposed to install updates for unix programs.

Having read all the problems with Apple Mail Server on Mac OS X Server, I chose to install Postfix. This did take some reading but finally worked quite easily. Postfix is updated quite regularly and since the version I installed, snapshot-20020112, there has apparently been a new stable version and four patches.

I understand that the patches are actually diff files that must be applied to the source tree. I suppose this is done with the patch program. But I can't find any instructions as to how to actually do this. What options to use? Where to put the patches? And what to do once the patch has been applied. Make and make install? And what happens to my configuration file? Can I use the old one or must I start from scratch?

Also, I suppose that to install a new release I have to go through the whole compile etc. process from the start. What happens to the old files? Is there any cleaning up to do? And if yes, when?

I figure these questions apply to any program and I've looked in the five or six unix books I've purchased, in the Postfix mailing list archive, etc., I've read the patches, and the various read me files and documentation that come with Postfix. To no avail. Actually, in the Postfix mailing list some other users (Mac OS X users...) have asked the very same question and there was apparently no answer, at least on the list itself.

I've even read the man page for patch but it assumes knowledge that I don't have.

Is this absolutely obvious to all unix users from day one so that no one feels the need for any instructions or have I overlooked something?

Thanks,

Ellen

mervTormel
02-25-2002, 02:26 PM
yeah, pretty scant info out there on patch, but the man pages do say that it is usually:

patch -pnum < patchfile

FWIW, an example:

http://www.trilobyte.net/barnsons/html/osx.html

Ellen
02-25-2002, 03:16 PM
OK, I see the example uses only patch <patchfile and the man page says "usually" patch -pnum <patchfile. Fine. But how would I know what "num" to use. Yes, I've read what the man page has to say on -pnum. I don't even know in what directory I should place the patch...

Anyway, as stated in the first post, before applying any patches I suppose I'll have to reinstall the new release entirely. How do I do this? Just go through the steps exactly the way I did for the original install without first removing anything?

Since the release integrates the latest patches, if all goes well I'll only need to apply a patch when a new one comes along.

Ellen

mervTormel
02-25-2002, 03:55 PM
i think it's probably a simple matter without any supplied instructions.

prudence suggests you copy your current working source distribution somewhere so you have something to go back to if anything goes wonky.

then...

drop the patchfile in the distribution dir, where the configure, make and install files are. then...

patch < patchfile

you won't use a -pnum if you haven't jostled the source around.


./configure # perhaps
make
sudo make install

these should run pretty quick since only the changed/patched files need to be re-compiled.
before applying any patches I suppose I'll have to reinstall the new release entirely. How do I do this? Just go through the steps exactly the way I did for the original install without first removing anything?

you certainly wouldn't want to apply a patch for release 2 to a release 1 package.

install the new release entirely, you don't need to remove anything. follow the instructions in the new release, probably the same steps as previous release.

optionally, apply any patches _you need_ since the new release. unless the patches are needed, you could wait until the next release, which would incorporate the patches since the last release, right?

let us know how that works.

Ellen
02-25-2002, 04:13 PM
Ah, I'm beginning to see the light. However, since this is a server that is in use, and needs to stay that way, I am going to install a test machine and try things out before doing anything to the production server.

While I was trying things out the first time around, the working server was still running ASIP with system 8 something... When I was convinced it would work, I switched. But now, to fiddle around I need to install another OS X server. May have to wait for the weekend.

Thanks,

Ellen

mervTormel
02-25-2002, 04:25 PM
yeah, it's best to not stomp on a production installation. always best to sandbox these things if you can.

set yourself up a sandbox dev/QA area that's as close to production as possible, but make sure it can't write to live production data. and test test test.

then, you could schedule downtime (your weekend, in the middle of the night *sigh*) to implement and test the new release. things are always different from sandbox to production.