Remove the system default repo file first
cd /etc/yum.repos.d/
mkdir repobak
mv *.repo repobak/
Mount local CD image
mkdir /mnt/cdrom
mount -t iso9660 /dev/cdrom /mnt/cdrom
Edit local yum source repo file
vi CentOS-LocalMedia.repo
cat CentOS-LocalMedia.repo
[ local-BaseOS]
name=CentOS-BaseOS
baseurl=file:///mnt/cdrom/BaseOS
gpgcheck=0
enabled=1[local-AppStream]
name=CentOS-AppStream
baseurl=file:///mnt/cdrom/AppStream
gpgcheck=0
enabled=1
dnf clean all
dnf makecache
dnf install lrzsz -y
Of course, you can also use the yum command
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
or
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
sed -i -e '/mirrors.cloud.aliyuncs.com/d'-e '/mirrors.aliyuncs.com/d'/etc/yum.repos.d/CentOS-Base.repo
yum makecache generates cache
yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
sed -i 's|^#baseurl=https://download.fedoraproject.org/pub|baseurl=https://mirrors.aliyun.com|'/etc/yum.repos.d/epel*
sed -i 's|^metalink|#metalink|'/etc/yum.repos.d/epel*
yum install ncdu test whether the epel source can be used normally
CentOS8 has no network.service service by default. When you enter service network restart, it will prompt no network.service
You can install traditional network.service through yum install network-scripts, but it will be completely abolished in the next major version of RHEL, so it is not recommended to use network.service. You need to use the nmcli command to restart the network
The default network service in CentOS8 is provided by NetworkManager, which is a daemon that dynamically controls and configures the network. It is used to keep the current network devices and connections in working condition. It also supports traditional ifcfg type configuration files. NetworkManager can be used for the following types of connections: Ethernet, VLANS, Bridges, Bonds, Teams, Wi-Fi, mobile boradband (such as mobile 3G) and IP-over-InfiniBand. For these network types, NetworkManager can configure their network aliases, IP addresses, static routes, DNS, VPN connections and many other special parameters.
You can use the command line tool nmcli to control NetworkManager. The network management command line tool nmcli in CentOS8. Users who often use ifconfig should avoid using ifconfig in CentOS8. The function of nmcli is much more powerful and complicated.
The following briefly introduces nmcli commands
nmcli device -h
nmcli device status
nmcli connection add type ethernet con-name ens37 ifname ens37
nmcli connection modify ens37 ipv4.addresses 172.16.10.1/24
nmcli connection modify ens37 ipv4.gateway 172.16.10.254
nmcli connection modify ens37 ipv4.dns 172.16.10.254
nmcli connection modify ens37 ipv4.method manual
nmcli connection modify ens37 +ipv4.dns 223.5.5.5
nmcli connection modify ens37 connection.autoconnect yes
nmcli connection down ens37
nmcli connection up ens37
nmcli device show ens37
nmcli connection modify ens37 ipv4.never-default yes
Corresponding to the network card configuration item seen in the nmtui command: Never use this network for default route
Recommended Posts