Build the right research environment with CentOS 7: Zhuan

Source: Internet
Author: User
Tags ftp client filezilla install perl root access gfortran



This blog post records the process of building a seismological research environment with CentOS 7 for my personal reference in future re-installation of the system. For other seismological researchers, it may be useful for reference.



Reading instructions:


    1. This article applies to the personal computer, does not apply to the server;
    2. It is not recommended to use the CentOS distribution for people who have just contacted Linux;
    3. This article is as easy to read as possible, but requires the reader to master the basics of Linux;
    4. This article is all done under CentOS 7, other distributions are more or less different from CentOS 7, and are therefore for reference only;
    5. The software installed in this article is purely for personal habits and preferences, readers should be judged by their own, on-demand installation;
Installing CentOS


The installation of CentOS 7 is similar to the installation of other Linux distributions, slightly different in individual places.


Preparatory work
    1. Preparation materials
      • U disk: Capacity of more than 700M, used to make USB disk boot disk, because in the production of the boot disk will format the U disk, so do not include important information in the U disk
      • CentOS 7.0 LiveCD ISO image file
      • Universal USB Installer: USB boot disk maker under Windows
      • A computer that has Windows installed: used to make a USB drive boot disk
    2. Run Universal USB installer and make USB drive boot disk
    3. Plug the USB stick into the computer, restart, enter the BIOS select boot from the USB stick, you can enter the CentOS LiveCD
    4. After entering LiveCD, click "Install to Hard drive" on the desktop to install


Note: Linux can be made through theDDcommand to make the boot disk, but due to the principle is not enough to understand, occasionally lead to production failure, or the production of a successful U disk capacity problems, or with Windows Universal USB installer more reliable.


installation process
    1. Select the language to use during installation: Use the default English
    2. Select region and City: Asia and Shanghai
    3. Keyboard using English (US) instead of Chinese (UK)
    4. Hostname can change also can not change, I usesaturn.geolab
    5. Install the destination, select the hard drive to use, select "I will configure Partioning" at "Other Storage options", i.e. manually partition
Partition


The CentOS 7 partition seems to be a bit more special, and I think I've had a lot of time on the partition since I first installed CentOS7. Later find the appropriate partitioning method, as follows:


    • Click "Click here to create them automatically", which allows the installer to help partition
    • The default partitioning scheme is to use LVM, and the advantage is that "when the machine has more than one hard disk, it looks only a piece when used"
    • The default file system is XFS rather than the previously used EXT4;
    • After automatic partitioning is complete, manually modify the partition details according to your needs
      • /boot: CentOS automatic distribution, must not be changed;
      • /: root directory, theoretically 15G is enough, but now the hard disk is not valuable, more than just in case;
      • swap: Consistent with physical memory size
      • /opt: Personal custom is to install the third-party software under the/opt, so divided by 70G
      • /home: All the rest of the space
    • Click ' Begin to install ' to start the installation
The real installation
    1. Set Root password
    2. Create a generic user
    3. Wait for installation to complete
    4. Installation Complete, restart
    5. After reboot, agree license can
Some principles of several modifications to the system


In order to build a stable system, as far as possible to avoid a variety of blind toss caused by the system problems, special set up some software installation principles. See Software installation methods and strategies under CentOS 7 for details.


Give general account root privileges


By default, there is no root access to the general account. Why not use root account directly, but to give general account root permissions?


    • Using the root account in your daily work is a very bad and dangerous habit! This is true for both the server and the PC.
    • Root privileges are required to install the software, and onlysucan switch to the root account for installation. For those of you who are accustomed to usingsudo, there is still some trouble.


If the account name is Seisman, to grant him root privileges, modify the configuration file/etc/sudoers



$ su# echo ' Seisman all= (All) all ' >>/etc/sudoers
 # Add statement to config file # tail-1/etc/sudoers 
 # Check to see if it's correct Seisman all= (all ) All


Where Seisman is the current user name.


Add a third-party source


