Set the network and source after CentOS 6.4 minimal installation (minimal)

Source: Internet
Author: User

Installing CentOS 6.4 on a virtual machine is a breeze compared to the first installation of Google with various problems. In line with the principle of automating one task more than two times, write the initial settings as a script to run.

First, configure the network. Here I use a static IP address. The sed and-I parameters in the script can write changes to the file.

#! /Bin/bash
# Static
Cd/etc/sysconfig/network-scripts
Sed-I's/ONBOOT = no/ONBOOT = yes/G' ifcfg-eth0
Sed-I's/dhcp/static/G' ifcfg-eth0
Echo IPADDR = 10.14.112. ***> ifcfg-eth0
Echo NETMASK = 255.255.255.0> ifcfg-eth0
Echo GATEWAY = 10.14.112.1> ifcfg-eth0
Echo DNS1 = 10.10.0. **> ifcfg-eth0
Service network restart

Configure the yum source to use the on-campus source.

#! /Bin/bash
#
SHELL_HOME = 'CD $ RELATIVE_PATH; pwd'
Cd/etc/yum. repos. d/
Mv CentOS-Base.repo CentOS-Base.repo.backup
Cp $ {SHELL_HOME}/CentOS-Base-zju.repo CentOS-Base.repo
Sed-I's/enabled = 1/enabled = 0/G'/etc/yum/pluginconf. d/fastestmirror. conf
Yum makecache
Yum update-y

After running these two scripts, you can use them. Of course, install vim and other common software.
The following are common software installed by Google:

Install the nslookup, traceroute, wget, man, sudo, ntp, and ntpdate components, and install screen, patch, make gcc, gcc-c ++, flex, and bison.

Yum install-y bind-utils traceroute wget man sudo ntp ntpdate screen patch make gcc-c ++ flex bison zip unzip ftp -- skip-broken

If you can connect to the Internet, you can also add Repoforge support.
Iptables is not set yet, so you can continue to improve the script after you understand it.

Basic operations after CentOS 6.4x64 minimal installation

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.