<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>System Computer &amp; System Hardware &amp; System Installation &amp; System Upgradation (系统电脑 &amp; 系统硬件 &amp; 系统安装 &amp; 系统升级) &#8211; Eternal Center</title>
	<atom:link href="https://eternalcenter-may-1-2022.github.io/category/system/system-computer-system-hardware-system-installation-system-upgradation/feed/" rel="self" type="application/rss+xml" />
	<link>https://eternalcenter-may-1-2022.github.io/</link>
	<description></description>
	<lastBuildDate>Wed, 27 Apr 2022 15:40:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>[内容] Linux 网卡的显示</title>
		<link>https://eternalcenter-may-1-2022.github.io/network-card/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Wed, 27 Apr 2022 15:36:01 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<category><![CDATA[System Network (系统网络)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=23346</guid>

					<description><![CDATA[方法一：ip 命令 方法二：ifconfig 命令 方法三：iwconfig 命令]]></description>
										<content:encoded><![CDATA[
<h4>方法一：ip 命令</h4>



<pre class="wp-block-code"><code># ip a s
1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:1c:42:c9:3c:81 brd ff:ff:ff:ff:ff:ff
    inet 10.10.10.129/24 brd 10.10.10.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fdb2:2c26:f4e4:0:55da:1265:541f:8007/64 scope global temporary dynamic 
       valid_lft 563315sec preferred_lft 44695sec
    inet6 fdb2:2c26:f4e4:0:21c:42ff:fec9:3c81/64 scope global dynamic mngtmpaddr 
       valid_lft 2591846sec preferred_lft 604646sec
    inet6 fe80::21c:42ff:fec9:3c81/64 scope link 
       valid_lft forever preferred_lft forever</code></pre>



<h4>方法二：ifconfig 命令</h4>



<pre class="wp-block-code"><code># ifconfig
eth0: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt;  mtu 1500
        inet 10.10.10.129  netmask 255.255.255.0  broadcast 10.10.10.255
        inet6 fdb2:2c26:f4e4:0:21c:42ff:fec9:3c81  prefixlen 64  scopeid 0x0&lt;global&gt;
        inet6 fe80::21c:42ff:fec9:3c81  prefixlen 64  scopeid 0x20&lt;link&gt;
        inet6 fdb2:2c26:f4e4:0:55da:1265:541f:8007  prefixlen 64  scopeid 0x0&lt;global&gt;
        ether 00:1c:42:c9:3c:81  txqueuelen 1000  (Ethernet)
        RX packets 698666  bytes 485434755 (462.9 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 372557  bytes 699406543 (667.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73&lt;UP,LOOPBACK,RUNNING&gt;  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10&lt;host&gt;
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 73792  bytes 394285172 (376.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 73792  bytes 394285172 (376.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0</code></pre>



<h4>方法三：<strong>iwconfig</strong> 命令</h4>



<pre class="wp-block-code"><code># iwconfig 
lo        no wireless extensions.

eth0      no wireless extensions.
</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 显示系统常用信息</title>
		<link>https://eternalcenter-may-1-2022.github.io/shell-display-system-common-information/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 26 Apr 2022 16:14:48 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tool (工具)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Directory (系统目录)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<category><![CDATA[System Network (系统网络)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Performance (系统性能)]]></category>
		<category><![CDATA[System Port Security (系统端口安全)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Software (系统软件)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=23311</guid>

					<description><![CDATA[介绍： 作者：朱明宇名称：显示系统常用信息作用：显示系统常用信息 使用方法：1. 在此脚本的分割线内写入相应的内容2. 给此脚本添加执行权限3. 执行此脚本 脚本分割线里的变量：1) times=2 #显示系统常用信息的次数2) sleeptime=0.1 #大部分行与行之间显示的间隔时间 注意：部分功能需要安装了 sysstat 软件或搭建了 KVM 虚拟化平台后执行此脚本的用户能够使用 sudo virsh list 命令后才能实现 脚本：]]></description>
										<content:encoded><![CDATA[
<h2>介绍：</h2>



<p>作者：朱明宇<br>名称：显示系统常用信息<br>作用：显示系统常用信息</p>



<p>使用方法：<br>1. 在此脚本的分割线内写入相应的内容<br>2. 给此脚本添加执行权限<br>3. 执行此脚本</p>



<p>脚本分割线里的变量：<br>1) times=2 #显示系统常用信息的次数<br>2) sleeptime=0.1 #大部分行与行之间显示的间隔时间</p>



<p>注意：部分功能需要安装了 sysstat 软件或搭建了 KVM 虚拟化平台后执行此脚本的用户能够使用 sudo virsh list 命令后才能实现</p>



<h2>脚本：</h2>



<pre class="wp-block-code"><code>#!/bin/bash

####################### Separator ########################
times=2
sleeptime=0.1
####################### Separator ########################

nowtime=1

while (( nowtime &lt;= times))
do
        echo -e "Start Monitoring: \c"
	for i in {1..100}
	do
	        echo -e "#\c"
		sleep 0.01
        done
	echo

	sleep $sleeptime
        host=`hostname`
        echo -e "Name:\t\t\t\t\t\t \033&#91;1m$host\033&#91;0m"

        ip=`ip a s | awk '/&#91;1-2]?&#91;0-9]{0,2}\.&#91;1-2]?&#91;0-9]{0,2}/&amp;&amp;!/127.0.0.1/{print $2}' | awk -F/ '{print $1}'`
        for iip in `echo $ip`
        do
		sleep $sleeptime
                echo -e "IP Address:\t\t\t\t\t \033&#91;1m$iip\033&#91;0m"
        done

        sleep $sleeptime

        cpu=`top -bn 1 | awk -F',' '/^%Cpu/{print $4 }' | awk '{print $1}' | awk '{print 100-$1}'`
        echo -e "CPU Usage (Total):\t\t\t\t \033&#91;1m$cpu%\033&#91;0m"

        sleep $sleeptime

        mem=`free | grep Mem | awk '{print $3/$2 * 100.0}' | egrep -o "&#91;1]?&#91;0-9]{0,2}\.&#91;0-9]"`
        echo -e "Memory Usage (Total):\t\t\t\t \033&#91;1m$mem%\033&#91;0m"

	directory=`df -h | grep -v run | grep -v boot | awk '$1~/\/dev/{print $6}'`
        for idirectory in `echo $directory`
        do
                sleep $sleeptime
                directoryusage=`df -h | grep -v run | grep -v boot | awk '$1~/\/dev/{print}' | grep $idirectory$ | awk '{print $5}'`
		if &#91; $idirectory == / -o $idirectory == /ec  ];then
                        echo -e "Directory Usage ($idirectory):\t\t\t\t \033&#91;1m$directoryusage\033&#91;0m"
	        else
                        echo -e "Directory Usage ($idirectory):\t\t\t \033&#91;1m$directoryusage\033&#91;0m"
		fi
        done

	sudo -l | grep 'virsh list' &amp;&gt; /dev/null
        if &#91; $? -eq 0 ];then
	        sleep $sleeptime
	        virtual=`sudo virsh list | egrep &#91;0-9] | wc -l`
	        echo -e "Number of Virtual Machines (Total):\t\t \033&#91;1m$virtual\033&#91;0m"
        fi

        sleep $sleeptime

        user=`who | wc -l`
        echo -e "Number of User Logins (Total):\t\t\t \033&#91;1m$user\033&#91;0m"

        soft=`rpm -qa | wc -l`
        echo -e "Number of Softwares (Total):\t\t\t \033&#91;1m$soft\033&#91;0m"

        sleep $sleeptime

        port=`ss -ntulap | wc -l`
        echo -e "Number of Open Ports (Total):\t\t\t \033&#91;1m$port\033&#91;0m"

        which sar &amp;&gt; /dev/null
        if &#91; $? -eq 0 ];then
                networkcard=`ifconfig | awk -F: '/flags/&amp;&amp;!/lo/{print $1}'`
                for inetworkcard in `echo $networkcard`
                do
                        networkread="`sar -n DEV 1 1 | grep $inetworkcard | awk '/&#91;0-9]&#91;0-9]:&#91;0-9]&#91;0-9]/{print $3/1000}'` m/s"
                        networkwrite="`sar -n DEV 1 1 | grep $inetworkcard | awk '/&#91;0-9]&#91;0-9]:&#91;0-9]&#91;0-9]/{print $4/1000}'` m/s"
			echo $inetworkcard | grep eth &amp;&gt; /dev/null
			if &#91; $?  -ne 0 ];then
	                echo -e "Network Card IO ($inetworkcard):\t\t\t \033&#91;1m$networkread\033&#91;0m (Read)\t\033&#91;1m$networkwrite\033&#91;0m (Write)"
		        else
	                echo -e "Network Card IO ($inetworkcard):\t\t\t\t \033&#91;1m$networkread\033&#91;0m (Read)\t\033&#91;1m$networkwrite\033&#91;0m (Write)"
			fi
                done
        fi

        which iostat &amp;&gt; /dev/null
        if &#91; $? -eq 0 ];then
	        disk=`iostat -d -k 1 1 | awk '!/^$/&amp;&amp;!/Device/&amp;&amp;!/Linux/{print $1}'`
                for idisk in `echo $disk`
	        do
			sleep $sleeptime
		        diskread="`iostat -d -k 1 1 | grep $idisk |  awk '{print $3/1000}'` m/s"
		        diskwrite="`iostat -d -k 1 1 | grep $idisk |  awk '{print $4/1000}'` m/s"
			echo $idisk | grep 'nvme' &amp;&gt; /dev/null
			if &#91; $? -eq 0 ];then
		                echo -e "Disk IO (/dev/$idisk):\t\t\t\t \033&#91;1m$diskread\033&#91;0m (Read)\t\033&#91;1m$diskwrite\033&#91;0m (Write)"
		        else
		                echo -e "Disk IO (/dev/$idisk):\t\t\t\t \033&#91;1m$diskread\033&#91;0m (Read)\t\033&#91;1m$diskwrite\033&#91;0m (Write)"
			fi
	        done

        fi

        echo -e "Complete Monitoring: \c"
        for i in {1..97}
        do
                echo -e "#\c"
                sleep 0.01
        done
        echo
        sleep $sleeptime

        let nowtime++
done

        echo -e "Terminal Monitoring: \c"
        for i in {1..97}
        do
                echo -e "#\c"
                sleep 0.01
        done

exit</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 lsscsi （查看硬盘类型，例：SSD、HD、SATA、FC &#8230;&#8230;）</title>
		<link>https://eternalcenter-may-1-2022.github.io/lsscsi/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sun, 17 Apr 2022 07:52:04 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=23173</guid>

					<description><![CDATA[内容一：lsscsi 命令的格式 内容二：lsscsi 命令的选项 1) -c 以硬盘全称的形式显示硬盘默认信息2) -d 显示硬盘主设备号和次设备号3) -g 显示硬盘对应的 sg 设备4) -H 显示硬盘的控制器列表5) -i 显示硬盘的 udev 信息6) -l 显示硬盘状态7) -ll 显示硬盘状态，比 -l 选项能显示更多信息8) -lll 或者 -L 显示硬盘状态，比 -ll 选项能显示更多信息9) -p 显示硬盘的 DIF DIX 保护类型10) -P 显示硬盘有效的保护类型11) -s 显示硬盘容量12) -v 显示硬盘设备所在目录13) -w 显示硬盘的 WWN 信息14) -x 以 16 进制显示硬盘的 lun 号]]></description>
										<content:encoded><![CDATA[
<h4>内容一：lsscsi 命令的格式</h4>



<pre class="wp-block-code"><code># lsscsi &lt;option&gt;</code></pre>



<h4>内容二：lsscsi 命令的选项</h4>



<p>1) -c 以硬盘全称的形式显示硬盘默认信息<br>2) -d 显示硬盘主设备号和次设备号<br>3) -g 显示硬盘对应的 sg 设备<br>4) -H 显示硬盘的控制器列表<br>5) -i 显示硬盘的 udev 信息<br>6) -l 显示硬盘状态<br>7) -ll 显示硬盘状态，比 -l 选项能显示更多信息<br>8) -lll 或者 -L 显示硬盘状态，比 -ll 选项能显示更多信息<br>9) -p 显示硬盘的 DIF DIX 保护类型<br>10) -P 显示硬盘有效的保护类型<br>11) -s 显示硬盘容量<br>12) -v 显示硬盘设备所在目录<br>13) -w 显示硬盘的 WWN 信息<br>14) -x 以 16 进制显示硬盘的 lun 号</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 常用日志 （openSUSE &#038; SUSE 版）</title>
		<link>https://eternalcenter-may-1-2022.github.io/log-opensusesuse/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 07 Apr 2022 09:24:12 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Security Log (系统安全日志)]]></category>
		<category><![CDATA[System Statistic Log (系统统计日志)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=22930</guid>

					<description><![CDATA[1) /var/log/boot.msg，包含系统启动时显示在屏幕上的信息（补充：当进入系统时，可以同时按下 “ctrl” 键和 “alt” 键和 “f10” 键切换到显示日志的界面，之后可以再通过 KVM 显示系统启动时显示在屏幕上的信息。）2) /var/log/boot.omsg，包含上一次系统启动时显示在屏幕上的信息3) /var/log/messages，包含几乎所有日志4) /var/log/warn，包含 WARNING 也就是级别 4 以上的所有日志5) /var/log/wtmp，包含和系统登陆和重启的所有日志（补充：可以通过 last 命令读取）6) /var/log/YaST2/y2log，包含 YaST 的所有日志7) /var/log/xinetd.log，包含 xinetd 服务的所有日志8) /var/log/dump/，包含 Kdump 工具在系统宕机时收集的所有故障信息9) /var/log/atop，包含 Atop 工具收集的系统资源 （CPU、内存、系统进程、IO） 的所有使用信息]]></description>
										<content:encoded><![CDATA[
<p>1) /var/log/boot.msg，包含系统启动时显示在屏幕上的信息<br>（补充：当进入系统时，可以同时按下 “ctrl” 键和 “alt” 键和 “f10” 键切换到显示日志的界面，之后可以再通过 KVM 显示系统启动时显示在屏幕上的信息。）<br>2) /var/log/boot.omsg，包含上一次系统启动时显示在屏幕上的信息<br>3) /var/log/messages，包含几乎所有日志<br>4) /var/log/warn，包含 WARNING 也就是级别 4 以上的所有日志<br>5) /var/log/wtmp，包含和系统登陆和重启的所有日志<br>（补充：可以通过 last 命令读取）<br>6) /var/log/YaST2/y2log，包含 YaST 的所有日志<br>7) /var/log/xinetd.log，包含 xinetd 服务的所有日志<br>8) /var/log/dump/，包含 Kdump 工具在系统宕机时收集的所有故障信息<br>9) /var/log/atop，包含 Atop 工具收集的系统资源 （CPU、内存、系统进程、IO） 的所有使用信息</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux CPU 温度的显示 （直接显示）</title>
		<link>https://eternalcenter-may-1-2022.github.io/cpu-temperature/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 04 Apr 2022 15:53:35 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=22845</guid>

					<description><![CDATA[内容一：显示 CPU 的瞬时温度 （补充：1) 这里以显示第 1 个 CPU 的瞬时温度为例2) 将显示的数值除以 1000 就是以摄氏为单位的温度3) 如果显示第 2 个 CPU 的瞬时温度则将 thermal_zone0 换成 thermal_zone1） 内容二：显示 CPU 的瞬时温度，并对数值进行处理 （补充：1) 这里以显示第 1 个 CPU 的瞬时温度为例2) 如果显示第 2 个 CPU 的瞬时温度则将 thermal_zone0 换成 thermal_zone1）]]></description>
										<content:encoded><![CDATA[
<h4>内容一：显示 CPU 的瞬时温度</h4>



<pre class="wp-block-code"><code># cat /sys/class/thermal/thermal_zone0/temp</code></pre>



<p>（<br>补充：<br>1) 这里以显示第 1 个 CPU 的瞬时温度为例<br>2) 将显示的数值除以 1000 就是以摄氏为单位的温度<br>3) 如果显示第 2 个 CPU 的瞬时温度则将 thermal_zone0 换成 thermal_zone1<br>）</p>