CentOS because of the pursuit of stability, so the official source of the software is not many, and therefore need some third-party sources, such as Epel, Atrpms, ELRepo, Nux dextop, Repoforge and so on. Based on the software installation principles mentioned above, in order to ensure the stability of the system as much as possible, the large third-party source adds only Epel source and Elrepo source.


EPEL


EPEL , extra Packages for Enterprise Linux, provides CentOS with an additional 10,000 + packages and has a lot of work to do without replacing system components, so it can be used with confidence.


1
sudo yum install epel-release


After executing the command, there will be one moreepel.repofile under the/etc/yum.repos.ddirectory.


ELRepo


ELRepocontains hardware-related drivers, such as graphics cards, sound card drivers.



sudo rpm--import https://www.elrepo.org/RPM-GPG-KEY-elrepo.orgsudo rpm-uvh http://www.elrepo.org/ elrepo-release-7.0-2.el7.elrepo.noarch.rpm


After the command is completed, aelrepo.repofile will be available in the/etc/yum.repos.ddirectory.


Installing Yum-axelget


Yum-axelget is a Yum plugin provided by Epel. Using the plugin after the installation of software with Yum can be downloaded in parallel, greatly improving the download speed of the software, reducing the waiting time for downloading:



sudo yum install Yum-axelget


Installing the plug-in will also install another software axel. Axel is a parallel download tool that works well when downloading files for simple protocols such as HTTP, FTP, and so on.


Full update for the first time


Before you go any further, upgrade the installed packages to the latest version:



sudo yum update


There are a few more packages to update, which may take a while. But with the Yum-axelget plugin, the speed has been much faster.


Restart


Reboot is recommended here.


Remove the extra kernel


After the previousyum updateis executed, kernel may also be updated together, and there will be many entries in the startup item when you start CentOS.



Confirm the kernel version number currently in use:



$ uname-r3.10.0-123.9.3.el7.x86_64


Find all kernel for the current system installation:




$ rpm -qa | grep kernel
kernel-3.10.0-123.8.1.el7.x86_64
kernel-3.10.0-123.9.3.el7.x86_64
kernel-devel-3.10.0-123.9.2.el7.x86_64
kernel-tools-3.10.0-123.9.3.el7.x86_64
kernel-headers-3.10.0-123.9.3.el7.x86_64
kernel-3.10.0-123.9.2.el7.x86_64
kernel-tools-libs-3.10.0-123.9.3.el7.x86_64
kernel-devel-3.10.0-123.8.1.el7.x86_64
kernel-devel-3.10.0-123.9.3.el7.x86_64


You can see that there are three versions of kernel,123.8.1, 123.9.2, and 123.9.3. In addition to the latest kernel, it is recommended to keep an old kernel, so that the new kernel can enter the system through the old kernel if problems arise. Thus delete 123.8.1 version of Kernel here:



sudo yum remove Kernel-3.10.0-123.8.1.el7.x86_64sudo yum remove kernel-devel-3.10.0-123.8.1.el7.x86_64
Basic Development Environment GCC series

Sudo yum install gcc # C compiler
Sudo yum install gcc-c++ # C++ compiler
Sudo yum install gcc-gfortran # Fortran compiler
Sudo yum install compat-gcc-44 # compatible with gcc 4.4
Sudo yum install compat-gcc-44-c++ # compatible with gcc-c++ 4.4
Sudo yum install compat-gcc-44-gfortran # compatible with gcc-fortran 4.4
Sudo yum install compat-libf2c-34 # g77 3.4.x compatible library

Software Development Assistance Tools

Sudo yum install make
Sudo yum install gdb # code debugger
Sudo yum install cmake # Cmake
Sudo yum install git # version control
Driver Graphics Driver


Linux By default only uses the open-source graphics card driver, in the current situation, the open source drive effect is good, but with the official closed-source drive compared still has a certain gap. The most obvious difference is that when using the SAC's PPK function to amplify waveforms, there is a delay in using the open source driver, and the use of the official closed source makes the process very smooth.



Install the video card detection program:



