Linux network, YUM source configuration

The first: to modify the configuration file (need to restart the network configuration, will never take effect)
a, change the IP address

[aeolus@db1 network-scripts]$ vi ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.30.197
NETMASK=255.255.255.0
GATEWAY=192.168.30.1

Second, modify gateway

vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=Aaron
GATEWAY=192.168.30.1

Third, modify the DNS

[aeolus@db1 etc]$ vi resolv.conf
nameserver 202.131.80.1
nameserver 202.131.80.5     

-n route
ip route View routes

Ethtool eth0 network card physical link is normal to see
the following picture is the normal configuration:

Ali cloud configuration YUM source: wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

Set yum source CentOS7 source for Ali

Because I choose installation is a minimal installation, all the tools are basically not. Online method used to obtain configuration files using wget yum source, and now our system is not the tool wget. There are two ways to solve this problem. This is a tool wget installed, and the other is not using this tool, too Xhell directly with a direct copy of the configuration file saved using the yum. Now we introduce two methods of implementation.

First, because the system installation files have the tools, we can install the CD wget
1. Select the virtual machine, open the Settings

2. Select the CD / DVD, ISO image file, check the attached

3. Create a folder to mount dvd DVD in the / mnt directory

4. reach /etc/yum.repos.d folder, modified CentOS-Base.repo CentOS-Base.repo.bak as to cancel the dependence file system. vi CentOS-Media.repo modify the contents of the file, enter i to enter edit, click on Edit after ESC, enter: wq save and exit.

5.yum wget installation tool, yum -y install wget

6. dereference vi /etc/yum.repos.d/CentOS-Media.repo for CentOS-Media.repo of

7. Download the repo file
wget http://mirrors.aliyun.com/repo/Centos-7.repo

8. Change the file name
mv Centos-7.repo CentOS-Base.repo

9. Source Update command execution yum
yum Clean All
yum makecache
yum Update

Second, the use of tools XShell direct replication changes CentOS-Base.repo file
1. Download the file browser to open http://mirrors.aliyun.com/repo/Centos-7.repo

2. Use Notepad ++ to open the file, copy the entire contents

3. Edit the file CentOS-Base.repo

4. Enter: 1, $ d delete all content

5. Use XShell the downloaded file to copy the contents of the document, exit and save

6. Perform source yum update command
yum Clean All
yum makecache
yum UpdateLinux network, YUM source configuration

Guess you like

Origin blog.51cto.com/1674389/2452213