<h4>内容二：显示 CPU 的瞬时温度，并对数值进行处理</h4>



<pre class="wp-block-code"><code># echo "CPU Temperature: $&#91;$(cat /sys/class/thermal/thermal_zone0/temp)/1000]"</code></pre>



<p>（<br>补充：<br>1) 这里以显示第 1 个 CPU 的瞬时温度为例<br>2) 如果显示第 2 个 CPU 的瞬时温度则将 thermal_zone0 换成 thermal_zone1<br>）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux CPU 详细信息的显示</title>
		<link>https://eternalcenter-may-1-2022.github.io/linux-cpu/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 04 Apr 2022 14:04:20 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=22767</guid>

					<description><![CDATA[内容一：显示 Linux CPU 详细信息1.1 显示 Linux CPU 详细信息 或者： 1.2 /proc/cpuinfo 文件里或者 lscpu 命令里重要参数 1) processor，逻辑核心 ID2) physical id，物理封装 CPU ID 也就是 CPU socket ID3) core ID，物理核心 ID4) cpu cores 物理封装 CPU 也就是 CPU socket 里的物理核心数量5) siblings 物理封装 CPU 也就是 CPU socket 里的逻辑核心数量 内容二：显示 Linux CPU 详细信息的案例2.1 显示 Linux CPU 详细信息 2.2 理解显示的 CPU 详细信息 &#8230; <p class="link-more"><a href="https://eternalcenter-may-1-2022.github.io/linux-cpu/" class="more-link">Continue reading<span class="screen-reader-text"> "[内容] Linux CPU 详细信息的显示"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h4>内容一：显示 Linux CPU 详细信息<br>1.1 显示 Linux CPU 详细信息</h4>



<pre class="wp-block-code"><code># cat /proc/cpuinfo</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># lscpu</code></pre>



<h4>1.2 /proc/cpuinfo 文件里或者 lscpu 命令里重要参数</h4>



<p>1) processor，逻辑核心 ID<br>2) physical id，物理封装 CPU ID 也就是 CPU socket ID<br>3) core ID，物理核心 ID<br>4) cpu cores 物理封装 CPU 也就是 CPU socket 里的物理核心数量<br>5) siblings 物理封装 CPU 也就是 CPU socket 里的逻辑核心数量</p>



<h4>内容二：显示 Linux CPU 详细信息的案例<br>2.1 显示 Linux CPU 详细信息</h4>



<pre class="wp-block-code"><code># cat /proc/cpuinfo
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 23
model		: 1
model name	: AMD Ryzen 7 1700 Eight-Core Processor
stepping	: 1
microcode	: 0x8001138
cpu MHz		: 1371.214
cache size	: 512 KB
physical id	: 0
siblings	: 16
core id		: 0
cpu cores	: 8
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate sme ssbd sev ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca
bugs		: sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips	: 5987.93
TLB size	: 2560 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 43 bits physical, 48 bits virtual
power management: ts ttp tm hwpstate eff_freq_ro &#91;13] &#91;14]

......</code></pre>



<pre class="wp-block-code"><code># cat /proc/cpuinfo | grep processor
processor	: 0
processor	: 1
processor	: 2
processor	: 3
processor	: 4
processor	: 5
processor	: 6
processor	: 7
processor	: 8
processor	: 9
processor	: 10
processor	: 11
processor	: 12
processor	: 13
processor	: 14
processor	: 15</code></pre>



<pre class="wp-block-code"><code># cat /proc/cpuinfo | grep 'physical id'
physical id	: 0
physical id	: 0
physical id	: 0
physical id	: 0
physical id	: 0
physical id	: 0
physical id	: 0
physical id	: 0
physical id	: 0
physical id	: 0
physical id	: 0
physical id	: 0
physical id	: 0
physical id	: 0
physical id	: 0
physical id	: 0</code></pre>



<pre class="wp-block-code"><code># cat /proc/cpuinfo | grep 'core id'
core id		: 0
core id		: 1
core id		: 2
core id		: 3
core id		: 4
core id		: 5
core id		: 6
core id		: 7
core id		: 0
core id		: 1
core id		: 2
core id		: 3
core id		: 4
core id		: 5
core id		: 6
core id		: 7</code></pre>



<pre class="wp-block-code"><code># cat /proc/cpuinfo | grep 'cpu cores'
cpu cores	: 8
cpu cores	: 8
cpu cores	: 8
cpu cores	: 8
cpu cores	: 8
cpu cores	: 8
cpu cores	: 8
cpu cores	: 8
cpu cores	: 8
cpu cores	: 8
cpu cores	: 8
cpu cores	: 8
cpu cores	: 8
cpu cores	: 8
cpu cores	: 8
cpu cores	: 8</code></pre>



<pre class="wp-block-code"><code># cat /proc/cpuinfo | grep 'siblings'
siblings	: 16
siblings	: 16
siblings	: 16
siblings	: 16
siblings	: 16
siblings	: 16
siblings	: 16
siblings	: 16
siblings	: 16
siblings	: 16
siblings	: 16
siblings	: 16
siblings	: 16
siblings	: 16
siblings	: 16
siblings	: 16</code></pre>



<h4>2.2 理解显示的 CPU 详细信息</h4>