sudo yum install Nvidia-detect


Detect the video card model and the corresponding driver:




$ nvidia-detect
Probing for supported NVIDIA devices...
[10de:06dd] NVIDIA Corporation GF100GL [Quadro 4000]
This device requires the current 340.58 NVIDIA driver kmod-nvidia


You are prompted to install version 340.58 of the graphics driver. To install the video driver:



sudo yum install nvidia-x11-drv nvidia-x11-drv-32bitsudo yum Remove Xorg-x11-glamor


Reboot.


NTFS driver


NTFS-formatted hard disks are not mounted by default under CentOS. To install NFTS-3G, Plug and Play can be achieved:



sudo yum install ntfs-3g
Advanced development Environment Java environment


One of the great features of Java is the cross-platform, which runs Java programs only if the Java runtime is installed:



sudo yum install Java                        # Java Runtime environment
Clang series


Clang can be considered a substitute for GCC and can be used to compile C, C + +, objective-c, and objective-c++. It provides more friendly error messages, is more friendly in some ways than GCC, and provides a code static parser that can be used to analyze bugs and memory overflow issues that may occur in your code.



sudo yum install clang             # clang compiler 
sudo yum install clang-analyzer    # clang Static Analyzer
Intel series


Most of Intel's software is non-open source and charged, but some software also offers a non-commercial free version of Linux. such as , Ifort, MKL Math Library, and code performance analysis tools.



Intel software application and Installation Reference "Intel non-commercial free development tool".



It is also important to note that Intel also provides several parallel-related commands, such as MP, MPIRun. So Openmpi, Mpich, and Intel are the only one that can be used in parallel.


Parallel computing


Parallel can be used openmpi, or can be used Mpich, the two should be tied. However, because they provide almost the same command, they can be installed at the same time, but they cannot be used at the same time.


Openmpi


Install Openmpi:



sudo yum install Openmpi openmpi-devel


After installation, the binaries are located under/usr/lib64/openmpi/bin, and the dynamic library files are located under/usr/lib64/openmpi/lib, so the actual use of the words requires additional configuration in the.Add the following statement to the BASHRC:



Export Path=/usr/lib64/openmpi/bin/:${path}module Load mpi/openmpi-x86_64
Mpich


Install Mpich:



sudo yum install Mpich mpich-devel


After installation, the binaries are located under/usr/lib64/mpich/bin, and the dynamic library files are located under/usr/lib64/mpich/lib, so the actual use of the words requires additional configuration in the. BASHRCAdd the following statement:



Export Path=/usr/lib64/mpich/bin/:${path}module Load mpi/mpich-x86_64
Scripting language Environment Perl


CentOS 7.0 comes with Perl 5.16.3 (released on March 11, 2013) and the current version is 5.20.1 (released on September 14, 2014).


System comes with Perl


The system comes with Perl, at present, the version is not old, basic enough. More than 1000 modules are available in the official source and Epel sources and can be installed directly with Yum:



sudo yum install perl-parallel-forkmanager  # parallel module


If the source does not have a packaged module, you can also use Perl's own CPAN to install the module.



Priority: Yum > Cpan.


PLENV managing new versions


If you need to use the latest version of Perl, you can install a new version of Perl using PLENV and install the module using the CPANM command provided by Plenv:



CPANM Install Parallel::forkmanager # parallel module
Python


CentOS 7.0 comes with Python 2.7.5, currently the latest version of Python 2 for 2.7.8,python 3 is the latest version of 3.4.2.


System comes with Python


The system comes with Python 2.7.5, basically enough, Python 2 commonly used modules in the official source or Epel Source also has a compiled package, so directly through Yum installation:



Sudo yum install python-matplotlib # 2Dpainting Gallery
Sudo yum install PyQt4 # Qt4 Python binding
Sudo yum install numpy # array operation library
Sudo yum install scipy # scientific computing library
Sudo yum install python-requests # web request
Sudo yum install python-docopt # command line parameter analyzer
Sudo yum install gdal-python # gdal's Python binding
PYENV Management Python3


