Build my CentOS7

 

Build my CentOS7

Category:  Linux   544 people read   comments (0)   collection   report
 

directory (?)[+]

 

Build my CentOS7

Learn some features of centos7, and do some daily exercises on it, write code or something. In order to facilitate the construction in the future, make a record.

Download and install

Download from the centos official website, the minimal iso image, only 500M.

Since I installed it on vmware workstation, it was not carved into a CD.

Created a virtual machine, 1G memory, 1 CPU, 20G hard disk, two network cards (one bridges the external network, one is only the host)

A user shalk was created during installation

In this way, I can use the ssh tool, the static IP of the internal network, and another network card to let the virtual machine access the external network.

Initial configuration

Use root user first

Minimize the installation process, use the default partition, and centos7 will use xfs as the file system. After installation, I found that there is no vim, no ifconfig, but it doesn't matter. With vi, you can use it to ip addr check the network situation

Configure an IP, modify /etc/sysconfig/network-script/ifcfg-device name

Modify the hostname, modify /etc/hostname

Add DNS, modify /etc/resolv.conf and add a line of nameserver 114.114.114.114

Restart the network /etc/init.d/network start

can go online

Modify /etc/sudoers and add a line to give the Shalk user permissions

shalk ALL=(ALL) ALL

Configure EPEL source

EPEL means Extra Package for Enterprise Linux, which is a set of high-quality additional software packages, mainly for Redhat, CenOS, Scientific Linux, etc. It is said that there are more than 10,000 rpm packages, add this source.

curl -O  http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-1.noarch.rpm
sudo rpm -ivh epel-release-7-1.noarch.rpm 
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

configure yum

Download a yum plugin to make yum faster

sudo yum install yum-axelget

Update all packages of the system

sudo yum update

Well, now use yum to install various packages.

Install the compiler

sudo yum install gcc
sudo yum install gcc-c++
sudo yum install make 

Install the editor

sudo yum install vim
curl www.xxxx.com/vim   -o ~/.vimrc  我的配置

install git

sudo yum install git

perl

perl -v
发现最小化没有perl,虽然我们不用系统的perl,但是如果系统如果缺perl,也会很麻烦。
sudo yum install perl-core

Version management with plenv

sudo yum install patch   

If you don't install this, you will get an error when installing perl. Interestingly, this patch is also written by Larry Wall

git clone git://github.com/tokuhirom/plenv.git ~/.plenv
echo 'export PATH="$HOME/.plenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(plenv init -)"' >> ~/.bash_profile
exec $SHELL -l

Install two plugins

git clone git://github.com/tokuhirom/Perl-Build.git ~/.plenv/plugins/perl-build/
git clone git://github.com/shalk/plenv-update.git   ~/.plenv/plugins/perl-update/

Install several versions of perl

plenv install 5.10.0 -Dusethreads
plenv rehash
plenv install 5.20.0 -Dusethreads
plenv rehash

python

python -V
Python 2.7.5
sudo yum install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel
sudo yum install openssl-devel

Install pyenv for version management

curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
echo  'export PATH="$HOME/.pyenv/bin:$PATH"'  >> ~/.bash_profile
echo 'eval "$(pyenv init -)"'  >> ~/.bash_profile
echo 'eval "$(pyenv virtualenv-init -)"'   >> ~/.bash_profile
exec $SHELL - l


pyenv install 2.7.8  # 安装python2.7
pyenv install 3.4.0  # 安装python 3.4

other

To be continued...

END

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327014615&siteId=291194637