<p>1) processor 的数字从 0 到 15，代表有 16 个逻辑核心<br>2) physical id 的数字都是 0，代表只有 1 个物理封装 CPU ID 也就是 CPU socket ID<br>3) core id 的数字从 0 到 7，代表有 8 个物理核心<br>4) cpu cores 的数字都是 8，代表每 1 个物理封装 CPU 也就是 CPU socket 里有 8 个物理核心<br>5) siblings 的数字都是 8，代表每 1 个物理封装 CPU 也就是 CPU socket 里有 16 个逻辑核心<br>6) 简单的理解：1 个 CPU，8 个物理核心，16 个逻辑核心</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] openSUSE &#038; SUSE 软件包指定版本的升级</title>
		<link>https://eternalcenter-may-1-2022.github.io/specified-software-version-update/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 04 Mar 2022 08:03:40 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Upgradation (系统升级)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=22350</guid>

					<description><![CDATA[步骤一：解锁软件 （补充：这里以解锁 docker 软件包为例） 步骤二：显示所有可用的软件版本 （补充：这里以显示 docker 软件包的所有可用的版本为例） 步骤三：升级指定版本的软件 （补充：这里以升级 docker 软件包的指定版本为例） 步骤四：重新锁定软件 （补充：这里以重新锁定 docker 软件包为例） 步骤五：重启系统]]></description>
										<content:encoded><![CDATA[
<h4>步骤一：解锁软件</h4>



<pre class="wp-block-code"><code># zypper removelocks docker</code></pre>



<p>（补充：这里以解锁 docker 软件包为例）</p>



<h4>步骤二：显示所有可用的软件版本</h4>



<pre class="wp-block-code"><code># zypper se -s docker</code></pre>



<p>（补充：这里以显示 docker 软件包的所有可用的版本为例）</p>



<h4>步骤三：升级指定版本的软件</h4>



<pre class="wp-block-code"><code># zypper install --oldpackage docker-&lt;version&gt;.&lt;architecture&gt;</code></pre>



<p>（补充：这里以升级 docker 软件包的指定版本为例）</p>



<h4>步骤四：重新锁定软件</h4>



<pre class="wp-block-code"><code># zypper addlock docker</code></pre>



<p>（补充：这里以重新锁定 docker 软件包为例）</p>



<h4>步骤五：重启系统</h4>



<pre class="wp-block-code"><code># reboot</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[排错] 解决 openSUSE &#038; SLE 升级系统时报错 “Can&#8217;t get available migrations from server: SUSE::Connect::ApiError: Multiple base products found:&#8230;&#8230;”</title>
		<link>https://eternalcenter-may-1-2022.github.io/debug-cant-get-available-migrations-from-server-suseconnectapierror-multiple-base-products-found/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 03 Mar 2022 08:00:33 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Other Services (其他服务)]]></category>
		<category><![CDATA[Services (服务)]]></category>
		<category><![CDATA[SUSE Repository Mirroring Tool (RMT)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Upgradation (系统升级)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=22328</guid>

					<description><![CDATA[报错代码： 分析： 当上一次升级失败或者升级回滚了以后可能会报此类错误 解决方法： 方法一：通过 SUSEConnect 命令回滚1.1 通过 SUSEConnect 命令回滚 # SUSEConnect &#8211;rollback 1.2 重新升级 （步骤略） 步骤二：取消注册再重新注册2.1 取消注册再重新注册 （步骤略） 2.2 重新升级 （步骤略） 参考文献： https://www.suse.com/support/kb/doc/?id=000019523]]></description>
										<content:encoded><![CDATA[
<h2>报错代码：</h2>



<pre class="wp-block-code"><code>Can't get available migrations from server: SUSE::Connect::ApiError: Multiple base products found: ......</code></pre>



<h2>分析：</h2>



<p>当上一次升级失败或者升级回滚了以后可能会报此类错误</p>



<h2>解决方法：</h2>



<h4>方法一：通过 SUSEConnect 命令回滚<br>1.1 通过 SUSEConnect 命令回滚</h4>



<p># SUSEConnect &#8211;rollback</p>



<h4>1.2 重新升级</h4>



<p>（步骤略）</p>



<h4>步骤二：取消注册再重新注册<br>2.1 取消注册再重新注册</h4>



<p>（步骤略）</p>



<h4>2.2 重新升级</h4>



<p>（步骤略）</p>



<h2>参考文献：</h2>



<p class="has-text-align-center">https://www.suse.com/support/kb/doc/?id=000019523</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 生命周期</title>
		<link>https://eternalcenter-may-1-2022.github.io/lifecycle/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 15 Feb 2022 07:56:59 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Installation (系统安装)]]></category>
		<category><![CDATA[System Upgradation (系统升级)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=21946</guid>

					<description><![CDATA[RHEL: https://access.redhat.com/support/policy/updates/errata/#Extended_Life_Cycle_Phase openSUSE: English: https://en.opensuse.org/Lifetime Chinese: https://zh.opensuse.org/%E4%BD%BF%E7%94%A8%E6%9C%9F%E9%99%90 SLE: https://www.suse.com/lifecycle]]></description>
										<content:encoded><![CDATA[
<h2 id="rhel">RHEL:</h2>



<p>https://access.redhat.com/support/policy/updates/errata/#Extended_Life_Cycle_Phase</p>



<h2 id="opensuse">openSUSE:</h2>



<p>English:</p>



<p>https://en.opensuse.org/Lifetime</p>



<p>Chinese:</p>



<p>https://zh.opensuse.org/%E4%BD%BF%E7%94%A8%E6%9C%9F%E9%99%90</p>



<h2 id="sle">SLE:</h2>



<p>https://www.suse.com/lifecycle</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[排错] 解决 Linux 运行时报错 “watchdog: Bug: soft lockup &#8211; CPU&#8230;&#8230;” （CPU 软锁）</title>
		<link>https://eternalcenter-may-1-2022.github.io/debug-watchdog-bug-soft-lockup-cpu/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 15 Feb 2022 07:35:47 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=21928</guid>

					<description><![CDATA[报错代码： 分析： 当 CPU 的负载过高时，一个 CPU 在运行某一个进程时，在内核模式下超过 20 秒没有回应，则看门狗程序会将系统所有 CPU 软锁住，然后会让这些 CPU 显示各自正在运行的进程堆栈跟踪 缓解方法： 延长看门狗等待 CPU 内核模式下的回应时间 方法一：通过 /proc/sys/kernel/watchdog_thresh 文件提高看门狗软所 CPU 的时间 （补充：这里以将看门狗的值提高到为 20 为例，也可以根据自己的需求提高更多，默认值为 10） 方法二：通过新建文件提高看门狗软所 CPU 的时间2.1 通过新建文件提高看门狗软所 CPU 的时间 （补充：这里以将看门狗的值提高到为 20 为例，也可以根据自己的需求提高更多，默认值为 10） 2.2 让新建文件立刻生效 深究方法： 开启 Kdump，等此报错再次发生时分析 Kdump 在内核崩溃时搜集信息 vmcore]]></description>
										<content:encoded><![CDATA[
<h2 id="报错代码">报错代码：</h2>



<pre class="wp-block-code"><code>watchdog: Bug: soft lockup - CPU......</code></pre>



<h2 id="分析">分析：</h2>



<p>当 CPU 的负载过高时，一个 CPU 在运行某一个进程时，在内核模式下超过 20 秒没有回应，则看门狗程序会将系统所有 CPU 软锁住，然后会让这些 CPU 显示各自正在运行的进程堆栈跟踪</p>



<h2 id="缓解方法">缓解方法：</h2>



<p>延长看门狗等待 CPU 内核模式下的回应时间</p>



<h4 id="方法一-通过-proc-sys-kernel-watchdog-thresh-文件提高看门狗软所-cpu-的时间">方法一：通过 /proc/sys/kernel/watchdog_thresh 文件提高看门狗软所 CPU 的时间</h4>



<pre class="wp-block-code"><code># echo 20 &gt; /proc/sys/kernel/watchdog_thresh</code></pre>



<p>（补充：这里以将看门狗的值提高到为 20 为例，也可以根据自己的需求提高更多，默认值为 10）</p>



<h4 id="方法二-通过新建文件提高看门狗软所-cpu-的时间2-1-通过新建文件提高看门狗软所-cpu-的时间">方法二：通过新建文件提高看门狗软所 CPU 的时间<br>2.1 通过新建文件提高看门狗软所 CPU 的时间</h4>



<pre class="wp-block-code"><code># echo "kernel.watchdog_thresh=20" &gt; /etc/sysctl.d/99-watchdog_thresh.conf</code></pre>



<p>（补充：这里以将看门狗的值提高到为 20 为例，也可以根据自己的需求提高更多，默认值为 10）</p>



<h4 id="2-2-让新建文件立刻生效">2.2 让新建文件立刻生效</h4>



<pre class="wp-block-code"><code># sysctl -p  /etc/sysctl.d/99-watchdog_thresh.conf</code></pre>



<h2 id="深究方法">深究方法：</h2>



<p>开启 Kdump，等此报错再次发生时分析 Kdump 在内核崩溃时搜集信息 vmcore</p>



<div class="wp-container-1 wp-block-buttons">
<div class="wp-block-button aligncenter is-style-outline"><a class="wp-block-button__link no-border-radius" href="https://eternalcenter-may-1-2022.github.io/kdump/">Linux Kdump 的开启 <br>（用于收集内核崩溃时的信息）</a></div>



<div class="wp-block-button is-style-outline"><a class="wp-block-button__link" href="https://eternalcenter-may-1-2022.github.io/kdump-analysis/" style="border-radius:0px">Linux Kdump 内核奔溃信息的分析</a></div>
</div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] PXE 新系统模板的添加</title>
		<link>https://eternalcenter-may-1-2022.github.io/pxe-template-add/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sat, 12 Feb 2022 15:14:50 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Other Services (其他服务)]]></category>
		<category><![CDATA[Pre-boot Execution Environment (PXE)]]></category>
		<category><![CDATA[Services (服务)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Installation (系统安装)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=21908</guid>

					<description><![CDATA[步骤目录： 步骤一：准备安装镜像1.1 从官网上下载安装镜像1.2 挂载安装镜像1.2.1 创建用于挂载安装镜像的目录1.2.2 挂载安装镜像 步骤二：准备用于进行 PXE 安装的数据2.1 准备系统安装数据2.1.1 创建用于存放系统安装数据的目录2.1.2 拷贝安装镜像里的数据到用于存放系统安装数据的目录2.1.2.1 拷贝安装镜像里的普通数据到用于存放系统安装数据的目录2.1.2.2 拷贝安装镜像里的 .treeinfo 文件到用于存放系统安装数据的目录2.2 准备安装引导文件2.2.1 创建用于存放安装引导文件的目录2.2.1.1 创建用于存放 BIOS 安装引导文件的目录2.2.1.2 创建用于存放 EFI 安装引导文件的目录2.2.2 拷贝安装镜像里的安装引导文件到存放安装引导文件的目录2.2.2.1 拷贝安装镜像里的 BIOS 安装引导文件到存放 BIOS 安装引导文件的目录2.2.2.2 拷贝安装镜像里的 EFI 安装引导文件到存放 EFI 安装引导文件的目录2.3 准备系统安装配置文件2.3.1 进入到用于存放系统安装配置文件的目录2.3.2 创建系统安装配置文件2.3.2.1 创建 BIOS 系统安装配置文件2.3.2.2 创建 EFI 系统安装配置文件2.3.3 设置系统安装配置文件的权限2.3.3.1 设置 BIOS 系统安装配置文件的权限2.3.3.2 设置 EFI 系统安装配置文件的权限2.4 修改系统安装菜单文件 pxelinux.cfg2.4.1 修改 BIOS &#8230; <p class="link-more"><a href="https://eternalcenter-may-1-2022.github.io/pxe-template-add/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] PXE 新系统模板的添加"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h2 id="步骤目录">步骤目录：</h2>



<h4 id="步骤一-准备安装镜像1-1-从官网上下载安装镜像1-2-挂载安装镜像1-2-1-创建用于挂载安装镜像的目录1-2-2-挂载安装镜像">步骤一：准备安装镜像<br>1.1 从官网上下载安装镜像<br>1.2 挂载安装镜像<br>1.2.1 创建用于挂载安装镜像的目录<br>1.2.2 挂载安装镜像</h4>



<h4 id="步骤二-准备用于进行-pxe-安装的数据2-1-准备系统安装数据2-1-1-创建用于存放系统安装数据的目录2-1-2-拷贝安装镜像里的数据到用于存放系统安装数据的目录2-1-2-1-拷贝安装镜像里的普通数据到用于存放系统安装数据的目录2-1-2-2-拷贝安装镜像里的-treeinfo-文件到用于存放系统安装数据的目录2-2-准备安装引导文件2-2-1-创建用于存放安装引导文件的目录2-2-1-1-创建用于存放-bios-安装引导文件的目录2-2-1-2-创建用于存放-efi-安装引导文件的目录2-2-2-拷贝安装镜像里的安装引导文件到存放安装引导文件的目录2-2-2-1-拷贝安装镜像里的-bios-安装引导文件到存放-bios-安装引导文件的目录2-2-2-2-拷贝安装镜像里的-efi-安装引导文件到存放-efi-安装引导文件的目录2-3-准备系统安装配置文件2-3-1-进入到用于存放系统安装配置文件的目录2-3-2-创建系统安装配置文件2-3-2-1-创建-bios-系统安装配置文件2-3-2-2-创建-efi-系统安装配置文件2-3-3-设置系统安装配置文件的权限2-3-3-1-设置-bios-系统安装配置文件的权限2-3-3-2-设置-efi-系统安装配置文件的权限2-4-修改系统安装菜单文件-pxelinux-cfg2-4-1-修改-bios-系统安装菜单文件-pxelinux-cfg2-4-2-修改-efi-系统安装菜单文件-grub-cfg">步骤二：准备用于进行 PXE 安装的数据<br>2.1 准备系统安装数据<br>2.1.1 创建用于存放系统安装数据的目录<br>2.1.2 拷贝安装镜像里的数据到用于存放系统安装数据的目录<br>2.1.2.1 拷贝安装镜像里的普通数据到用于存放系统安装数据的目录<br>2.1.2.2 拷贝安装镜像里的 .treeinfo 文件到用于存放系统安装数据的目录<br>2.2 准备安装引导文件<br>2.2.1 创建用于存放安装引导文件的目录<br>2.2.1.1 创建用于存放 BIOS 安装引导文件的目录<br>2.2.1.2 创建用于存放 EFI 安装引导文件的目录<br>2.2.2 拷贝安装镜像里的安装引导文件到存放安装引导文件的目录<br>2.2.2.1 拷贝安装镜像里的 BIOS 安装引导文件到存放 BIOS 安装引导文件的目录<br>2.2.2.2 拷贝安装镜像里的 EFI 安装引导文件到存放 EFI 安装引导文件的目录<br>2.3 准备系统安装配置文件<br>2.3.1 进入到用于存放系统安装配置文件的目录<br>2.3.2 创建系统安装配置文件<br>2.3.2.1 创建 BIOS 系统安装配置文件<br>2.3.2.2 创建 EFI 系统安装配置文件<br>2.3.3 设置系统安装配置文件的权限<br>2.3.3.1 设置 BIOS 系统安装配置文件的权限<br>2.3.3.2 设置 EFI 系统安装配置文件的权限<br>2.4 修改系统安装菜单文件 pxelinux.cfg<br>2.4.1 修改 BIOS 系统安装菜单文件 pxelinux.cfg<br>2.4.2 修改 EFI 系统安装菜单文件 grub.cfg</h4>



<h4 id="步骤三-取消挂载安装镜像">步骤三：取消挂载安装镜像</h4>



<h2 id="具体的操作步骤">具体的操作步骤：</h2>



<h4 id="步骤一-准备安装镜像1-1-从官网上下载安装镜像">步骤一：准备安装镜像<br>1.1 从官网上下载安装镜像</h4>



<p>（步骤略）</p>



<h4 id="1-2-挂载安装镜像1-2-1-创建用于挂载安装镜像的目录">1.2 挂载安装镜像<br>1.2.1 创建用于挂载安装镜像的目录</h4>



<pre class="wp-block-code"><code># mkdir &lt;directory for mounting the image&gt;</code></pre>



<h4 id="1-2-2-挂载安装镜像">1.2.2 挂载安装镜像</h4>



<pre class="wp-block-code"><code># mount -t iso9660 &lt;image&gt; &lt;directory for mounting the image&gt;</code></pre>



<h4 id="步骤二-准备用于进行-pxe-安装的数据2-1-准备系统安装数据2-1-1-创建用于存放系统安装数据的目录">步骤二：准备用于进行 PXE 安装的数据<br>2.1 准备系统安装数据<br>2.1.1 创建用于存放系统安装数据的目录</h4>



<pre class="wp-block-code"><code># mkdir &lt;directory of data for installing the system&gt;</code></pre>



<p>（注意：用于存放系统安装数据的目录必须要放在能够实现 PXE 安装时网络共享的目录里（例如：通过 httpd 服务进行网络共享））</p>



<h4 id="2-1-2-拷贝安装镜像里的数据到用于存放系统安装数据的目录2-1-2-1-拷贝安装镜像里的普通数据到用于存放系统安装数据的目录">2.1.2 拷贝安装镜像里的数据到用于存放系统安装数据的目录<br>2.1.2.1 拷贝安装镜像里的普通数据到用于存放系统安装数据的目录</h4>



<pre class="wp-block-code"><code># cp -rp &lt;directory for mounting the image&gt;/* &lt;directory of data for installing the system&gt;</code></pre>



<h4 id="2-1-2-2-拷贝安装镜像里的-treeinfo-文件到用于存放系统安装数据的目录">2.1.2.2 拷贝安装镜像里的 .treeinfo 文件到用于存放系统安装数据的目录</h4>



<pre class="wp-block-code"><code># cp -rp &lt;directory for mounting the image&gt;/.treeinfo &lt;directory of data for installing the system&gt;</code></pre>



<h4 id="2-2-准备安装引导文件2-2-1-创建用于存放安装引导文件的目录2-2-1-1-创建用于存放-bios-安装引导文件的目录">2.2 准备安装引导文件<br>2.2.1 创建用于存放安装引导文件的目录<br>2.2.1.1 创建用于存放 BIOS 安装引导文件的目录</h4>



<pre class="wp-block-code"><code># mkdir &lt;directory of BIOS boot file for installing the system&gt;</code></pre>



<p>（注意：用于存放 BIOS 安装引导文件的目录必须要放在能够实现 TFPT 网络共享的目录里）</p>



<h4 id="2-2-1-2-创建用于存放-efi-安装引导文件的目录">2.2.1.2 创建用于存放 EFI 安装引导文件的目录</h4>



<pre class="wp-block-code"><code># mkdir &lt;directory of EFI boot file for installing the system&gt;</code></pre>



<p>（注意：用于存放 EFI 安装引导文件的目录必须要放在能够实现 TFPT 网络共享的目录里）</p>



<h4 id="2-2-2-拷贝安装镜像里的安装引导文件到存放安装引导文件的目录2-2-2-1-拷贝安装镜像里的-bios-安装引导文件到存放-bios-安装引导文件的目录">2.2.2 拷贝安装镜像里的安装引导文件到存放安装引导文件的目录<br>2.2.2.1 拷贝安装镜像里的 BIOS 安装引导文件到存放 BIOS 安装引导文件的目录</h4>



<p>如果是 Rocky Linux &amp; RHEL 的话则拷贝 initrd.img 文件、TRANS.TBL 文件和 vmlinuz 文件：</p>



<pre class="wp-block-code"><code># curl &lt;The URL of the network share when PXE installing&gt;/&lt;directory of data for installing the system&gt;/images/pxeboot/initrd.img -O &lt;directory of BIOS boot file for installing the system&gt;/initrd.img
# curl &lt;The URL of the network share when PXE installing&gt;/&lt;directory of data for installing the system&gt;/images/pxeboot/TRANS.TBL -O &lt;directory of BIOS boot file for installing the system&gt;/TRANS.TBL
# curl &lt;The URL of the network share when PXE installing&gt;/&lt;directory of data for installing the system&gt;/images/pxeboot/vmlinuz -O &lt;directory of BIOS boot file for installing the system&gt;/vmlinuz</code></pre>



<p>如果是 openSUSE &amp; SLE 的话则拷贝 linux 文件和 initrd 文件：</p>



<pre class="wp-block-code"><code># curl &lt;The URL of the network share when PXE installing&gt;/&lt;directory of data for installing the system&gt;/boot/x86_64/loader/linux -O &lt;directory of BIOS boot file for installing the system&gt;/linux
# curl &lt;The URL of the network share when PXE installing&gt;/&lt;directory of data for installing the system&gt;/boot/x86_64/loader/initrd -O &lt;directory of BIOS boot file for installing the system&gt;/initrd</code></pre>



<h4 id="2-2-2-2-拷贝安装镜像里的-efi-安装引导文件到存放-efi-安装引导文件的目录">2.2.2.2 拷贝安装镜像里的 EFI 安装引导文件到存放 EFI 安装引导文件的目录</h4>



<p>如果是 Rocky Linux &amp; RHEL 的话则拷贝 initrd.img 文件、TRANS.TBL 文件和 vmlinuz 文件：</p>



<pre class="wp-block-code"><code># curl &lt;The URL of the network share when PXE installing&gt;/&lt;directory of data for installing the system&gt;/images/pxeboot/initrd.img -O &lt;directory of EFI boot file for installing the system&gt;/initrd.img
# curl &lt;The URL of the network share when PXE installing&gt;/&lt;directory of data for installing the system&gt;/images/pxeboot/TRANS.TBL -O &lt;directory of EFI boot file for installing the system&gt;/TRANS.TBL
# curl &lt;The URL of the network share when PXE installing&gt;/&lt;directory of data for installing the system&gt;/images/pxeboot/vmlinuz -O &lt;directory of EFI boot file for installing the system&gt;/vmlinuz</code></pre>



<p>如果是 openSUSE &amp; SLE 的话则拷贝 linux 文件和 initrd 文件：</p>



<pre class="wp-block-code"><code># curl &lt;The URL of the network share when PXE installing&gt;/&lt;directory of data for installing the system&gt;/boot/x86_64/loader/linux -O &lt;directory of EFI boot file for installing the system&gt;/linux
# curl &lt;The URL of the network share when PXE installing&gt;/&lt;directory of data for installing the system&gt;/boot/x86_64/loader/initrd -O &lt;directory of EFI boot file for installing the system&gt;/initrd</code></pre>



<h4 id="2-3-准备系统安装配置文件2-3-1-进入到用于存放系统安装配置文件的目录">2.3 准备系统安装配置文件<br>2.3.1 进入到用于存放系统安装配置文件的目录</h4>



<pre class="wp-block-code"><code># cd &lt;directory of profile for installing the system&gt;</code></pre>



<p>（注意：进入到用于存放系统安装配置文件的目录必须要放在能够实现 PXE 安装时网络共享的目录里（例如：通过 httpd 服务进行网络共享））</p>



<h4 id="2-3-2-创建系统安装配置文件2-3-2-1-创建-bios-系统安装配置文件">2.3.2 创建系统安装配置文件<br>2.3.2.1 创建 BIOS 系统安装配置文件</h4>



<p>如果是 Rocky Linux &amp; RHEL 的话</p>



<pre class="wp-block-code"><code># vim &lt;BIOS system installation profile&gt;</code></pre>



<p>（步骤略）</p>



<p>（<br>补充：<br>1) 如果是 Rocky Linux &amp; RHEL 的话系统安装配置文件是 CFG 文件，文件名最好以 .cfg 后缀结尾<br>2) 如果是 openSUSE &amp; SLE 的话系统安装配置文件是 XML 文件，文件名最好以 .xml 后缀结尾<br>）</p>



<h4 id="2-3-2-2-创建-efi-系统安装配置文件">2.3.2.2 创建 EFI 系统安装配置文件</h4>



<pre class="wp-block-code"><code># vim &lt;EFI system installation profile&gt;</code></pre>



<p>（步骤略）</p>



<p>（<br>补充：<br>1) 如果是 Rocky Linux &amp; RHEL 的话系统安装配置文件是 CFG 文件，文件名最好以 .cfg 后缀结尾<br>2) 如果是 openSUSE &amp; SLE 的话系统安装配置文件是 XML 文件，文件名最好以 .xml 后缀结尾<br>）</p>



<h4 id="2-3-3-设置系统安装配置文件的权限2-3-3-1-设置-bios-系统安装配置文件的权限">2.3.3 设置系统安装配置文件的权限<br>2.3.3.1 设置 BIOS 系统安装配置文件的权限</h4>



<pre class="wp-block-code"><code># chmod 755 &lt;BIOS system installation profile&gt;</code></pre>



<h4 id="2-3-3-2-设置-efi-系统安装配置文件的权限">2.3.3.2 设置 EFI 系统安装配置文件的权限</h4>



<pre class="wp-block-code"><code># chmod 755 &lt;EFI system installation profile&gt;</code></pre>



<h4 id="2-4-修改系统安装菜单文件-pxelinux-cfg2-4-1-修改-bios-系统安装菜单文件-pxelinux-cfg">2.4 修改系统安装菜单文件 pxelinux.cfg<br>2.4.1 修改 BIOS 系统安装菜单文件 pxelinux.cfg</h4>



<pre class="wp-block-code"><code># vim &lt;directory of file for BIOS system installation menu&gt;/pxelinux.cfg</code></pre>



<p>如果是 Rocky Linux &amp; RHEL 的话，添加以下内容：</p>



<pre class="wp-block-code"><code>......
label Rocky Linux or RHEL
  menu label ^Installation Rocky Linux or RHEL
  kernel &lt;relative directory of pxelinux.cfg of BIOS boot file for installing the system&gt;/vmlinuz
  append initrd=/&lt;relative directory of pxelinux.cfg of BIOS boot file for installing the system&gt;/initrd.img ks=&lt;The URL of the network share when PXE installing&gt;/&lt;BIOS system installation profile&gt;</code></pre>



<p>（注意：这里的 vmlinuz 文件和 initrd.im 文件的位置要写 pxelinux.cfg 文件的相对路径）</p>



<p>如果是 openSUSE &amp; SLE 的话，添加以下内容：</p>



<pre class="wp-block-code"><code>......
label openSUSE or SLE
  menu label ^Installation openSUSE or SLE
  kernel &lt;relative directory of pxelinux.cfg of BIOS boot file for installing the system&gt;/linux
  append initrd=&lt;relative directory of pxelinux.cfg of BIOS boot file for installing the system&gt;/initrd splash=silent showopts install=&lt;The URL of the network share when PXE installing&gt;/&lt;directory of data for installing the system&gt;/ autoyast=&lt;The URL of the network share when PXE installing&gt;/&lt;BIOS system installation profile&gt;</code></pre>



<p>（注意：这里的 linux 文件和 initrd 文件的位置要写 pxelinux.cfg 文件的相对路径）</p>



<p>（注意：用于存放 BIOS 系统安装菜单文件的目录必须要放在能够实现 TFPT 网络共享的目录里）</p>



<h4 id="2-4-2-修改-efi-系统安装菜单文件-grub-cfg">2.4.2 修改 EFI 系统安装菜单文件 grub.cfg</h4>



<pre class="wp-block-code"><code># vim &lt;directory of file for EFI system installation menu&gt;/grub.cfg</code></pre>



<p>如果是 Rocky Linux &amp; RHEL 的话，添加以下内容：</p>



<pre class="wp-block-code"><code>......
label Rocky Linux or RHEL
  menu label ^Installation Rocky Linux or RHEL
  kernel &lt;relative directory of pxelinux.cfg of EFI boot file for installing the system&gt;/vmlinuz
  append initrd=/&lt;relative directory of pxelinux.cfg of EFI boot file for installing the system&gt;/initrd.img ks=&lt;The URL of the network share when PXE installing&gt;/&lt;EFI system installation profile&gt;</code></pre>



<p>（注意：这里的 vmlinuz 文件和 initrd.im 文件的位置要写 pxelinux.cfg 文件的相对路径）</p>



<p>如果是 openSUSE &amp; SLE 的话，添加以下内容：</p>



<pre class="wp-block-code"><code>......
label openSUSE or SLE
  menu label ^Installation openSUSE or SLE
  kernel &lt;relative directory of pxelinux.cfg of EFI boot file for installing the system&gt;/linux
  append initrd=&lt;relative directory of pxelinux.cfg of EFI boot file for installing the system&gt;/initrd splash=silent showopts install=&lt;The URL of the network share when PXE installing&gt;/&lt;directory of data for installing the system&gt;/ autoyast=&lt;The URL of the network share when PXE installing&gt;/&lt;EFI system installation profile&gt;</code></pre>



<p>（注意：这里的 linux 文件和 initrd 文件的位置要写 pxelinux.cfg 文件的相对路径）</p>



<p>（注意：用于存放 EFI 系统安装菜单文件的目录必须要放在能够实现 TFPT 网络共享的目录里）</p>



<h4 id="步骤三-取消挂载安装镜像-1">步骤三：取消挂载安装镜像</h4>



<pre class="wp-block-code"><code># umount &lt;directory for mounting the image&gt;</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 hdparm （测试硬盘读取速度）</title>
		<link>https://eternalcenter-may-1-2022.github.io/hdparm/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 07 Feb 2022 11:22:26 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=21888</guid>

					<description><![CDATA[（补充：这里以测试 /dev/sda 硬盘的读取速度为例）]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code> # hdparm -Ttv /dev/sda

/dev/sda:
 multcount     = 128 (on)
 IO_support    =  1 (32-bit)
 readonly      =  0 (off)
 readahead     = 1024 (on)
 geometry      = 8354/255/63, sectors = 134217728, start = 0
 Timing cached reads:   7304 MB in  2.00 seconds = 3658.90 MB/sec
 Timing buffered disk reads: 612 MB in  3.01 seconds = 203.07 MB/sec</code></pre>



<p>（补充：这里以测试 /dev/sda 硬盘的读取速度为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 sensors 的使用 （显示系统硬件温度）</title>
		<link>https://eternalcenter-may-1-2022.github.io/sensors/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sun, 06 Feb 2022 10:09:17 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=21881</guid>

					<description><![CDATA[步骤一：安装 sensors 命令 如果是 RHEL &#38; Rocky Linux： 如果是 openSUSE &#38; SLE： 步骤二：显示温度传感器 步骤三：显示系统硬件温度]]></description>
										<content:encoded><![CDATA[
<h4 id="步骤一-安装-sensors-命令">步骤一：安装 sensors 命令</h4>



<p>如果是 RHEL &amp; Rocky Linux：</p>



<pre class="wp-block-code"><code># yum install sensors</code></pre>



<p>如果是 openSUSE &amp; SLE：</p>



<pre class="wp-block-code"><code># zypper install sensors</code></pre>



<h4 id="步骤二-检查温度传感器">步骤二：显示温度传感器</h4>



<pre class="wp-block-code"><code># sensors-detect</code></pre>



<h4 id="步骤三-查看系统硬件温度">步骤三：显示系统硬件温度</h4>



<pre class="wp-block-code"><code># sensors</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] KVM 虚拟机模板的创建 （Rocky Linux 8 版）</title>
		<link>https://eternalcenter-may-1-2022.github.io/kvm-template-install-rocky-linux-8/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sun, 06 Feb 2022 09:08:24 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Cloud Computing (云计算)]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Installation (系统安装)]]></category>
		<category><![CDATA[Virtualization (虚拟化)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=21850</guid>

					<description><![CDATA[注意： 在创建 KVM 虚拟机之前要先安装 KVM 并创建 KVM 虚拟网络 软件准备： 在 Rocky Linux 官网上下载安装系统所需要的镜像： https://rockylinux.org/download 正文： 步骤目录： 步骤一：理解创建 KVM 虚拟机模板的目的 步骤二：为这个虚拟机创建硬盘文件2.1 创建硬盘文件2.2 确认硬盘文件已创建 步骤三：使用 KVM 和刚刚创建的硬盘文件新安装一台虚拟机3.1 启动 KVM 的 virt-manager3.2 在 virt-manager 上的左上角点击文件之后点击 “新建虚拟机”3.2.1 选择以本地安装介质的方式安装系统3.2.2 选择安装系统的系统镜像3.2.3 设置内存大小和 CPU 核心数3.2.4 选择用刚刚创建的硬盘文件来安装系统3.2.5 给虚拟机命名并选择虚拟网络3.2.6 开始安装系统3.2.7 选择系统语言3.2.8 之后进行系统配置界面3.2.8.1 通过 “INSTALLATION DESTINATION” 对硬盘进行分区3.2.8.2 取消 “KDUMP”3.2.8.3 选择最小化安装系统3.2.8.4 设置 root 密码3.2.9 之后点击右下角的 “Begin &#8230; <p class="link-more"><a href="https://eternalcenter-may-1-2022.github.io/kvm-template-install-rocky-linux-8/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] KVM 虚拟机模板的创建 （Rocky Linux 8 版）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h2 id="注意">注意：</h2>



<p>在创建 KVM 虚拟机之前要先安装 KVM 并创建 KVM 虚拟网络</p>



<div class="wp-container-2 wp-block-buttons">
<div class="wp-block-button is-style-outline"><a class="wp-block-button__link no-border-radius" href="https://eternalcenter-may-1-2022.github.io/kvm-install/">KVM 的安装</a></div>



<div class="wp-block-button is-style-outline"><a class="wp-block-button__link no-border-radius" href="https://eternalcenter-may-1-2022.github.io/kvm-network-install/">KVM 虚拟网络的创建</a></div>
</div>



<h2 id="软件准备">软件准备：</h2>



<p>在 Rocky Linux 官网上下载安装系统所需要的镜像：</p>



<p class="has-text-align-center"><a href="https://rockylinux.org/download">https://rockylinux.org/download</a></p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 id="正文">正文：</h2>



<h2 id="步骤目录">步骤目录：</h2>



<h4 id="步骤一-理解创建-kvm-虚拟机模板的目的-1">步骤一：理解创建 KVM 虚拟机模板的目的</h4>



<h4 id="步骤二-为这个虚拟机创建硬盘文件-2-1-创建硬盘文件-2-2-确认硬盘文件已创建">步骤二：为这个虚拟机创建硬盘文件<br>2.1 创建硬盘文件<br>2.2 确认硬盘文件已创建</h4>



<h4 id="步骤三-使用-kvm-和刚刚创建的硬盘文件新安装一台虚拟机-3-1-启动-kvm-的-virt-manager-3-2-在-virt-manager-上的左上角点击文件之后点击-新建虚拟机-3-2-1-选择以本地安装介质的方式安装系统-3-2-2-选择安装系统的系统镜像-3-2-3-设置内存大小和处理器数量-3-2-4-选择用刚刚创建的硬盘文件来安装系统-3-2-5-给虚拟机命名并选择虚拟网络-3-2-6-开始安装系统-3-2-7-选择系统语言-3-2-8-之后进行系统配置界面-3-2-8-1-通过-installation-destination-对硬盘进行分区-3-2-8-2-取消-kdump-3-2-8-3-选择最小化安装系统-3-2-8-4-设置-root-密码-3-2-9-之后点击右下角的-begin-installation-3-2-10-安装完成后重启-3-2-11-在安装系统的过程中需要注意的内容总结">步骤三：使用 KVM 和刚刚创建的硬盘文件新安装一台虚拟机<br>3.1 启动 KVM 的 virt-manager<br>3.2 在 virt-manager 上的左上角点击文件之后点击 “新建虚拟机”<br>3.2.1 选择以本地安装介质的方式安装系统<br>3.2.2 选择安装系统的系统镜像<br>3.2.3 设置内存大小和 CPU 核心数<br>3.2.4 选择用刚刚创建的硬盘文件来安装系统<br>3.2.5 给虚拟机命名并选择虚拟网络<br>3.2.6 开始安装系统<br>3.2.7 选择系统语言<br>3.2.8 之后进行系统配置界面<br>3.2.8.1 通过 “INSTALLATION DESTINATION” 对硬盘进行分区<br>3.2.8.2 取消 “KDUMP”<br>3.2.8.3 选择最小化安装系统<br>3.2.8.4 设置 root 密码<br>3.2.9 之后点击右下角的 “Begin installation”<br>3.2.10 安装完成后重启<br>3.2.11 在安装系统的过程中需要注意的内容总结</h4>



<h4 id="步骤四-进入新创建虚拟机修改配置-4-1-修改网卡个性化设置-4-1-1-修改网卡配置文件-4-1-2-使修改的网卡配置生效-4-2-禁用-selinux-4-3-禁用空路由-4-4-添加-console-配置-4-4-1-修改-grub-内核配置文件-4-4-2-使修改的-grub-内核配置生效-4-5-将系统自动挂载的硬盘从使用-uuid-换成硬件路径-4-5-1-显示根分区的-uuid-4-5-2-在自动挂载文件里将根分区的-uuid-换成硬件路径-4-6-删除不用的程序-4-7-对虚拟系统进行升级-4-8-进行分区扩展-4-8-1-安装分区扩展软件-4-8-2-给开机自启配置文件相应的权限-4-8-3-设置开机自动扩容根目录-4-9-修改虚拟机系统的名称-4-10-启用-serial-服务实现通过-virsh-console-命令控制虚拟机-4-11-清除虚拟系统的历史命令-4-12-关闭虚拟机">步骤四：进入新创建虚拟机修改配置<br>4.1 修改网卡个性化设置<br>4.1.1 修改网卡配置文件<br>4.1.2 使修改的网卡配置生效<br>4.2 禁用 SELinux<br>4.3 禁用空路由<br>4.4 添加 Console 配置<br>4.4.1 修改 grub 内核配置文件<br>4.4.2 使修改的 grub 内核配置生效<br>4.5 将系统自动挂载的硬盘从使用 UUID 换成硬件路径<br>4.5.1 显示根分区的 UUID<br>4.5.2 在自动挂载文件里将根分区的 UUID 换成硬件路径<br>4.6 删除不用的程序<br>4.7 对虚拟系统进行升级<br>4.8 进行分区扩展<br>4.8.1 安装分区扩展软件<br>4.8.2 给开机自启配置文件相应的权限<br>4.8.3 设置开机自动扩容根目录<br>4.9 修改虚拟机系统的名称<br>4.10 启用 serial 服务实现通过 virsh console 命令控制虚拟机<br>4.11 清除虚拟系统的历史命令<br>4.12 关闭虚拟机</h4>



<h4 id="步骤五-在真机上对虚拟机进行清理优化-1">步骤五：在真机上对虚拟机进行清理优化</h4>



<h4 id="步骤六-此时就可以将此虚拟机的硬件文件作为模板进行批量克隆虚拟机了-1">步骤六：此时就可以将此虚拟机的硬件文件作为模板进行批量克隆虚拟机了</h4>



<h2 id="具体的操作步骤">具体的操作步骤：</h2>



<h4 id="步骤一-理解创建-kvm-虚拟机模板的目的">步骤一：理解创建 KVM 虚拟机模板的目的</h4>



<p>主要用于批量克隆出新的 KVM 机器，节约创建新虚拟机的时间</p>



<h4 id="步骤二-为这个虚拟机创建硬盘文件-template-centos-8-10g-qcow22-1-创建硬盘文件-template-centos-8-10g-qcow2">步骤二：为这个虚拟机创建硬盘文件<br>2.1 创建硬盘文件</h4>



<p>（只在真机上执行以下步骤）</p>



<pre class="wp-block-code"><code># qemu-img create -f qcow2 /var/lib/libvirt/images/rockylinux8.qcow2 10G</code></pre>



<p>（补充：这里以创建 10G 大小的 rockylinux8.qcow2 硬盘文件为例）</p>



<h4 id="2-2-确认硬盘文件已创建">2.2 确认硬盘文件已创建</h4>



<p>（只在真机上执行以下步骤）</p>



<pre class="wp-block-code"><code># ls /var/lib/libvirt/images/ | grep rockylinux8.qcow2</code></pre>



<p>（补充：这里以显示 rockylinux8.qcow2 硬盘文件为例）</p>



<h4 id="步骤三-使用-kvm-和刚刚创建的硬盘文件新安装一台虚拟机3-1-启动-kvm-的-virt-manager">步骤三：使用 KVM 和刚刚创建的硬盘文件新安装一台虚拟机<br>3.1 启动 KVM 的 virt-manager</h4>



<p>（只在真机上执行以下步骤）</p>



<pre class="wp-block-code"><code># virt-manager</code></pre>



<h4 id="3-2-在-virt-manager-上的左上角点击文件之后点击-新建虚拟机">3.2 在 virt-manager 上的左上角点击文件之后点击 “新建虚拟机”</h4>



<p>（只在真机上执行以下步骤）</p>



<p>（步骤略）</p>



<h4 id="3-2-1-选择以本地安装介质的方式安装系统">3.2.1 选择以本地安装介质的方式安装系统</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img width="494" height="530" src="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-1.png" alt="" class="wp-image-21851" srcset="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-1.png 494w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-1-280x300.png 280w" sizes="(max-width: 494px) 100vw, 494px" /><figcaption><em>（图：1）</em></figcaption></figure></div>



<h4 id="3-2-2-选择安装系统的系统镜像">3.2.2 选择安装系统的系统镜像</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="494" height="530" src="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-2.png" alt="" class="wp-image-21852" srcset="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-2.png 494w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-2-280x300.png 280w" sizes="(max-width: 494px) 100vw, 494px" /><figcaption><em>（图：2）</em></figcaption></figure></div>



<p>（补充：这里以使用 Rocky-8.5-x86_6-dvd1.iso 系统镜像为例）</p>



<h4 id="3-2-3-设置内存大小和处理器数量">3.2.3 设置内存大小和 CPU 核心数</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="494" height="530" src="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-3.png" alt="" class="wp-image-21853" srcset="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-3.png 494w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-3-280x300.png 280w" sizes="(max-width: 494px) 100vw, 494px" /><figcaption><em>（图：3）</em></figcaption></figure></div>



<p>（补充：这里以设置 2048 MiB 内容和 2 核 CPU 为例）</p>



<h4 id="3-2-4-选择用刚刚创建的硬盘文件来安装系统">3.2.4 选择用刚刚创建的硬盘文件来安装系统</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="494" height="530" src="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-4.png" alt="" class="wp-image-21854" srcset="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-4.png 494w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-4-280x300.png 280w" sizes="(max-width: 494px) 100vw, 494px" /><figcaption><em>（图：4）</em></figcaption></figure></div>



<p>（补充：这里以使用 rockylinux8.qcow2 硬盘文件为例）</p>



<h4 id="3-2-5-给虚拟机命名并选择虚拟网络">3.2.5 给虚拟机命名并选择虚拟网络</h4>



<p>（只在真机上执行以下步骤）</p>



<p>（注意：虚拟网络必须提前创建好）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="494" height="533" src="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-5.png" alt="" class="wp-image-21855" srcset="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-5.png 494w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-5-278x300.png 278w" sizes="(max-width: 494px) 100vw, 494px" /><figcaption><em>（图：5）</em></figcaption></figure></div>



<p>（补充：这里以将虚拟机命名为 rockylinux8 并使用 0 网络为例）</p>



<h4 id="3-2-6-开始安装系统">3.2.6 开始安装系统</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="794" height="630" src="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-6.png" alt="" class="wp-image-21856" srcset="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-6.png 794w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-6-300x238.png 300w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-6-768x609.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption><em>（图：6）</em></figcaption></figure></div>



<h4 id="3-2-7-选择系统语言">3.2.7 选择系统语言</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="1016" height="762" src="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-7.png" alt="" class="wp-image-21857" srcset="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-7.png 1016w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-7-300x225.png 300w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-7-768x576.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption><em>（图：7）</em></figcaption></figure></div>



<h4 id="3-2-8-之后进行系统配置界面">3.2.8 之后进行系统配置界面</h4>



<p>（只在真机上执行以下步骤）</p>



<p>需要手动配置的地方有四个：<br>1) “INSTALLATION DESTINATION”<br>2) “KDUMP”<br>3) “SOFTWARE SELECTION”<br>4) “Root Password”<br>分别点击以后就可以配置了</p>



<h4 id="3-2-8-1-通过-installation-destination-对硬盘进行分区">3.2.8.1 通过 “INSTALLATION DESTINATION” 对硬盘进行分区</h4>



<p>（只在真机上执行以下步骤）</p>



<p>（补充：完成后点击左上角的 “DONE”）</p>



<p>（注意：只分一个分区，只设置一个挂载点挂载到根，使用标准硬盘类型，硬盘格式设置为 XFS）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="1016" height="762" src="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-8.png" alt="" class="wp-image-21858" srcset="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-8.png 1016w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-8-300x225.png 300w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-8-768x576.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption><em>（图：8）</em></figcaption></figure></div>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="1016" height="762" src="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-9.png" alt="" class="wp-image-21859" srcset="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-9.png 1016w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-9-300x225.png 300w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-9-768x576.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption><em>（图：9）</em></figcaption></figure></div>



<h4 id="3-2-8-2-取消-kdump">3.2.8.2 取消 “KDUMP”</h4>



<p>（只在真机上执行以下步骤）</p>



<p>（补充：完成后点击左上角的 “DONE”）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="1016" height="762" src="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-10.png" alt="" class="wp-image-21860" srcset="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-10.png 1016w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-10-300x225.png 300w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-10-768x576.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption><em>（图：10）</em></figcaption></figure></div>



<h4 id="3-2-8-3-选择最小化安装系统">3.2.8.3 选择最小化安装系统</h4>



<p>（只在真机上执行以下步骤）</p>



<p>（补充：完成后点击左上角的 “DONE”）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="1016" height="762" src="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-11.png" alt="" class="wp-image-21861" srcset="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-11.png 1016w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-11-300x225.png 300w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-11-768x576.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption><em>（图：11）</em></figcaption></figure></div>



<h4 id="3-2-8-4-设置-root-密码">3.2.8.4 设置 root 密码</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="1016" height="762" src="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-12.png" alt="" class="wp-image-21862" srcset="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-12.png 1016w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-12-300x225.png 300w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-12-768x576.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption><em>（图：12）</em></figcaption></figure></div>



<h4 id="3-2-9-之后点击右下角的-begin-installation">3.2.9 之后点击右下角的 “Begin installation”</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="1016" height="762" src="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-13.png" alt="" class="wp-image-21863" srcset="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-13.png 1016w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-13-300x225.png 300w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-13-768x576.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption><em>（图：13）</em></figcaption></figure></div>



<h4 id="3-2-10-安装完成后重启">3.2.10 安装完成后重启</h4>



<p>（只在真机上执行以下步骤）</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="1016" height="762" src="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-14.png" alt="" class="wp-image-21864" srcset="https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-14.png 1016w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-14-300x225.png 300w, https://eternalcenter-may-1-2022.github.io/wp-content/uploads/2022/02/KVM-template-Rocky-Linux-8-14-768x576.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption><em>（图：14）</em></figcaption></figure></div>



<h4 id="3-2-11-在安装系统的过程中需要注意的内容总结">3.2.11 在安装系统的过程中需要注意的内容总结</h4>



<p>（只在真机上执行以下步骤）</p>



<p>1) 一定要使用刚刚创建的 /var/lib/libvirt/images/rockylinux8.qcow2 作为安装虚拟机的硬件文件<br>2) 虚拟机网络 “0” 要提前创建好<br>3) 只分一个分区，只设置一个挂载点挂载到根，使用标准硬盘，硬盘格式是 XFS<br>4) 取消 “KDUMP”<br>5) 选择最小化安装系统<br>6) 设置 root 密码</p>



<h4 id="步骤四-进入新创建虚拟机修改配置4-1-修改网卡个性化设置4-1-1-修改网卡配置文件">步骤四：进入新创建虚拟机修改配置<br>4.1 修改网卡个性化设置<br>4.1.1 修改网卡配置文件</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># vi /etc/sysconfig/network-scripts/ifcfg-enp1s0</code></pre>



<p>将全部内容修改如下：</p>



<pre class="wp-block-code"><code>TYPE=Ethernet
BOOTPROTO=dhcp
NAME=enp1s0
DEVICE=enp1s0
ONBOOT=yes</code></pre>



<h4 id="4-1-2-使修改的网卡配置生效">4.1.2 使修改的网卡配置生效</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># reboot</code></pre>



<h4 id="4-2-禁用-selinux">4.2 禁用 SELinux</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># vi /etc/selinux/config</code></pre>



<p>将全部内容修改如下：</p>



<pre class="wp-block-code"><code># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted</code></pre>



<h4 id="4-3-禁用空路由">4.3 禁用空路由</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># vi /etc/sysconfig/network</code></pre>



<p>将全部内容修改如下：</p>



<pre class="wp-block-code"><code># Created by anaconda
NOZEROCONF="yes"</code></pre>



<h4 id="4-4-添加-console-配置4-4-1-修改-grub-内核配置文件">4.4 添加 Console 配置<br>4.4.1 修改 grub 内核配置文件</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># vi /etc/default/grub</code></pre>



<p>将全部内容修改如下：</p>



<pre class="wp-block-code"><code>GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL="serial console"
GRUB_SERIAL_COMMAND="serial --unit=1 --speed=115200"
GRUB_CMDLINE_LINUX="biosdevname=0 net.ifnames=0 console=tty0 console=ttyS0,115200n8"
GRUB_DISABLE_LINUX_UUID="true"
GRUB_ENABLE_LINUX_LABEL="true"
GRUB_DISABLE_RECOVERY="true"</code></pre>



<h4 id="4-4-2-使修改的-grub-内核配置生效">4.4.2 使修改的 grub 内核配置生效</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># grub2-mkconfig -o grub</code></pre>



<h4 id="4-5-将系统自动挂载的硬盘从使用-uuid-换成硬件路径4-5-1-显示根分区的-uuid">4.5 将系统自动挂载的硬盘从使用 UUID 换成硬件路径<br>4.5.1 显示根分区的 UUID</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># blkid
/dev/sda1: UUID="e76ed189-6d0f-49d5-8586-c5aae4bdc9b5" TYPE="xfs" PARTUUID="3d8377ef-01"</code></pre>



<p>（补充：这里的 UUID 是： e76ed189-6d0f-49d5-8586-c5aae4bdc9b5）</p>



<h4 id="4-5-2-在自动挂载文件里将根分区的-uuid-换成硬件路径">4.5.2 在自动挂载文件里将根分区的 UUID 换成硬件路径</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># vi /etc/fstab</code></pre>



<p>将以下内容：</p>



<pre class="wp-block-code"><code>......
UUID=e76ed189-6d0f-49d5-8586-c5aae4bdc9b5 /                   xfs     defaults        0 0</code></pre>



<p>（补充：这里的 UUID 是： e76ed189-6d0f-49d5-8586-c5aae4bdc9b5）</p>



<p>修改为：</p>



<pre class="wp-block-code"><code>/dev/sda1 /                   xfs     defaults        0 0</code></pre>



<h4 id="4-6-删除不用的程序">4.6 删除不用的程序</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># yum -y remove firewalld-* python-firewall</code></pre>



<h4 id="4-7-对虚拟系统进行升级">4.7 对虚拟系统进行升级</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># yum -y update</code></pre>



<h4 id="4-9-进行分区扩展4-9-1-安装分区扩展软件">4.8 进行分区扩展<br>4.8.1 安装分区扩展软件</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># yum install -y cloud-utils-growpart</code></pre>



<h4 id="4-8-2-给开机自启配置文件相应的权限">4.8.2 给开机自启配置文件相应的权限</h4>



<pre class="wp-block-code"><code># chmod 755 /etc/rc.local</code></pre>



<h4 id="4-8-3-设置开机自动扩容根目录">4.8.3 设置开机自动扩容根目录</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># vi /etc/rc.local</code></pre>



<p>添加以下内容：</p>



<pre class="wp-block-code"><code>......
/usr/bin/growpart /dev/sda1
/usr/sbin/xfs_growfs /</code></pre>



<h4 id="4-9-修改虚拟机系统的名称">4.9 修改虚拟机系统的名称</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># vi /etc/hostname</code></pre>



<p>将全部内容修改如下：</p>



<pre class="wp-block-code"><code>rockylinux8</code></pre>



<h4 id="4-10-启用-serial-服务实现通过-virsh-console-命令控制虚拟机">4.10 启用 serial 服务实现通过 virsh console 命令控制虚拟机</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># systemctl start serial-getty@ttyS0
# systemctl enable serial-getty@ttyS0</code></pre>



<h4 id="4-11-清除虚拟系统的历史命令">4.11 清除虚拟系统的历史命令</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># history -c</code></pre>



<h4 id="4-12-关闭虚拟机">4.12 关闭虚拟机</h4>



<p>（只在虚拟机上执行以下步骤）</p>



<pre class="wp-block-code"><code># poweroff</code></pre>



<h4 id="步骤五-在真机上对虚拟机进行清理优化">步骤五：在真机上对虚拟机进行清理优化</h4>



<p>（只在真机上执行以下步骤）</p>



<pre class="wp-block-code"><code># sudo virt-sysprep -d rockylinux8</code></pre>



<p>（补充：这里以清理 rockylinux8 虚拟机为例）</p>



<p>（<br>注意：如果此命令不存在<br>1) Rocky Linux 系统的话需要安装 libguestfs-tools<br>2) openSUSE 系统的话需要安装 guestfs-tools<br>）</p>



<h4 id="步骤六-此时就可以将此虚拟机的硬件文件作为模板进行批量克隆虚拟机了">步骤六：此时就可以将此虚拟机的硬件文件作为模板进行批量克隆虚拟机了</h4>



<p>（只在真机上执行以下步骤）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] 系统升级 （从 openSUSE Leap 15.2 升级到 openSUSE Leap 15.3）</title>
		<link>https://eternalcenter-may-1-2022.github.io/upgrade-opensuse-leap-15-3/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sun, 03 Oct 2021 14:46:19 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Upgradation (系统升级)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=17771</guid>

					<description><![CDATA[步骤目录： 步骤一：显示现在的系统版本 步骤二：准备升级2.1 确认已使用的软件库2.2 刷新已使用的软件库2.3 升级到 openSUSE Leap 15.22.4 用 releasever 变量替换所有版本号 步骤三：升级系统3.1 将版本号设置为 15.3 并刷新3.2 提前下载并安装 openSUSE Leap 15.3 所需的软件包3.3 升级系统3.4 重启系统 步骤四：后续检查4.1 显示升级后的系统版本4.2 显示升级后已使用的软件库 具体的操作步骤： 步骤一：显示现在的系统版本 （注意：确保显示的系统版本是 openSUSE Leap 15.2） 步骤二：准备升级2.1 确认已使用的软件库 （补充：确保以上库已处于 Enabled 状态） 2.2 刷新已使用的软件库 （注意：确保刷新成功，否则请检查网络） 2.3 升级到 openSUSE Leap 15.2 2.4 用 releasever 变量替换所有版本号 步骤三：升级系统3.1 将版本号设置为 15.3 并刷新 3.2 提前下载并安装 &#8230; <p class="link-more"><a href="https://eternalcenter-may-1-2022.github.io/upgrade-opensuse-leap-15-3/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] 系统升级 （从 openSUSE Leap 15.2 升级到 openSUSE Leap 15.3）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h2 id="步骤目录">步骤目录：</h2>



<h4 id="步骤一-查看现在的系统版本">步骤一：显示现在的系统版本</h4>



<h4 id="步骤二-准备升级2-1-确认已使用的软件库2-2-刷新已使用的软件库2-3-升级到-opensuse-leap-15-22-4-用-releasever-变量替换所有版本号">步骤二：准备升级<br>2.1 确认已使用的软件库<br>2.2 刷新已使用的软件库<br>2.3 升级到 openSUSE Leap 15.2<br>2.4 用 releasever 变量替换所有版本号</h4>



<h4 id="步骤三-升级系统3-1-将版本号设置为-15-3-并刷新3-2-提前下载并安装-opensuse-leap-15-3-所需的软件包3-3-升级系统3-4-重启系统">步骤三：升级系统<br>3.1 将版本号设置为 15.3 并刷新<br>3.2 提前下载并安装 openSUSE Leap 15.3 所需的软件包<br>3.3 升级系统<br>3.4 重启系统</h4>



<h4 id="步骤四-后续检查4-1-显示升级后的系统版本4-2-显示升级后已使用的软件库">步骤四：后续检查<br>4.1 显示升级后的系统版本<br>4.2 显示升级后已使用的软件库</h4>



<h2 id="具体的操作步骤">具体的操作步骤：</h2>



<h4 id="步骤一-查看现在的系统版本">步骤一：显示现在的系统版本</h4>



<pre class="wp-block-code"><code># cat /etc/*release*
NAME="openSUSE Leap"
VERSION="15.2"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.2"
PRETTY_NAME="openSUSE Leap 15.2"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.2"
BUG_REPORT_URL="https://bugs.opensuse.org/"
HOME_URL="https://www.opensuse.org/"</code></pre>



<p>（注意：确保显示的系统版本是 openSUSE Leap 15.2）</p>



<h4 id="步骤二-准备升级2-1-确认已使用的软件库">步骤二：准备升级<br>2.1 确认已使用的软件库</h4>



<pre class="wp-block-code"><code># zypper ls -d
#  | Alias                     | Name                               | Enabled | GPG Check | Refresh | Priority | Type   | URI
---+---------------------------+------------------------------------+---------+-----------+---------+----------+--------+---------------------------------------------------------------------------------------------
1  | repo-non-oss              | Non-OSS Repository                 | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.2/repo/non-oss/
2  | repo-oss                  | Main Repository                    | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.2/repo/oss/
3 | repo-update               | Main Update Repository             | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.2/oss/
4 | repo-update-non-oss       | Update Repository (Non-Oss)        | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.2/non-oss/</code></pre>



<p>（补充：确保以上库已处于 Enabled 状态）</p>



<h4 id="2-2-刷新已使用的软件库">2.2 刷新已使用的软件库</h4>



<pre class="wp-block-code"><code># zypper ref</code></pre>



<p>（注意：确保刷新成功，否则请检查网络）</p>



<h4 id="2-3-升级到-opensuse-leap-15-2">2.3 升级到 openSUSE Leap 15.2</h4>



<pre class="wp-block-code"><code># zypper -n update</code></pre>



<h4 id="2-4-用-releasever-变量替换所有版本号">2.4 用 releasever 变量替换所有版本号</h4>



<pre class="wp-block-code"><code># sed -i 's/15.2/${releasever}/g' /etc/zypp/repos.d/*.repo</code></pre>



<h4 id="步骤三-升级系统3-1-将版本号设置为-15-3-并刷新">步骤三：升级系统<br>3.1 将版本号设置为 15.3 并刷新</h4>



<pre class="wp-block-code"><code># zypper --releasever=15.3 refresh</code></pre>



<h4 id="3-2-提前下载并安装-opensuse-leap-15-3-所需的软件包">3.2 提前下载并安装 openSUSE Leap 15.3 所需的软件包</h4>



<pre class="wp-block-code"><code># zypper --releasever=15.3 dup --download-in-advance</code></pre>



<h4 id="3-3-升级系统">3.3 升级系统</h4>



<pre class="wp-block-code"><code># zypper --releasever=15.3 dup</code></pre>



<h4 id="3-4-重启系统">3.4 重启系统</h4>



<pre class="wp-block-code"><code># reboot</code></pre>



<h4 id="步骤四-后续检查4-1-显示升级后的系统版本">步骤四：后续检查<br>4.1 显示升级后的系统版本</h4>



<pre class="wp-block-code"><code># cat /etc/*release*
NAME="openSUSE Leap"
VERSION="15.3"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.3"
PRETTY_NAME="openSUSE Leap 15.3"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.3"
BUG_REPORT_URL="https://bugs.opensuse.org/"
HOME_URL="https://www.opensuse.org/"</code></pre>



<h4 id="4-2-显示升级后已使用的软件库">4.2 显示升级后已使用的软件库</h4>



<pre class="wp-block-code"><code># zypper ls -d
#  | Alias                     | Name                                                         | Enabled | GPG Check | Refresh | Priority | Type   | URI
---+---------------------------+------------------------------------+---------+-----------+---------+----------+--------+---------------------------------------------------------------------------------------------
1  | repo-non-oss              | Non-OSS Repository                                           | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.3/repo/non-oss/
2  | repo-oss                  | Main Repository                                              | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.3/repo/oss/
3 | repo-update                | Main Update Repository                                       | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.3/oss/
4 | repo-update-non-oss        | Update Repository (Non-Oss)                                  | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.3/non-oss/
4  | repo-backports-update     | Update repository of openSUSE Backports                      | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.3/backports/
5  | repo-sle-update           | Update repository with updates from SUSE Linux Enterprise 15 | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.3/sle/</code></pre>



<p>（注意：升级到 openSUSE Leap 15.3 系统后，自动新增加了 repo-backports-update 软件库和 repo-sle-update 软件库）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] 通过 zypper 升级内核保留旧内核数量的设置 （openSUSE &#038; SLE ）</title>
		<link>https://eternalcenter-may-1-2022.github.io/zypper-kernel-reserve-opensuse-sle/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 27 Sep 2021 14:06:47 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Patch (系统补丁)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<category><![CDATA[System Upgradation (系统升级)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=17666</guid>

					<description><![CDATA[将以下内容： 修改为： （补充：这里以使用 zypper 升级内核时保留内核的数量从 3 个增加到 5 个为例）]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code># vim /etc/zypp/zypp.conf</code></pre>



<p>将以下内容：</p>



<pre class="wp-block-code"><code>......
multiversion.kernels = latest,latest-1,running
......</code></pre>



<p>修改为：</p>



<pre class="wp-block-code"><code>......
multiversion.kernels = latest,latest-1,latest-2,latest-3,running
......</code></pre>



<p>（补充：这里以使用 zypper 升级内核时保留内核的数量从 3 个增加到 5 个为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] CVE 简介</title>
		<link>https://eternalcenter-may-1-2022.github.io/introduction-to-cve/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 07 Sep 2021 06:09:11 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Patch (系统补丁)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Upgradation (系统升级)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=17618</guid>

					<description><![CDATA[内容一：什么叫 CVE CVE 全称是：Common Vulnerabilities and Exposures，翻译成中文是：常见脆弱性和暴露，是一个业界统一的脆弱性和暴露。 内容二：CVE 的常用格式 CVE-2016-4658，其中 2016-4658 是编号 内容三：CVE 的用途 用于标签系统和应用的漏洞，并实现了一个漏洞数据库以进行漏洞的查询和管理 内容四：CVE 的网站4.1 CVE 官方网站 https://www.cvedetails.com/ 4.2 RedHat CVE 官方网站4.2.1 RedHat CVE 官方网站 https://access.redhat.com/security/security-updates/#/cve 4.2.2 RedHat CVE 勘误官方网站 https://access.redhat.com/management/errata 4.3 openSUSE CVE 官方网站 openSUSE CVE 安全补丁官方网站 https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/ 4.4 SUSE CVE 官方网站 SUSE CVE 安全补丁官方网站 https://www.suse.com/security/cve/ 内容五：显示软件 CVE 信息5.1 显示软件 CVE 信息的变更历史 &#8230; <p class="link-more"><a href="https://eternalcenter-may-1-2022.github.io/introduction-to-cve/" class="more-link">Continue reading<span class="screen-reader-text"> "[内容] CVE 简介"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h4 id="内容一-什么叫-cve">内容一：什么叫 CVE</h4>



<p class="has-medium-font-size">CVE 全称是：Common Vulnerabilities and Exposures，翻译成中文是：常见脆弱性和暴露，是一个业界统一的脆弱性和暴露。</p>



<h4 id="内容二-cve-的常用格式">内容二：CVE 的常用格式</h4>



<p class="has-medium-font-size">CVE-2016-4658，其中  2016-4658  是编号</p>



<h4 id="内容三-cve-的用途">内容三：CVE 的用途</h4>



<p class="has-medium-font-size">用于标签系统和应用的漏洞，并实现了一个漏洞数据库以进行漏洞的查询和管理</p>



<h4>内容四：CVE 的网站<br>4.1 CVE 官方网站</h4>



<p class="has-medium-font-size">https://www.cvedetails.com/</p>



<h4>4.2 RedHat CVE 官方网站<br>4.2.1 RedHat CVE 官方网站</h4>



<p>https://access.redhat.com/security/security-updates/#/cve</p>



<h4>4.2.2 RedHat CVE 勘误官方网站</h4>



<p>https://access.redhat.com/management/errata</p>



<h4>4.3 openSUSE CVE 官方网站</h4>



<p>openSUSE CVE 安全补丁官方网站</p>



<p>https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/</p>



<h4>4.4 SUSE CVE 官方网站</h4>



<p>SUSE CVE 安全补丁官方网站</p>



<p>https://www.suse.com/security/cve/</p>



<h4>内容五：显示软件 CVE 信息<br>5.1 显示软件 CVE 信息的变更历史</h4>



<pre class="wp-block-code"><code># rpm -q openssh-clients --changelog | grep -i cve</code></pre>



<p>（补充：这里以显示 openssh-clients 软件的 CVE 信息的变更历史为例）</p>



<h4>5.2 显示软件现在的版本是否修复 CVE 漏洞</h4>



<pre class="wp-block-code"><code># rpm -qpi --changelog redis-6.0.14-6.8.1.x86_64.rpm |grep -E '32675'
- Fix CVE-2021-32675, Denial Of Service when processing RESP request
  (CVE-2021-32675, bsc#1191303)
  * cve-2021-32675.patch</code></pre>



<p>（补充：这里以确认 redis-6.0.14-6.8.1.x86_64.rpm 软件包是否已修复 CVE-2021-32675 为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 常见存储和存储类型介绍</title>
		<link>https://eternalcenter-may-1-2022.github.io/introduction-to-linux-common-storage-and-storage-types/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 19 Aug 2021 12:31:20 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Iscsi]]></category>
		<category><![CDATA[NFS]]></category>
		<category><![CDATA[Samba]]></category>
		<category><![CDATA[Services (服务)]]></category>
		<category><![CDATA[Storage Services (存储服务)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=17522</guid>

					<description><![CDATA[内容一：常见的存储 1. DAS（直连存储），就是接在主板上的硬盘2. NAS（网络附加存储），例如：NFS、Samba、FTP、HTTP，优点是管理简单，缺点是单点故障3. SAN（网络块存储），例如：Iscsi4. 分布时云存储，例如：Ceph、Swift 内容二：常见的存储类型 1. Block-based access（基于块存储的访问），对应的是块存储（block），例如：直接接在主板上的硬盘、Iscsi、Ceph2. File-based access（基于文件系统的访问），对应的是文件系统存储（filesystem），例如：NFS、Samba、FTP、HTTP、Ceph3. Object-based access（基于对象的访问），对应的是对象存储（object），例如：Ceph]]></description>
										<content:encoded><![CDATA[
<h4>内容一：常见的存储</h4>



<p>1. DAS（直连存储），就是接在主板上的硬盘<br>2. NAS（网络附加存储），例如：NFS、Samba、FTP、HTTP，优点是管理简单，缺点是单点故障<br>3. SAN（网络块存储），例如：Iscsi<br>4. 分布时云存储，例如：Ceph、Swift</p>



<h4>内容二：常见的存储类型</h4>



<p>1. Block-based access（基于块存储的访问），对应的是块存储（block），例如：直接接在主板上的硬盘、Iscsi、Ceph<br>2. File-based access（基于文件系统的访问），对应的是文件系统存储（filesystem），例如：NFS、Samba、FTP、HTTP、Ceph<br>3. Object-based access（基于对象的访问），对应的是对象存储（object），例如：Ceph</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 格式化特点</title>
		<link>https://eternalcenter-may-1-2022.github.io/linux-formatting-features/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 19 Aug 2021 12:02:18 +0000</pubDate>
				<category><![CDATA[Ceph]]></category>
		<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Clusters (集群)]]></category>
		<category><![CDATA[Distributed Cloud Storage Clusters (分布式云存储集群)]]></category>
		<category><![CDATA[Load Balancing and High Availability Clusters (负载均衡加高可用集群)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=17520</guid>

					<description><![CDATA[内容一：格式化后会产生的分区 格式化会格式出 inode 区和 block 区 内容二：inode 区和 block 区的作用 inode 区默认一格大小是 512 个字节，存储哪一份数据存在了哪些 block 里以及数据的所属者、权限创建时间等 metadata 元数据block 区默认一格大小是 4k，只存储数据本身 内容三：Linux 文件格式的特点 ext3 和 ext4 的 inode 区每一格较小，而 xfs 的 inode 区每一格更大，可以存储更多种类，例如快照等 metadata 元数据]]></description>
										<content:encoded><![CDATA[
<h4>内容一：格式化后会产生的分区</h4>



<p>格式化会格式出 inode 区和 block 区</p>



<h4>内容二：inode 区和 block 区的作用</h4>



<p>inode 区默认一格大小是 512 个字节，存储哪一份数据存在了哪些 block 里以及数据的所属者、权限创建时间等 metadata 元数据<br>block 区默认一格大小是 4k，只存储数据本身</p>



<h4>内容三：Linux 文件格式的特点</h4>



<p>ext3 和 ext4 的 inode 区每一格较小，而 xfs 的 inode 区每一格更大，可以存储更多种类，例如快照等 metadata 元数据</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] pip 工具的安装 （MacBook Air 版）</title>
		<link>https://eternalcenter-may-1-2022.github.io/macbook-air-pip/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 24 May 2021 06:17:53 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Django Foundation (基础)]]></category>
		<category><![CDATA[Django Model Layer (模型层)]]></category>
		<category><![CDATA[Django Template Layer (模版层)]]></category>
		<category><![CDATA[Django View Layer (视图层)]]></category>
		<category><![CDATA[Languages (语言)]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Python Basic (基础)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer (系统电脑)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=14337</guid>

					<description><![CDATA[内容目录： 内容一：安装 pip21.1 下载 pip21.2 安装 pip21.3 删除 pip21.4 显示安装的 pip21.4.1 显示在 python 里有没有 pip 安装包1.4.2 显示有没有 pip2 命令1.4.3 升级 pip2 内容二：安装 pip32.1 准备安装 pip3 所需的环境2.1.1 安装 python32.1.1.1 输入 python3 命令2.1.1.2 在弹出的对话框里安装 python32.1.2 安装 xcode2.1.2.1 输入 xcode-select &#8211;install 命令2.1.2.2 在弹出的对话框里安装 xcode2.2 安装 pip32.2.1 下载 pip32.2.2 安装 pip32.2.3 删除 pip32.2.4 显示安装的 pip32.2.4.1 显示在 python 里有没有 pip &#8230; <p class="link-more"><a href="https://eternalcenter-may-1-2022.github.io/macbook-air-pip/" class="more-link">Continue reading<span class="screen-reader-text"> "[内容] pip 工具的安装 （MacBook Air 版）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h2 id="内容目录">内容目录：</h2>



<h4 id="内容一-安装-pip2-1-1-下载-pip2-1-2-安装-pip2-1-3-删除-pip2-1-4-显示安装的-pip2-1-4-1-显示在-python-里有没有-pip-安装包-1-4-2-显示有没有-pip2-命令-1-4-3-升级-pip2">内容一：安装 pip2<br>1.1 下载 pip2<br>1.2 安装 pip2<br>1.3 删除 pip2<br>1.4 显示安装的 pip2<br>1.4.1 显示在 python 里有没有 pip 安装包<br>1.4.2 显示有没有 pip2 命令<br>1.4.3 升级 pip2</h4>



<h4 id="内容二-安装-pip3-2-1-准备安装-pip3-所需的环境-2-1-1-安装-python3-2-1-1-1-输入-python3-命令-2-1-1-2-在弹出的对话框里安装-python3-2-1-2-安装-xcode-2-1-2-1-输入-xcode-select-install-命令-2-1-2-2-在弹出的对话框里安装-xcode-2-2-安装-pip3-2-2-1-下载-pip3-2-2-2-安装-pip3-2-2-3-删除-pip3-2-2-4-显示安装的-pip3-2-2-4-1-显示在-python-里有没有-pip-安装包-2-2-4-2-显示有没有-pip3-命令-2-2-4-3-升级-pip3">内容二：安装 pip3<br>2.1 准备安装 pip3 所需的环境<br>2.1.1 安装 python3<br>2.1.1.1 输入 python3 命令<br>2.1.1.2 在弹出的对话框里安装 python3<br>2.1.2 安装 xcode<br>2.1.2.1 输入 xcode-select &#8211;install 命令<br>2.1.2.2 在弹出的对话框里安装 xcode<br>2.2 安装 pip3<br>2.2.1 下载 pip3<br>2.2.2 安装 pip3<br>2.2.3 删除 pip3<br>2.2.4 显示安装的 pip3<br>2.2.4.1 显示在 python 里有没有 pip 安装包<br>2.2.4.2 显示有没有 pip3 命令<br>2.2.4.3 升级 pip3</h4>



<h2 id="具体的内容">具体的内容：</h2>



<h4 id="内容一-安装-pip2-1-1-下载-pip2">内容一：安装 pip2<br>1.1 下载 pip2</h4>



<pre class="wp-block-code"><code>$ curl 'https://bootstrap.pypa.io/pip/2.7/get-pip.py' &gt; get-pip.py
</code></pre>



<h4 id="1-2-安装-pip2">1.2 安装 pip2</h4>



<pre class="wp-block-code"><code>$ sudo python get-pip.py</code></pre>



<h4 id="1-3-删除-pip2">1.3 删除 pip2</h4>



<pre class="wp-block-code"><code>$ rm get-pip.py
</code></pre>



<h4 id="1-4-显示安装的-pip2-1-4-1-显示在-python-里有没有-pip-安装包">1.4 显示安装的 pip2<br>1.4.1 显示在 python 里有没有 pip 安装包</h4>



<pre class="wp-block-code"><code>$ ls /Library/Python/2.7/site-packages/</code></pre>



<p>（补充：这里以 Python 版本是 2.7 为例）</p>



<h4 id="1-4-2-显示有没有-pip2-命令">1.4.2 显示有没有 pip2 命令</h4>



<pre class="wp-block-code"><code>$ which pip2</code></pre>



<h4 id="1-4-3-升级-pip2">1.4.3 升级 pip2</h4>



<pre class="wp-block-code"><code>$ sudo pip2 install --upgrade pip</code></pre>



<h4 id="内容二-安装-pip3-2-1-准备安装-pip3-所需的环境-2-1-1-安装-python3-2-1-1-1-输入-python3-命令">内容二：安装 pip3<br>2.1 准备安装 pip3 所需的环境<br>2.1.1 安装 python3<br>2.1.1.1 输入 python3 命令</h4>



<pre class="wp-block-code"><code>$ python3</code></pre>



<h4 id="2-1-1-2-在弹出的对话框里安装-python3">2.1.1.2 在弹出的对话框里安装 python3</h4>



<p>（步骤略）</p>



<h4 id="2-1-2-安装-xcode-2-1-2-1-输入-xcode-select-install-命令">2.1.2 安装 xcode<br>2.1.2.1 输入 xcode-select &#8211;install 命令</h4>



<pre class="wp-block-code"><code>$ xcode-select --install</code></pre>



<h4 id="2-1-2-2-在弹出的对话框里安装-xcode">2.1.2.2 在弹出的对话框里安装 xcode</h4>



<p>（步骤略）</p>



<h4 id="2-2-安装-pip3-2-2-1-下载-pip3">2.2 安装 pip3<br>2.2.1 下载 pip3</h4>



<pre class="wp-block-code"><code>$ curl 'https://bootstrap.pypa.io/pip/get-pip.py' &gt; get-pip.py</code></pre>



<h4 id="2-2-2-安装-pip3">2.2.2 安装 pip3</h4>



<pre class="wp-block-code"><code>$ sudo python get-pip.py</code></pre>



<h4 id="2-2-3-删除-pip3">2.2.3 删除 pip3</h4>



<pre class="wp-block-code"><code>$ rm get-pip.py</code></pre>



<h4 id="2-2-4-显示安装的-pip3-2-2-4-1-显示在-python-里有没有-pip-安装包">2.2.4 显示安装的 pip3<br>2.2.4.1 显示在 python 里有没有 pip 安装包</h4>



<pre class="wp-block-code"><code>$ ls /Library/Python/3.8/site-packages/</code></pre>



<p>（补充：这里以 Python 版本是 3.8 为例）</p>



<h4 id="2-2-4-2-显示有没有-pip3-命令">2.2.4.2 显示有没有 pip3 命令</h4>



<pre class="wp-block-code"><code>$ which pip3</code></pre>



<h4 id="2-2-4-3-升级-pip3">2.2.4.3 升级 pip3</h4>



<pre class="wp-block-code"><code>$ sudo pip3 install --upgrade pip</code></pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