Python2 and Python3 are not fully compatible, and I am mainly Python3, so I need to install a Python3.



First, install pyenv to manage multiple Python versions, and then use pyenv to install Anaconda3 (that is, Python 3.4). Anaconda comes with many of the packages needed for scientific computing, eliminating the hassle of installation, and for other packages, you can take advantage of Python's own PIP installation:



Pip Install Requestspip Install docopt
Daily Software Office suite LibreOffice


Most Linux distributions have their own LibreOffice:



sudo yum install LibreOffice


LibreOffice's compatibility with Microsoft Office is not very good, the interface with MS Office is also very different, people are not very accustomed to.


WPS Office


If there is a higher requirement for document processing under Linux, you can try WPs Office for Linux, which is currently in beta. WPS Office has a much better compatibility and interface than LibreOffice, and it's worth looking forward to, and certainly not fully compatible with MS Office.



The installation process refers to the installation of the WPS Office article under CentOS.


Texlive 2014


System comes with texlive, version older, or install the latest version is better.



Install the texlive from the ISO file according to the texlive installed under Linux.



After the installation is complete, update all modules:



Tlmgr Update--all
Mendeley


Mendeley is a cross-platform document management software that comes with a PDF reader that can annotate.



Download generic Linux (bits): Http://www.mendeley.com/download-mendeley-desktop



Installation:



Tar -xvf mendeleydesktop-1.12.3-linux-x86_64.tar.bz2 # unzip
Sudo mv mendeleydesktop /opt # Copy to /opt
Cd /opt/mendeleydesktop/bin # cd in
./install-mendeley-link-handler.sh /opt/mendeleydesktop/bin/mendeleydesktop
Sudo yum install qtwebkit # install dependencies


Log out and re-login, under Application->education can see Mendeley related projects. However, there is no software icon, obsessive-compulsive disorder can not endure, with the following command to solve:



Cp/opt/mendeleydesktop/share/icons/hicolor/128x128/apps/mendeleydesktop.png ~/.local/share/icons/
Google Chrome Browser


Default browser is Firefox, or prefer Chrome browser.



Create a new fileGoogle-chrome.repoin the/etc/yum.repos.d/directory and add the following to it:




