Personal notes for CentOS4 installations, additional installations, settings, adjustments, etc.
CentOS is a linux distribution derived from sources freely provided to the public by the RedHat Co. CentOS4 is a clone package of RHEL4, which is based on the Fedora Core 3. Although advanced features are less than the Fedora Core, the Cent OS is more stable and has long-term support of software updating. The CentOS4 is more capable of installing on various architectures. The way to install CentOS4 is quite the same as the Fedora Core 3.
User's data and files should be saved to a secure disk (computer users should regularly do this). The file ".emacs" will be overwritten in course of the installation, rename this file, for example,
% cp .emacs .emacs.bkup
Riken's site is recommendable in Japan.
ftp://ftp.riken.jp/Linux/caos/centos/4/isos/
You can also get iso images by BitTorrent:
i386 CDs:
http://ftp.riken.jp/Linux/caos/centos/4/isos/i386/CentOS-4.0-i386-bin.bin1to4.iso.torrent
i386 DVD:
http://ftp.riken.jp/Linux/caos/centos/4/isos/i386/CentOS-4.0-i386-bin.DVD.iso.torrent
x86_64 CDs:
http://mirror.centos.org/centos/4/isos/x86_64/CentOS-4.0-x86_64-bin1to4.torrent
x86_64 DVD:
http://mirror.centos.org/centos/4/isos/x86_64/CentOS-4.0-x86_64.DVD.bin.torrent
Check the downloaded files:
% md5sum --check MD5SUM-CDS % md5sum --check MD5SUM-DVD
Installation CDs or DVD should be made, K3b can be used in Linux systems. In MS Windows, a free software DeepBurner is an alternative.
In Linux systems, xcdroast is another option to make installation CDs. Using dvd+rw-tools is yet another option to make an install DVD by DVD+RW device. When the device name of DVD+RW is /dev/hdc,
# dvd+rw-format /dev/hdc # growisofs -Z /dev/hdc=CentOS-4.0-i386-bin.DVD.iso
An example of partitioning(1):
/boot : 128MB / : 15GB /usr/local : 15GB /home : rest of the HD /swap : size of the RAM or larger (if the size of the RAM is less than 256MB, two times the size of the RAM or larger)
Another example of partitioning(2):
/boot : 512MB / : 5GB /usr : 40GB /usr/local : 40GB /var : 20GB /tmp : 5GB /home : rest of the HD /swap : size of the RAM or larger (if the size of the RAM is less than 256MB, two times the size of the RAM or larger) /backup : allocated to the second HD(Second example has a lot of margin. 1/4 times smaller for each partition is still OK. If you choose the packages, they can even be even smaller than this.) It is convenient to keep /usr/local, /home, /backup without formatting so that the existing data and softwares can survive the OS installation.
The partitions /boot, /, /usr, /var, /tmp should be formatted. The clean installation is recommended. Systems with clean installation are more stable than upgrade installation. By using the custom install, all the necessary softwares should be chosen. If you have a plenty of disk spaces, installing everything is an easy option.
[Applications] -> [System Settings] -> [Users and Groups]
change user's shell from bash to tcsh.
setting example:
umask 022 limit coredumpsize 0 # aliases are set in .alias if -f ~/.alias source ~/.alias endif set path = (. ~/bin $path) set manpath = ("man -w") set prompt="%m:%~ %h %% " setenv EDITOR emacs setenv LANG ja_JP.UTF-8 setenv TEXINPUTS .:~/tex/macros: ...
In the above example, aliases are set by ~/.alias
# aliases alias h history alias rm 'rm -i' alias mv 'mv -i' alias cp 'cp -i' alias dir 'ls -al' alias ls 'ls -F' ...
Setting the third-party repository(Dag.wieers).
Add the following lines in /etc/yum.conf
[dag] name=Dag RPM Repository for Red Hat Enterprise Linux baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag #baseurl=http://ftp.riken.jp/Linux/dag/redhat/el$releasever/en/$basearch/dag gpgcheck=1
Install GPG public keys:
# rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-centos4 # rpm --import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
Next, update softwares (At the first time, you need a lot of time to complete the following commands):
# yum update
To have the software automatically updated, turn on the yum service. Logs are written in /var/log/yum.log
[Settings needed in advance: Setting Yum, a software to manage packages]
Use apt + synaptic
# yum install apt # apt-get update # apt-get upgrade # apt-get install synaptic
### Dag RPM Repository for Red Hat Enterprise Linux yum DAG-RPM-Repository http://apt.sw.be/redhat/el4/en/$ARCH/dag #yum DAG-RPM-Repository http://ftp.riken.jp/Linux/dag/redhat/el4/en/$ARCH/dag
When the softwares are manually installed, the following symbolic links are convenient for installations with minimum modifications of sources:
# ln -s /usr/local /opt # ln -s /usr/bin/perl /usr/local/bin/perl
Even when the video cards are recognized, the screen can be unstable, and 3D support is not effective. It is desirable to install nVidia drivers (when you have an nVidia card).
Download a driver for your own card from
http://www.nvidia.com/content/drivers/drivers.asp
To turn off X, type
# /sbin/init 3and log in as root. Move to the directory where the driver is put, then type
# sh ./NVIDIA-Linux-x86-1.0-7664-pkg1.runand the driver is installed. Then, type
# cp /etc/X11/xorg.conf /etc/X11/xorg.conf.organd edit /etc/X11/xorg.conf to rewrite Driver "nv" as Driver "nvidia", and remove Load "dri". Make sure that the line Load "glx" exists, and if the line Load "GLcore" is there, remove it. Type
# /sbin/init 5and X starts again. If you see the logo of NVidia, the driver is successfully installed.
Each time you update the kernel, you need to repeat the installation of the driver.
(information of the nVidia on Linux: NVIDIA Linux Forum)
From http://www.mjmwired.net/resources/mjm-fedora-fc3.shtml#ttf get msttcorefonts-1.3-3.noarch.rpm and type
# rpm -ivh msttcorefonts-1.3-3.noarch.rpm # /etc/init.d/xfs restart
If you prefer gv to ggv as ps previewer,
the rpm package of gv for FC3 can be installed:
http://fr2.rpmfind.net//linux/RPM/fedora/3/i386/gv-3.5.8-29.i386.html
http://fr2.rpmfind.net//linux/RPM/fedora/3/x86_64/gv-3.5.8-29.x86_64.html
Auctex enables to edit, compile, and preview tex documents in Emacs windows.
Download the newest version of auctex-*.tar.gz from http://ftp.gnu.org/pub/gnu/auctex/ and install it as:
% tar xvfz auctex-11.55.tar.gz % ./configure % make % make contrib # make install # make install-contrib
To use the wheel mouse in Acrobat Reader, install the imwheel.
Download the newest version of imwheel-*.tar.gz from http://imwheel.sourceforge.net/
% tar xvfz imwheel-1.0.0pre12.tar.gz % cd imwheel-1.0.0pre12 % ./configure % make # make installOpen /etc/X11/xorg.conf as a root user. In Section "InputDevice", Identifier "Mouse0", add the following line
Option "Buttons" "3"(when you use a 3 button mouse). Make a file ~/.imwheelrc in a user's directory, and write the following lines:
"AcroRead" None, Up, Up, 5 None, Down, Down, 5 Shift_L, Up, Page_Up Shift_L, Down, Page_DownRestart X-window, and type
% imwheelto make it work. Use
# sh ./jre-1_5_0_01-linux-i586-rpm.binAdd the following lines in ~/.tcshrc:
# JAVA setenv JAVA_HOME /usr/java/j2re1.5.0_01 setenv PATH /usr/java/j2re1.5.0_01/bin:$PATH
Make a mount point:
# mkdir /winxp
Add the following in /etc/fstab:
/dev/hda5 /winxp ntfs defaults,uid=500 0 0 ^^^^ ~~~Here, ^^^ should be replaced by the name of win partition, and ~~~ by the number of a user who can access to NTFS in addition to the root. Next, type
% uname -r -pto know the version of kernel and the type of processor, and get the correct rpm for your environment from
# mount /winxpor reboot the system to access to the NTFS.
Every time the kernel is updated, the rpm installation should be repeated.
# Turn off IPv6 alias net-pf-10 off alias ipv6 offand reboot.
Settings to locally use the web server without make it public.
Permissions and directory for www files:
% chmod 701 ~ % mkdir -m 705 ~/public_htmlIf the Apache HTTPD is not installed, install it by yum install httpd. Edit the setting file "/etc/httpd/conf/httpd.conf". The lines to edit are the followings (each line is considerably separated, so you need to use the search command in your editor):
Listen 127.0.0.1:80 ServerName 127.0.0.1 #UserDir disable UserDir public_html <Directory /home/*/public_html> AllowOverride All Options All </Directory> AddHandler cgi-script .cgi #AddDefaultCharset UTF-8The fisrt line is important to prohibit accesses from outside. Start the httpd, and set the program to automatically start next time:
# /sbin/service httpd start # /sbin/chkconfig --level 35 httpd onNow, you can access to the files under ~/public_html/ by the address http://localhost/~[username]/ and you can run cgi's
If you see "403 Forbidden", make sure you have correct permissions. If SELINUX block the files, move to the user's home directory and type
% chcon -R -h -t httpd_sys_content_t public_html
(note) When the ServerName is set by your machine address and the port 80 is open, the web pages are made public. However, it decreases the security of your machine. Some time ago, a student run the httpd on his own machine, which is placed in a university building, and the machine was attacked by a network cracker, resulting in a big damage of network systems in a whole section of the university. That was a big problem.
[Settings needed in advance: Setting Yum, a software to manage packages]
To play MP3 in XMM:
# yum install xmms-mp3
[Settings needed in advance: Setting Yum, a software to manage packages]
Installation of the MPlayer and related softwares:
# yum install mplayer*
[Settings needed in advance: Setting Yum, a software to manage packages]
Installation of Flash, Java, and Mplayer plug-ins used by the Mozilla:
# yum install mozilla-flash mozilla-j2re mplayerplug-in
A tool to melt compressed files of cabinet format used in MS Windows
# yum install cabexract
[Settings needed in advance: Settings for using drivers of nVidia video cards]
A tool to switch the virtual desktops by 3D visualization.
One needs a 3D-supported graphic card with an OpenGL driver such as
nVidia etc.
# yum install 3ddesktopCheck the usage by typing "3ddesk --help"
[Settings needed in advance: Settings for using drivers of nVidia video cards]
# yum install gdesklets*
Usage: First, type
% gdesklets startto run the program.
Displays & Sensors can be found at
http://gdesklets.gnomedesktop.org/
click
[Applications] -> [Accessories] -> [gDesklets]
and use Drag & Drop to install.
(note) Some Display doesn't work.
% rpm -q kerneland remove the unnecessary kernels by
# rpm -e kernel-(unnecessary versions)It is crucial to make sure that you are not removing the necessary kernel.
The settings below affect only the user's directory.
The SSH public keys are changed, so the new keys should be set to use the ssh connections without typing password. First, generate the key by
% ssh-keygen -t dsaThe new key is written in ".ssh/id_dsa.pub" of the client computer (the computer you just installed the CentOS). Add the whole text in this file to the file ".ssh/authorized_keys2" of the host computer (The computer you want to connect to).
Remove the old information in the file ".ssh/known_hosts" of the host computer.
The icons in the toolbars are too wide. You can change the style of the toolbar:
[Applications] -> [Preferences] -> [Menus and Toolbars]
Change the style of toolbars to [labels beside icons].
To change the design of FireFox, download Themes from https://update.mozilla.org/
There are terrible websites that do not allow even the Netscape and only allow Internet Explorer. To access to those websites, an extension tool that can personate the browsers. Open the FireFox, and go to http://www.chrispederick.com/work/firefox/useragentswitcher/. Click an xpi file of User Agent Switcher Extension, then this extension is installed. For the first time, you should allow the installation by the message bar that appears when the extension is clicked.
The following softwares are installed under /usr/local. If the partition of this directory is separated by the OS partition, the following installations do not need to be repeated when the new OS is installed.
In the following, /opt is a symbolic link to /usr/local.
I assume users have permissions to write files in the directory
/usr/local/src and all its subdirectories.
General users can execute commands following %
Only root can execute commands following #
In the following settings, the initial directory is assumed to be
/usr/local/src
% tar xvfz gnubiff-2.1.1.tar.gz % cd gnubiff-2.1.1 % ./configure --prefix=`pkg-config libpanelapplet-2.0 --variable=prefix` % make # make installThe software is installed in /usr/local by default. Type "gnubiff" to make settings according to your mail server.
This program can be added to desktop panels. If you prefer to use as a
GTK application, use
[Applications] -> [Preferences] -> [Other Preferences] -> [Sessions]
and choose [Startup Programs] tab, add a command,
gnubiff -n
[Settings needed in advance: Installation of Java runtime]
Azureus is a file exchange program using Java application and BitTorrent. Recently, the BitTorrent is a major way to distribute Linux packages.
First, install Java runtime according to the above. Download the software for a Linux_GTK platform from http://azureus.sourceforge.net/ Then
% tar jxf Azureus_2.2.0.2_linux.GTK.tar.bz2 # mv azureus /usr/local/.
Add the following lines in ~/.tcshrc:
# Azureus setenv PATH /usr/local/azureus:$PATHType /usr/local/azureus/azureus to make settings. The selection buttons seems to be outside the screen, so click inside the box and select with up-down cursor keys.
Disk usages by every directories and files are graphically displayed by xdiskusage. It's convenient when you want to put the disk in order. It is like "du > xdu" refined.
You need the FLTK (Fast Light Tool Kit): From FLTK homepage http://www.fltk.org/ download fltk-1.1.6-source.tar.gz and install as
% tar xvfz fltk-1.1.6-source.tar.gz % cd fltk-1.1.6 % ./configure % make # make installThen from xdiskusage homepage http://xdiskusage.sourceforge.net/ download xdiskusage-1.48.tgz and install as
% tar xvfz xdiskusage-1.48.tgz % cd xdiskusage-1.48 % ./configure % make # make install
There are websites that do not allow browsers other than IEと Netscape to access.
Download an installer from http://channels.netscape.com/ns/browsers/download.jsp, and install it. Make a symbolic link as
# ln -s /usr/local/netscape/netscape /usr/local/bin/netscape
A software to read PDF files.
Download the newest version from ftp://ftp.adobe.com/pub/adobe/acrobatreader/unix/
% mkdir /usr/local/src/acroread % cd /usr/local/src/acroread % wget ftp://ftp.adobe.com/pub/adobe/acrobatreader/unix/5.x/linux-5010.tar.gz % tar zxvf linux-5010.tar.gz # installers/INSTALL # ln -s /usr/local/Acrobat5/bin/acroread /usr/local/bin/acroread
A software to transform DVI files to PDF files.
Download the newest version of dvipdfmx-*.tar.gz from http://project.ktug.or.kr/dvipdfmx/snapshot/release/
% tar xvfz dvipdfmx-*.tar.gz % cd dvipdfmx-* % ./configure % make # make install
Example of preamble of LaTeX source:
\documentclass{article} \usepackage[dvips,dvipdfm]{graphicx,color} \usepackage[dvipdfm,bookmarks=true,bookmarksnumbered=true,bookmarkstype=toc,colorlinks,linkcolor=blue]{hyperref}Sample: /usr/local/src/dvipdfm/latex-support/sample.tex A program to make html files from LaTeX sources.
With this software, the Feynman diagrams can be drawn in LaTeX using MetaFont.
# mkdir -p /usr/local/share/texmf/tex/latex/feynmf # cd /usr/local/share/texmf/tex/latex/feynmf # wget http://www.ctan.org/tex-archive/macros/latex/contrib/feynmf/feynmf.ins # wget http://www.ctan.org/tex-archive/macros/latex/contrib/feynmf/feynmf.dtx # ptex feynmf.ins # mkdir -p /usr/local/share/texmf/fonts/source/feynmf # cd /usr/local/share/texmf/fonts/source/feynmf # cp /usr/local/share/texmf/tex/latex/feynmf/feynmf.mf . # mktexlsr
Manual:
http://www.ctan.org/tex-archive/macros/latex/contrib/feynmf/manual.ps.gz
Sample:
http://www.ctan.org/tex-archive/macros/latex/contrib/feynmf/template.tex
Example of using the above sample:
% latex template % mf '\mode:=localfont; input fmftempl' % latex templateHere, "fmftempl" is a name of a graph defined in the sample. The mf command should be repeated for every graphs defined in the files.
Reference: http://www6.plala.or.jp/tujihiro/feynmf/ (Japanese)
Excellent plotting tool. It consists of subroutines that can be called from Fortran and C. The author of this program, Tim Pearson, is an astronomer.
Download pgplot5.2.tar.gz from http://www.astro.caltech.edu/~tjp/pgplot/
% mv pgplot5.2.tar.gz /usr/local/src/. % cd /usr/local/src % tar xvfz pgplot5.2.tar.gz # mkdir /usr/local/pgplot # cd /usr/local/pgplot # cp /usr/local/src/pgplot/drivers.list .Open /usr/local/pgplot/drivers.list by your favorite editor, and delete the comment marks of, for example, /GIF, /VGIF, /NULL, /PS, /VPS, /CPS, /VCPS, /XWINDOW, /XSERVE that you want to use.
# cd /usr/local/pgplot # /usr/local/src/pgplot/makemake /usr/local/src/pgplot linux g77_gcc # make # make cleanWhen you are using x86_64 CPU, you should edit makefile before make command above. Replace the line
Back to an user's right, open ~/.tcshrc and add the following lines:
# PGPLOT setenv PGPLOT_DIR /usr/local/pgplot/ setenv PGPLOT_DEV /xwin setenv LD_LIBRARY_PATH /usr/local/pgplot[:$LD_LIBRARY_PATH] setenv PGPLOT_FOREGROUND black setenv PGPLOT_BACKGROUND whiteHere, inside of [...] in the third line should be added only when the same variable is defined in a previous line (the square brackets should not be added).
The manuals of subroutines are found in
/usr/local/pgplot/pgplot.doc
Optionally, you can install manuals of html and LaTeX-PS formats.
First, modify the first lines of both
/usr/local/src/pgplot/makehtml and
/usr/local/src/pgplot/maketex to be
#!/usr/bin/perlThen,
# cd /usr/local/pgplot # make pgplot.html # make pgplot-routines.tex # latex pgplot-routines # dvips pgplot-routines -oIf needed, you can print the manuals:
% lpr /usr/local/pgplot/pgplot-routines.ps
In case of Fortran programs with PGPLOT subroutines, the compile
options are, for example,
[i386 CPU case]
% g77 example.f -o example.exe -lpgplot -lX11 -L/usr/local/pgplot -L/usr/X11R6/lib -fno-backslash[x86_64 CPU case]
% g77 example.f -o example.exe -lpgplot -lX11 -L/usr/local/pgplot -L/usr/X11R6/lib64 -fno-backslash
Examples of programs by PGPLOT are in /usr/local/src/pgplot/examples/ The executables of these examples are in /usr/local/pgplot/
Powerful compilers optimized to Intel processors,
Intel Compiler (Fortran, C++) and Math Kernel Library are available
with free (non-commercial use only):
http://www.intel.com/software/products/noncom/
Following instructions, you get the download site and license file by
E-mail. Save them.
Installation of Intel Fortran:
% tar xvfz l_fc_pu_8.1.021.tar.gz # sh ./l_fc_pu_8.1.021/install.shOn the way, the path to the license file is asked. In ~/.tcshrc, add
# Intel Fortran setenv PATH /opt/intel_fc_80/bin:$PATH setenv MANPATH /opt/intel_fc_80/man:[$MANPATH] setenv LD_LIBRARY_PATH /opt/intel_fc_80/lib[:$LD_LIBRARY_PATH] setenv INTEL_LICENSE_FILE /opt/intel_fc_80/licenses[:$INTEL_LICENSE_FILE]Manuals and documents are in /opt/intel_fc_80/doc
Installation of Math Kernel Library:
% tar xvfz l_mkl_p_7.2.1.003.tar.gz # ./l_mkl_p_7.2.1.003/installIn ~/.tcshrc, add
# Math Kernel Library setenv INCLUDE /opt/intel/mkl721/include[:$INCLUDE] setenv LD_LIBRARY_PATH /opt/intel/mkl721/lib/32[:$LD_LIBRARY_PATH]The meaning of [...] is the same as above.
Intel Fortran Compiler Manual:
http://www.intel.com/software/products/compilers/flin/docs/manuals.htm
Intel C++ Compiler manual:
http://www.intel.com/software/products/compilers/clin/docs/manuals.htm
Math Kernel Library Manual:
http://www.intel.com/software/products/mkl/docs/manuals.htm
Programming examples using MKL are found in /opt/intel/mkl721/examples/
Example of Fortran optimization and linking to MKL:
% ifort -ftz -ip -O3 -parallel -tpp7 -I/opt/intel/mkl721/include/ -L/opt/intel/mkl721/lib/32/ -lmkl -lguide -lpthread -lm -lvml [source filename] -o [executable filename]The usage of options affects the speed of calculation by factor of 2-3. You should choose appropriate options according to your CPU architecture and nature of your calculations.
Mirroring tool with FTP. Some Web servers only allow FTP to upload the files. If your Web server allow to login, rsync is better. Download the newest version of sitecopy-*.tar.gz from http://www.lyra.org/sitecopy/ then install as
% tar xvfz sitecopy-0.14.3.tar.gz % cd sitecopy-0.14.3 % ./configure % make # make installThen,
% cd ~ % mkdir -m 700 .sitecopy % touch .sitecopyrc % chmod 600 .sitecopyrcand open ~/.sitecopyrc and write settings, for example,
site [site identity] (any name, not overlapped) server [server name] (example: www.aaa.com) protocol ftp username [account name] password [password] remote [remote directory] (example: ~/public_html/) local [local directory] (example: ~/wwwfiles/foosite/) url [website URL] (example: http://www.aaa.com/home/bbb/ccc) checkmoved # when local files are moved, the server files will be moved. permissions all symlinks follow # symbolic links are transfered as files exclude *.bak exclude *.old exclude *~ exclude "#*#"See man pages for details of settings. First, tell the program the status of local and remote sites by
% sitecopy -c [site identity]When you change the local file(s), type
% sitecopy -u [site identity]to update remote files.
(note) FTP cannot make a symbolic link. In the above settings, the files the symbolic links refer to will be transfered.
When you fail to type ls, you can take breath by this program: ( http://www.tkl.iis.u-tokyo.ac.jp/~toyoda/)
% wget http://www.tkl.iis.u-tokyo.ac.jp/~toyoda/sl/sl.tar % tar xvf sl.tar % cd sl % make # mv sl /usr/local/bin/
Fedora pages are also useful:
2ch Linux Beginners-Fedora Core
Fedora Core 3 Linux Installation Notes by Stanton Finley