Memo by Michikazu Kobayashi
CentOS;

CentOS General

  • In CentOS, rpm -e file.rpmsometimes fails to uninstall

    Erase the .rpm extension
                    rpm -e file
  • Installing iostat (CentOS)

                    yum install sysstat
    A frequently used option is
                    iostat -xk 2
    Also device details can be seen in
                    lvdisplay
  • Check available logical font names (necessary when specifying fonts in AVS/Express)

                    xlsfonts
    or
                    xfontsel
  • Garbled characters in Firefox, etc.

    If you have just installed the software and do not have Japanese fonts, the characters will be garbled. You can install IPA fonts, which are standard Japanese fonts.
                    yum install ipa-gothic-fonts ipa-pgothic-fonts
  • X11 forwarding fails

    Install xauth
                    yum install xauth
    Then do something around sshd_config.

CentOS7

  • libquadmath is not available with gcc

    I thought I could use libquadmath with the new gcc version on CentOS7, but I cannot. fftw quad precision installation also fails. If I install libquadmath with
                    yum install libquadmath
    I should have libquadmath.so.0 and libquadmath.so.0.0.0 (maybe different versions) in /usr/lib64. Symbolic link to the file libquadmath.so is required in gcc.
                    ln -s /usr/lib64/libquadmath.so.0.0.0 /usr/lib64/libquadmath.so
    Now
                    gcc -lquadmath hoge.c
    will give you 128-bit quad precision calculation. It is also now possible to install with fftw --enable-quad-precision.
  • Installing PovRay

    When I try to install PovRay with povlinux, it says "Your OS is not Linux".Apparently CentOS7 is not Linux for PovRay!
                    ./install -no-arch-check
    to install.
  • Failure to mount from server:/home to /home using NFS

    Even if I have written properly in /etc/fstab, it fails to mount from server:/home to /home at boot. However, if I do
                    mount -a
    after startup, it mounts properly. I heard that I should configure the NIS server properly since it is linked with NIS, but I could not get that to work either. I decided to have
                	  mount -a
    automatically at startup, but that did not work either. However, to my annoyance, it seems that CentOS7 no longer allows auto-execution using /etc/rc.d/rc.local (although can I force it to do so by giving executer permission to rc.local)
    Create a new file named /etc/systemd/system/automt.service and write
                    [Unit]
                    Description=AutoMount
                    After=network.target
    
                    [Service]
                    Type=simple
                    ExecStart=/usr/bin/mount -a
    
                    [Install]
                    WantedBy=multi-user.target
    and run
                    systemctl enable automt.service
                    systemctl start automt.service
  • Install FreeFem++

    It seems that the installer using rpm is no longer supported since CentOS7, so it is necessary to install from source.
    Install gcc, g++, gfortran, lapack, scalapack, fftw-3, and openmpi before installation. Especially Openmpi should be installed with the latest version, not yum. When installing, do not tie the Intel compiler to it (why not tie it to gcc, g++, gfortran, and after installing FreeFem++, tie it to the Intel compiler and install it?) Then install wget
                    yum -y install wget
    Download FreeFem++
                    wget https://github.com/FreeFem/FreeFem-sources/archive/v4.4.2.tar.gz
    Install LaTeX (seems necessary for some reason)
                    yum -y install texlive
    Extract
                    tar zxvf v4.4.2.tar.gz
                    cd FreeFem-sources-4.4.2
    Prepare before installation
                    autoreconf -i
                    yum -y install unzip
                    yum -y install bison
                    yum -y install flex
                    yum -y install patch
                    yum -y install git
                    yum -y install freeglut*
    Install according to README
                    ./configure --enable-download --enable-optim
                    ./3rdparty/getall -a
                    cd 3rdparty/ff-petsc
                    make petsc-slepc
                    cd ../../
                    ./reconfigure
                    make -j2
                    make check
                    make install
    If you get an error message on line 4, no problem. If you get an error on line 7 about dimension, you ma be installing openmpi with the Intel compiler tied to it. Sometimes this did not work either, but the cause is unknown.
  • Installing VirtualGL

    I had quite a bit of trouble getting nouveau to stop, blacked out when connecting via TurboVNC, and VirtualGL did not work in the first place, so I made some notes. Here, I built a server only for logging in remotely and using VirtualGL. First of all, CentOS must be a minimal install. If you install the Gnome Desktop environment that comes with the installer, TurboVNC will not work at all (although it might work if you install MATE Desktop or something later).

    First, install VirtualGL and TurboVNC

    here and here to download the source files (rpm). Put in the latest version here. If you install an older version badly, neither VirtualGL nor TurboVNC will work. Then install with
                    yum -y install VirtualGL-2.6.3.x86_64.rpm
                    yum -y install turbovnc-2.2.4.x86_64.rpm
    (change the version accordingly). The local PC to be connected should also have VirtualGL and VNC client software (e.g. TigerVNC).

    Next, stop nouveau. First install what you need to pu NVIDIA.

                    yum -y install kernel-devel-$(uname -r) kernel-header-$(uname -r) gcc make
    If you do this just before installing NVIDIA drivers, nouveau may start working by itself. Do it first. Next, make sure nouveau is running
                    lsmod | grep nouveau
    Stop nouveau
                    echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf
                    mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak   
                    dracut -v /boot/initramfs-$(uname -r).img $(uname -r)
    reboot
                    reboot
    After reboot, do
                    lsmod | grep nouveau
    again to make sure nothing is output. If it is not yet stopped, rung
                    rm /boot/initramfs-$(uname -r).img   
                    dracut -v /boot/initramfs-$(uname -r).img $(uname -r)
    and reboot

    Next, install the NVIDIA driver.

    First check the version of your graphics card
                    lspci | grep VGA
    If there is no lspci command, install
                    yum -y install pciutils
    Go here to get the appropriate version of NVIDIA driver, and run
                    bash NVIDIA-Linux-x86_64-440.64.run
    You will be asked if you want to install the 32-bit version as well. It also asks if you want overwrite somethings. Check if it was installed properly
                    lsmod | grep nvidia
    Make the GPU support both computation and drawing
                    nvidia-smi --gom=0
    Reboot
                    reboot
    Then install desktop environment
                    yum -y groupinstall "X Window System"
                    yum -y groupinstall "gnome Desktop"
                    yum -y install gdm

    Next, configure Xorg.

    Edit /etc/X11/xorg.conf
                    From line 44
                    Section "Screen"
                        Identifier     "Screen0"
                        Device         "Device0"
                        Monitor        "Monitor0"
                        DefaultDepth    24
                        Option         "AllowEmptyInitialConfiguration" "True"
                        SubSection     "Display"
                            Depth       24
                        EndSubSection
                    EndSection
    Next configure VirtualGL
                    /opt/VirtualGL/bin/vglserver
    After Configure, you will be asked 3times, leave all as no. Do not care about the error message that appears on the way. Next, start GNOME Desktop
                    systemctl start gdm
                    systemctl enable gdm
    If you only use it remotely, there is no need to set graphical.target

    Finally, check if drawing is possible on the GPU

    Log in using VirtualGL from the local machine where VirtualGL is installed
                    vglconnect hoge@server
    vglconnect is almost the same as ssh. After logging in, check that
                    vglrun glxgears
    produces a video of the gears rotating. Next, log in using VNC. First, start up the VNC server
                    /opt/TurboVNC/bin/vncserver :number
    The number should be decided beforehand.

    Log in via VNC from the local machine where the VNC client is installed

                    vncviewer avs:number
    Start a terminal on the GNOME desktop and check that
                    vglrun glxgears
    produces an image of gears spinning.
  • Boring with SELinux

    When getenforce doesn't work when enforcing and works fine when permissive, it's SELinux's fault. I am just at a loss as to what to do. In that case, you can install setroubleshoot.
                    yum install setroubleshoot setools
    Then
                    sealert -a /var/log/audit/audit.log
    will tell you what SELinux will reject and what to do to work around it.