Solution: The ifconfig command is not available after CentOS7 is installed in mini version
- Configure yum source (local)
- Mount the system installation disc
mount /dev/cdrom /mnt/cdrom/
- Run the following command in linux:
cd /etc/yum.repos.d/
, And thenls
The following files are displayed in the yum. repos. d file:CentOS-Base.repo CentOS-CR.repo CentOS-Debuginfo.repo
CentOS-fasttrack.repo CentOS-Media.repo CentOS-Sources.repo CentOS-Vault.repo
A total of 7 files.
- Open
CentOS-Media.repo
File, command:vi CentOS-Media.repo
- Set
CentOS-Media.repo
File changed:
# CentOS-Media.repo # This repo can be used with mounted DVD media, verify the mount point for # CentOS-7. you can use this repo and yum to install items directly off the # dvd iso that we release. # To use this repo, put in your DVD and use it with the other repos too: # yum -- enablerepo = c7-media [command] # or for ONLY the media repo, do this: # yum -- disablerepo = \ * -- enablerepo = c7-media [command] [c7-media] # library name = CentOS-$ releasever-Media # library name Description baseurl = file: /// mnt/cdrom # yum source directory, source address gpgcheck = 1 # Check the GPG-KEY, 0, 1 are not checked, check enabled = 1 # whether to use the source gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
Then:wq
Save and exit. Remember to delete the other six files, but it is best to keep them for future use. My solution is to change the suffix of the other six files.bak
The change is as follows:CentOS-Base.bak CentOS-CR.bak CentOS-Debuginfo.bak
CentOS-fasttrack.bak CentOS-Media.repo CentOS-Sources.bak CentOS-Vault.bak
5.Baseurl = file: // mnt/cdrom # this is very important. This is a specified path. You can use file, ftp, or http to use the next two services. File can be used as a local repository. Make sure the path is reachable)
6.Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 # After the gpgcheck is enabled, the gpgkey is used to specify the corresponding gpg file. If the gpgkey file is not specified, you must manually import the corresponding gpg file.
7. Run the following command:yum install net-tools
Because ifconfig is in net-tools, you need to install this package. 8. Okay. Now the solution is complete !! See