Suppose you have a certain program /usr/bin/myprogram
that you want to run also on another system. You could of course just copy the executable file to the remote system, but maybe the program needs some other files to work properly. For instance:
/usr/bin/myprogram # main program
/usr/lib/mylib # library necessay to run the program
/etc/myprogram.conf # configuration file
You could still take every single file and transfer it to another system but it make things a little easier to put that all together into one file which you then could transfer to the target system. i.e. you could use a tar
archive, put the three files necessary into it and then unpack that on the target system to have all three files put into their respective place at once. That would at least guarantee that you will not forget one of the files when you copy the program to the new system.
Now, the program, in order to run properly, may need to have some adjustments be done on the system too: maybe it uses a special user account to run which has to be created, maybe it should be started at system start so you need to create startup routines and put their call to the system startup files (in AIX /etc/inittab
, in Linux in systemd
configuration files, etc.) and so on. So, in order to not forget any of these things, you may create some sort of script that does that for you and put that into the tar
archive too.
But there still is a problem: you may need not only to put the program onto systems, you may eventually want to remove it from some of them after a while. For this you do not want to leave a trace of leftovers and ideally after installing it and removing it the system should be in the same state as before. That includes, in addition to removing the files you put there, you need to remove all changes made to already existing files, removing user accounts created, etc.. You may want to write another script to do this again because if you do it manually yo may forget the one or other thing.
Now, wouldn't it be great to have a program for all that? A program which you can tell which files to install, which actions to take upon installation, upon deinstallation, upon updating, and so forth? Exactly this is a package and the program to use such packages is called a package manager. rpm
("RedHat Package Manager") is one of such package managers, developed for Linux but now available on many systems. installp
is the package manager for AIX. AIXpackages come in a certain format ("backup file format", bff, which is why they all have the extension ".bff") and there is a program makebff
which you can use to create such packages.
You should read up on how to work with packages in general and AIX packages in specific (there is an IBM Redbook about this) before attempting to automate your work with packages though. Building and maintaining packages is not easy and you don't learn it in minutes. It is easy to create very bad packages which will even increase your administration work and make it more complicated. It can take some effort and experience to create well-crafted packages that will help you a great deal in your daily work.
I hope this helps.
bakunin