[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub


Installation:



sudo yum install google-chrome-stable


Because Google's official source may not be able to access in the country, causing the installation to fail or not update properly after installation. If you believe that the image is secure, you can use this domestic image instead of Google's official source,Google-chrome.repo's content should read:




[google-chrome]
name=google-chrome
#baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
#gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
mirrorlist=http://1dot75cm.tk/mirrorlist
gpgkey=http://1dot75cm.tk/src/linux_signing_key.pub
gpgcheck=1
enabled=1
Opera browser


You can also choose Opera Browser.



: Http://www.opera.com/download/guide/?os=linux



Select the CentOS RPM package to download. When the download is complete, execute:



sudo yum localinstall opera-12.16-1860.x86_64.rpm


If you want to uninstall it, do it:



sudo yum Remove opera
Flash Plugin


Flash plugin is mainly to look at the time of online video to use. Google browser comes with a flash plugin, so the Flash plugin installed here is mainly for Firefox.




sudo rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
sudo yum install flash-plugin
Decompression software


Extracting 7z or zip format requires p7zip, provided by Epel:



sudo yum install P7zip


Extracting the RAR format requires Unrar, the software is provided by Nux Dextop, but the source is in conflict with the Epel source, so download the RPM directly for installation:



sudo yum localinstall http://li.nux.ro/download/nux/dextop/el7/x86_64/unrar-5.0.12-2.el7.nux.x86_64.rpm
FTP client


FTP client, or have the interface FileZilla more convenient.



sudo yum install FileZilla
Efficiency class Software


This kind of tool can improve the efficiency of scientific research in different aspects, and also improve the experience of users.


Terminal simulator


Gnome's own terminal simulator is gnome-terminal. Often need to open more than 10 terminals, switching and management is more troublesome.


Terminator


Terminator has a lot of features, I only use the terminal segmentation function.Ctrl+shift+oto the terminal horizontal separation,ctrl+shift+eto the terminal vertical separation,ALT +up and down can be switched in each sub-terminal.



sudo yum localinstall http://li.nux.ro/download/nux/dextop/el7/x86_64/terminator-0.97-6.el7.nux.noarch.rpm
Guake


Guake is a good choice when there are times when you need to execute one or two commands temporarily, but do not want to start an additional terminal.



sudo yum localinstall http://li.nux.ro/download/nux/dextop/el7/x86_64/guake-0.4.4-11.el7.nux.x86_64.rpm


Once the installation is complete, find the Guake terminal in Application->system tools to start. Press F12 to Exhale Guake, press F12 again to hide. The Gauke can also be configured at the terminal executionguake-prefs.


Zsh and oh My zsh


Linux has a lot of shells, such as the most common bash, in addition to CSH, Ksh. Zsh is also a shell.



Zsh is characterized by:


    • The syntax is basically completely compatible with bash, and the general user completely understands the difference
    • ZSH provides command completion features that are better than Bash's complement
    • Highly configurable


Completely zsh has been very easy to use, the general user does not need to spend time to study the configuration. Oh my zsh is a set of zsh configuration files maintained by a group of people. With this configuration file directly, a little bit of understanding will have a better experience.



Install Zsh:



sudo yum install zsh


Install Oh my zsh:



Curl-l http://install.ohmyz.sh | Sh


Above the command, do the following several things:


    • DownloadOh my zshto~/.oh-my-zsh
    • Back up the existing zsh profile~/.ZSHRC, and copy the new. ZSHRCFile
    • Change the default shell of the current user from bash to zsh


In the third step, the error is as follows:chsh: "/usr/bin/zsh" is not listed in/etc/shells., you need to manually modify the default shell:



Chsh-s/bin/zsh


The CHSH command modifies the login shell, so you need to exit the current user and log in again, and later the user's default shell is changed from bash to zsh, and all configurations are not written to. BASHRCand write to. ZSHRC.



In. ZSHRCYou can choose the theme you like and the appropriate number of plugins. The plugins I'm using are listed below:


    1. Git

      The plugin provides a simpler alias for Git's many common commands, such as thegit statusalias isGST, which greatly abbreviated the number of keystrokes. But this plugingit mergetool --no-prompt alias isGMT, and GMT software conflict, need to copy the plugin directory git to Custom/plugins, Then delete the GMT alias;

    2. Command Completion plugin: PIP, pyenv

    3. sudo: pressESCtwice to addsudobefore the current command

    4. Yum: providing aliases for common Yum commands

AutoJump


AutoJump is a very smart directory for fast switching tools. A brief demonstration is as follows:



$ pwd
/home/seisman
$ cd Desktop
$ cd /opt
$ cd /usr/local

# Use the j command to quickly jump from /usr/local to the directory matching des, where only Desktop can match
$ j des
$ pwd
/home/seisman/Desktop


The usage is almost like this, depending on the project homepage.



Installation:



sudo yum install autojumpsudo yum install Autojump-zsh
Chinese Input Method


The newly installed system may be no Chinese input method, the source of the Chinese input method should be IBUs, the use of the general effect. FCITX is a better choice, based on the FCITX framework of Sogou Input method may be a better choice.



Refer to CentOS7 Installation FCITX Chinese Input method.


Hosttool


Scientific internet has almost become a necessary skill for every scientific person.



There are many ways to surf the internet, just say hosttool:https://hosts.huhamhire.com/



Hosttool Science Online essentially replaces the host file with the latest host file.



After downloading the decompression, enter the directory, directlysudo python2 hoststool.pycan run, specific usage of their own research.


VirtualBox virtual Machines


Sometimes you may need to do something under Windows, and if the machine performs well enough, you can install the VirtualBox virtual machine.



wget Http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.reposudo MV virtualbox.repo/etc/yum.repos.d/ sudo yum install VirtualBox-4.3


So you can virtual a Windows under Linux, so happy.


Equal width font


Programming to use the same width font, this is common sense. A type of equal-width font for programming, at least to meet the following requirements:


    1. Easy to distinguish between "1", "I" and "L"
    2. Easy to distinguish between "0", "O" and "O"
    3. Easy to distinguish between left and right quotation marks in Chinese
    4. Beautiful


The currently selected source Code Pro. Place the extracted font files in the~/.fontsdirectory and modify the default fonts for terminals, Gedit, and other editors, Ides, and so on.


Synchronous Network Disk


Network disk According to the function can be divided into two categories: Synchronous network disk and backup network disk. Since it is a synchronous network disk, the client under Linux is essential. As far as is known, there are only two sync nets available under CentOS: Dropbox and the Nut cloud.



I sync the PDF on the Linux machine to the ipad using a sync network.


Dropbox


is also a wall of tools, skilled in the science of Internet skills can be used by people, the general people still do not use.



wget Https://www.dropbox.com/download?dl=packages/fedora/nautilus-dropbox-1.6.2-1.fedora.x86_64.rpmsudo Rpm-i nautilus-dropbox-1.6.2-1.fedora.x86_64.rpm
Nut Cloud


Domestic full-platform synchronization network disk, unlimited space, but limit the monthly upload traffic 1G, download traffic 3G.



#nut cloud depends on notify-python, which is located in the Nux Dextop source
Sudo yum localinstall http://li.nux.ro/download/nux/dextop/el7/x86_64/notify-python-0.1.1-25.el7.nux.x86_64.rpm
# Download
Wget https://jianguoyun.com/static/exe/installer/fedora/nautilus_nutstore_amd64.rpm
Sudo rpm -i nautilus_nutstore_amd64.rpm
Tool Software video Download tool


You-get andyoutube-dl


Pip Install You-getpip Install YOUTUBE-DL
PDF processing Tools


Cpdf is a cross-platform PDF processing tool that can perform common PDF merging, cutting, encryption and decryption, bookmarks, watermarks and other functions.



Download the compiled binary package, unzip it, and copy the binaries corresponding to your platform to the${home}/bin directory to use.


BT Software


Transmission is a popular torrent download software under Linux:



sudo yum install transmission


In application, Internet, you can start transmission.


Other tools

Sudo yum install nfs-utils # must be mounted on the NFS file system
Sudo yum install xclip # terminal text copy tool
Sudo yum install ImageMagick # where the import and convert commands are useful
Sudo yum install dos2unix unix2dos # Windows and Linux line breaks convert to each other
Geophysical related
    1. SAC

      Refer to the relevant section in the SAC Reference manual.

    2. Gmt

      • Installing GMT4
      • Installing GMT5
    3. Taup: Walking Calculation tool

    4. Rdseed:seed Transfer SAC Tool

    5. Win32tools:hinet custom Win32 format to SAC format

    6. PSSAC: Draw sac file with GMT

    7. Distaz: Calculating the epicenter distance and azimuth according to the latitude and longitude of two points

Entertainment

sudo yum install 2048-cli   # 2048 command line version
Google Earth is not completed


In theory Google Earth should be able to be installed with Google Chrome in a similar way, but because of the bug in Google Earth's RPM package, it cannot be installed by the method above.




$ cd -
$ wget https://dl.google.com/dl/earth/client/current/google-earth-stable_current_x86_64.rpm
$ rpm2cpio google-earth-stable_current_x86_64.rpm | cpio -div
$ sudo cp -r opt/google/earth /opt/google/
$ sudo cp etc/cron.daily/google-earth /etc/cron.daily/
$ rm -rf usr opt etc
$ sudo ln -s /opt/google/earth/free/googleearth /usr/bin/google-earth


After the installation is complete, it starts to collapse.


Reference
    1. Elrepo official website
    2. ELRepo Kmod-nvidia
    3. CentOS Yum Software Library sample


Build the right research environment with CentOS 7: Zhuan


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.