安裝完Centos 6並設定好網路之後,先更新系統:

# vi /etc/yum.repos.d/CentOS-Base.repo

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever – Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirror01.idc.hinet.net/CentOS/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever – Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirror01.idc.hinet.net/CentOS/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-$releasever – Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirror01.idc.hinet.net/CentOS/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever – Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://mirror01.idc.hinet.net/CentOS/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#contrib – packages by Centos Users
[contrib]
name=CentOS-$releasever – Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
baseurl=http://mirror01.idc.hinet.net/CentOS/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

存檔退出。

 

# yum -y update

.........................

Complete!

# cat /etc/*-release

CentOS release 6.8 (Final)
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
CentOS release 6.8 (Final)
CentOS release 6.8 (Final)

# ps -p $$

  PID TTY          TIME CMD
 3201 pts/0    00:00:00 csh

# echo $$SHELL

以上兩種都是檢查shell,但echo這個有時候怪怪。如果要更換shell,請用:

# chsh

Changing shell for root.
New shell [/bin/csh]: /bin/bash
Shell changed.

如果要更換其他使用者的shell,請使用:

# usermod -s /bin/csh username

# echo $$PATH
檢查目前有連結的目錄。

# df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_centos6vb-lv_root
                       18G  3.7G   13G  23% /
tmpfs              1.9G  236K  1.9G   1% /dev/shm
/dev/sda1        477M   71M  381M  16% /boot

檢查容量。

# service iptables stop
iptables:正在設定 chains 為 ACCEPT 政策:filter           [  確定  ]
iptables:正在清除防火牆規則:                             [  確定  ]
iptables:正在卸載模組:                                   [  確定  ]
# chkconfig iptables off

關閉防火牆。

 


 

, , ,

貓熊麗麗 發表在 痞客邦 PIXNET 留言(0) 人氣()