In what follows, I assme that you have already installed Apple's recent X window system (X11-1.1) and developer tools (Xcode-2.2). If you haven't, install them before you proceed. Notice also that I am going to use bash unless otherwise stated.
First you need to install apt with rpm from a tarball. If you have not yet activated the root account, activate it by following the instruction given here so that you can "su" to root. Then type in the following from a terminal window to install the apt with rpm support:$ su
# tar -zxvf tgz/apt-0.5.15cnc7-bin-1a.tar.gz -C /
# export PATH=$PATH:/usr/local/bin
Notice that when the prompt is '#', it means that you type in the command that follows it as root, while the prompt is '$', you type in the command as an ordinary user. This rule applies through out this web site.
The apt figures out inter-dependencies of various packages and automatically installs required packages as well as the target package you chose to install. The HEP on X's apt is so setup that it will download and install these packages from the HEP on X site, this web site. For this to work properly, first you have to synchronize your apt database with the one at this site as follows.
# apt-get update
Then you can install any package, say foo, by typing in
# apt-get install foo
If foo depends on some other packages, the apt will ask you whether you want
to go ahead and install all of the necessary packages to satisfy dependencies.
When you have already installed foo, it will do nothing. If a newer version
is available, it will update foo.
After you install all of the packages you wanted to install, do
# apt-get clean
so as to clean up the RPM packages downloaded into /var/local/cache/apt/archives/.
If you want to uninstall foo, type in
# apt-get remove foo
If you are looking for a package, say bar, try
$ apt-cache search bar
to get a list of packages that are relevant.
Sometimes you may want to treat RPMs directly for query purpose. In such a case, the following may come into handy.
$ rpm -qa # to see list of all that installed
$ rpm -qi foo # to get information on an installed package "foo"
$ rpm -ql foo # to see list of files belonging to "foo"
$ rpm -qpi bar-1.0-1a.ppc.rpm # to get information on a pre-installed rpm package
$ rpm -qpl bar-1.0-1a.ppc.rpm # to see list of files belonging to "bar-1.0-1a"
$ rpm -qf <filename> # to check what RPM package owns the file
If you have an RPM package, you can also directly install it with the rpm command as follows.
# rpm -ivh bar-1.0-1a.ppc.rpm # to install "bar-1.0-1a"
# rpm -Uvh foo-1.0-2a.ppc.rpm # to update "foo"
# rpm -Uvh --oldpackage foo-1.0-1a.ppc.rpm # to revert this
# rpm -e foo # to eliminate "foo"
In preparing the APT tree for HEP on X, I depended so much on the information available from Dr. Taizo Kobayashi's wonderful site, MacOS X WorkShop (in Japanese), where he started the first apt-rpm-based distribution for MacOS X, aiming mainly at Japanese research workers who need Japanized versions of unix tools such as TeX, ghostscript, etc. on MacOS X. I would like to express my sincere thanks to him for bringing his site to my attention and providing me with a lot of useful information.