Get the App
SLTechnology News&Howtos  ›  Servers  › 

Linux network, Yum source configuration

Shulou Source: shulou.com Published: 2022-06-02 13:05:39 10月02日 Update

First: modify the configuration document (need to restart the network configuration, effective forever)

1. Modify IP address

[aeolus@db1 network-scripts] $vi ifcfg-eth0DEVICE=eth0ONBOOT=yesBOOTPROTO=staticIPADDR=192.168.30.197NETMASK=255.255.255.0GATEWAY=192.168.30.1

Second, modify the gateway

Vi / etc/sysconfig/networkNETWORKING=yesHOSTNAME=AaronGATEWAY=192.168.30.1

3. Modify DNS

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

Route-n

Ip route View Route

Ethtool eth0 to see if the physical link of the network card is working

The following pictures are in normal configuration:

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

Set the yum source of CentOS7 as the source of Ali

Since the installation method I chose is the minimum installation, there are basically no tools at all. The way used on the Internet is to use wget to get the configuration documents of the yum source, but now our system does not have the tool wget. There are two ways to solve this problem. One is to install wget this tool, the other is not to use this tool, directly with the Xhell direct copy yum configuration document to save and use. Now let's introduce the implementation of the two methods.

First, because the tool is in the system installation file, we can install wget from the CD.

1. Select a virtual machine and open the settings

two。 Select CD/DVD, use the ISO image file, and check connected

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

4. Go to the / etc/yum.repos.d folder and change CentOS-Base.repo to CentOS-Base.repo.bak to remove the system's dependence on the file. Modify the contents of the vi CentOS-Media.repo file, enter I to edit, click ESC after editing, and enter: wq to save and exit.

5.yum installs wget tools, yum-y install wget

6. Dereferencing CentOS-Media.repo vi / etc/yum.repos.d/CentOS-Media.repo

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. Execute the yum source update command

Yum clean all

Yum makecache

Yum update

Second, use the XShell tool to directly copy and change the CentOS-Base.repo file

1. The browser opens http://mirrors.aliyun.com/repo/Centos-7.repo to download the file

two。 Use Notepad++ to open the file and copy all the contents

3. Edit the CentOS-Base.repo file

4. Input: 1. Delete all contents.

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

6. Execute the yum source update command

Yum clean all

Yum makecache

Yum update

Tags: File tool configuration content method document system input Select Command folder Ali Update Network minimum two CD can pass name Picture Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Microsoft Linux Shulou Tech Info Shulou Information