In what follows, I assume that you have already
installed the latest X window system (XQuartz-2.7.11 on my Mac box) and
developer tools (Xcode-9.3). If you haven't, install
them before you proceed. After installing Xcode, you may need to install command line tools. For this, type the following command in a terminal window:
$ xcode-select --install
and follow the instruction in a pop-up window.
Notice also that I am going to use bash unless otherwise stated.
Then type in the following from a terminal window to install the base APT/RPM system:$ sudo vi /opt/osxws/etc/apt/sources.list.d/main.list
...
rpm http://liberty.cc.kyushu-u.ac.jp/OSXWS HighSierra/$(ARCH) main updates
rpm http://liberty.cc.kyushu-u.ac.jp/OSXWS HighSierra/noarch main updates
rpm-src http://liberty.cc.kyushu-u.ac.jp/OSXWS HighSierra/$(ARCH) main updates
rpm http://liberty.cc.kyushu-u.ac.jp/OSXWS Sierra/$(ARCH) main updates
rpm http://liberty.cc.kyushu-u.ac.jp/OSXWS Sierra/noarch main updates
rpm-src http://liberty.cc.kyushu-u.ac.jp/OSXWS Sierra/$(ARCH) main updates
$ sudo apt-get update
$ sudo apt-get install OSX-base
$ sudo apt-get clean
You then need to tell the location of HEPonX packages to the APT/RPM system. Make sure your /opt/osxws/etc/apt/sources.list.d/heponx.list contains the following lines:
$ sudo vi /opt/osxws/etc/apt/sources.list.d/heponx.list
......
rpm http://www-jlc.kek.jp/~fujiik/macosx/10.13.X HEPonX/$(ARCH) main
rpm http://www-jlc.kek.jp/~fujiik/macosx/10.13.X HEPonX/noarch main
rpm-src http://www-jlc.kek.jp/~fujiik/macosx/10.13.X HEPonX/$(ARCH) main
......
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.
$ sudo apt-get update
Then you can install any package, say foo, by typing in
$ sudo 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.
To upgrade all the packages already installed, do
$ sudo apt-get dist-upgrade
instead.
After you install all of the packages you wanted to install, do
$ sudo apt-get clean
so as to clean up the RPM packages downloaded into /opt/osxws/var/cache/apt/archives/.
If you want to uninstall foo, type in
$ sudo 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.x86_64.rpm # to get information on a pre-installed rpm package
$ rpm -qpl bar-1.0-1a.x86_64.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.
$ sudo rpm -ivh bar-1.0-1a.x86_64.rpm # to install "bar-1.0-1a"
$ sudo rpm -Uvh foo-1.0-2a.x86_64.rpm # to update "foo"
$ sudo rpm -Uvh --oldpackage foo-1.0-1a.x86_64.rpm # to revert this
$ sudo 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.