setting up the centos7

来源:互联网 发布:excel数据比对怎么做 编辑:程序博客网 时间:2024/06/04 18:45

# a note about setting up the centos7


#================================================
# add the "windows7" into grub2 (for the CentOS7 can not detect windows7 automaticly)

reference url:  http://www.ruesin.com/system/centos/centos7-grub2-193.html

# add the menuentry into file /etc/grub.d/40_custom
vim /etc/grub.d/40_custom

### <file path="/etc/grub.d/40_custom">
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
    menuentry 'Windows7'{
    set root=(hd0,1)
    chainloader +1
    }
### </file>

# build the file grub.cfg
grub2-mkconfig -o /boot/grub2/grub.cfg

# reboot the machine
reboot

#================================================
# view the version of centos

cat /etc/redhad-release

#================================================
# install the epel yum

yum install epel-release

#================================================
#
# install the rpmforge yum
# reference url: http://www.tecmint.com/enable-rpmforge-repository/
#

#------------------------------------------------
#Installing RPMForge Repository in RHEL/CentOS 6/5/4
# Download and Install RPMForge repository by selecting appropriate rpm package for your system.

# For RHEL/CentOS 7 64 Bit
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
rpm -Uvh rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm

#------------------------------------------------
#Importing RPMForge Repository Key in RHEL/CentOS 7/6/5/4
# Next, you’ll need to download and install DAG’s GPG key for your system.

wget http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
rpm --import RPM-GPG-KEY.dag.txt

Note : The imported GPG key stored under /etc/pki/rpm-gpg directory as a file RPM-GPG-KEY-rpmforge-dag.

#------------------------------------------------
# Disable RPMForge Repository in RHEL/CentOS 7/6/5/4
#To disable RPMForge repository simply open the file /etc/yum.repos.d/rpmforge.repo.

vi /etc/yum.repos.d/rpmforge.repo

#Change “enabled=1” to “enabled=0“. 0 means turn-off and 1 means turn-on.

#<file path="/etc/yum.repos.d/rpmforge.repo">
### Name: RPMforge RPM Repository for RHEL 6 - dag
### URL: http://rpmforge.net/
[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl = http://apt.sw.be/redhat/el6/en/$basearch/rpmforge
mirrorlist = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
#</file>


#================================================
# install the ntfs-3g, the rpm help mount the ntfs file system

yum list ntfs-3g
yum install ntfs-3g-<version>

#================================================================================
# set the file system table, mount the /dev/sda6 as the /home.

#<file path="/etc/fstab">
/dev/mapper/centos-Root                       /           xfs     defaults        1 1
UUID=<the_uuid_of_dev_sda3>                   /boot       xfs     defaults        1 2
/dev/mapper/centos-tmp                        /tmp        xfs     defaults        1 2
/dev/mapper/centos-var                        /var        xfs     defaults        1 2
/dev/mapper/centos-swap                       swap        swap    defaults        0 0
/dev/sda6                                     /home       ntfs    defaults        1 2
#</file>


#=================================================
# set the hostname

vim /etc/hostname

#<file path="/etc/hostname">
<host_name>.<domain_name>
#</file>

# relogin the termial

#=================================================

0 0