Although various Linux distributions are very similar to the Unix system, there are still many differences. Linux is more interesting. Recently, I need to learn and test, just reinstall CentOS under VirtualBox under OSX platform. 7. Due to the performance of the machine itself, I also personally feel that Minimal installation not only saves resources, but also can better exercise your hands-on ability. Record this installation configuration again.
# mkdir -p /mnt/cdrom
# mount /dev/cdrom /mnt/cdrom
# vi CentOS-Iso.repo
[ base]
name=iso
baseurl=file:///mnt/cdrom
gpgcheck=0
# yum install net-tools
# vim /etc/sysconfig/network-scripts/ifcfgX
YPE=Ethernet
BOOTPROTO=static
IPADDR=192.168.56.100
NETMASK=255.255.255.0
NETWORK=192.168.56.0
IPV4_FAILURE_FATAL=no
NAME=enp0s3
UUID=ad60e4e1-c250-47f2-a0d2-fa1fbdbb0bd2
DEVICE=enp0s3
ONBOOT=yes
After configuration, restart the network and test whether the internal and external networks are normal.
# service network restart
4. Turn off the firewall, CentOS 7 does not directly set iptables
# systemctl stop firewalld.service && sudo systemctl disable firewalld.service
5. Install some necessary software such as wget, php, etc. depending on personal needs.
6. Install pip
# wget https://bootstrap.pypa.io/get-pip.py `` # python get-pip.py
7. Set time zone and time
View the current time zone date -R
Modify setting time zone tzselect`` # cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
Or add environment variables in profile (/etc/bashrc)
TZ='Asia/Shanghai'; export TZ
Set time update synchronization
# yum install -y ntpdate`` # ntpdate us.pool.ntp.org
8. Set up admin sudoers
# vim /etc/sudoers
add:
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
gwang ALL=(ALL) ALL
- bash: warning: setlocale: LC_CTYPE: cannot change locale(UTF-8): No such file or directory
[ gwang@localhost ~]$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE=UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
repair:
sudo vi /etc/environment
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
Recommended Posts