

<?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>rocky &#8211; Max的程式語言筆記</title>
	<atom:link href="https://stackoverflow.max-everyday.com/tag/rocky/feed/" rel="self" type="application/rss+xml" />
	<link>https://stackoverflow.max-everyday.com</link>
	<description>我要當一個豬頭，快樂過每一天</description>
	<lastBuildDate>Thu, 28 Mar 2024 08:29:54 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://stackoverflow.max-everyday.com/wp-content/uploads/2017/02/max-stackoverflow-256.png</url>
	<title>rocky &#8211; Max的程式語言筆記</title>
	<link>https://stackoverflow.max-everyday.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Ubuntu/Rocky lost eth0 inet ip(v4)</title>
		<link>https://stackoverflow.max-everyday.com/2024/02/ubuntu-lost-eth0-inet-ipv4/</link>
					<comments>https://stackoverflow.max-everyday.com/2024/02/ubuntu-lost-eth0-inet-ipv4/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Mon, 19 Feb 2024 07:42:55 +0000</pubDate>
				<category><![CDATA[電腦相關應用]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rocky]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://stackoverflow.max-everyday.com/?p=5433</guid>

					<description><![CDATA[VM 裡的 ubuntu server 的服務都...]]></description>
										<content:encoded><![CDATA[
<p>VM 裡的 ubuntu server 的服務都無法連上,  發現 inet6 (ip v6)是有位置, 但 ip v4 拿不到 ip address.</p>



<p>挑戰使用下面指令, 重新跟 DHCP 要 IP還是無解:</p>



<pre class="wp-block-code"><code>dhclient ens3</code></pre>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="639" height="356" src="https://stackoverflow.max-everyday.com/wp-content/uploads/2024/02/chrome_2024-02-19_14-57_b2.png?v=1708327150" alt="" class="wp-image-5434" srcset="https://stackoverflow.max-everyday.com/wp-content/uploads/2024/02/chrome_2024-02-19_14-57_b2.png?v=1708327150 639w, https://stackoverflow.max-everyday.com/wp-content/uploads/2024/02/chrome_2024-02-19_14-57_b2-600x334.png?v=1708327150 600w" sizes="(max-width: 639px) 100vw, 639px" /></figure>



<p>由於 ip v4 沒有功能, 造成 telent 指令會傳回錯誤訊息: </p>



<pre class="wp-block-preformatted">Unable to connect to remote host: Network is unreachable</pre>



<p>由於沒有網路可以使用, 這台VM 變成直接使用  console 的方式去控制, 伺服器裡的資料也帶不出來。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>服用下面指令, 就可以手動地, 把ipv4 加入 ens3</p>



<pre class="wp-block-code"><code>sudo ip addr add 192.168.211.17/16 dev ens3
sudo ip link set dev ens3 up
sudo ip link set dev ens3 down</code></pre>



<p>資料來源: Configuring networks<br><a href="https://ubuntu.com/server/docs/network-configuration">https://ubuntu.com/server/docs/network-configuration</a></p>



<p>說明：ens3 是網卡名，可能會是eth0</p>



<p>up 是啟用。</p>



<p>down 會被停用。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">Execute Command Using SSH</h2>



<p>Run / Execute Command SSH Command Syntax</p>



<p>The syntax is as follows for executing commands over ssh:</p>



<pre class="wp-block-code"><code>ssh user1@server1 command1
ssh user1@server1 'command2'

# pipe #
ssh user1@server1 'command1 | command2'

# multiple commands, must enclose in quotes
ssh admin@box1 "command1; command2; command3"</code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading" id="copy-files-from-remote-to-local">Copy Files From Remote to Local</h2>



<p>有 ip address 之後, 就可以使用 scp 指令, 把伺服器裡的檔案 copy 出來:</p>



<p>A better way to understand this is by use of an example. Take a scenario where you want to copy files from remote system. To copy the files you will need to first invoke the SCP, followed by the remote username@IP address, path to file.</p>



<p>If you do not specify the path, it is assumed as default in this case which will be the user&#8217;s home directory, this will be followed the path where the file will be stored locally.</p>



<p><strong>The Syntax</strong></p>



<pre class="wp-block-code"><code>scp &lt;remote_username&gt;@&lt;IPorHost&gt;:&lt;PathToFile&gt;   &lt;LocalFileLocation&gt;
</code></pre>



<p>I wanted to copy a file named remote-path from the remote device with this address <em>192.168.211.17</em>.</p>



<pre class="wp-block-code"><code>scp remote-account@<em>192.168.211.17</em>:remote-path .</code></pre>



<p>scp 指令語法:</p>



<pre class="wp-block-code"><code>usage: scp &#91;-346ABCOpqRrsTv] &#91;-c cipher] &#91;-D sftp_server_path] &#91;-F ssh_config]<br>&#91;-i identity_file] &#91;-J destination] &#91;-l limit]<br>&#91;-o ssh_option] &#91;-P port] &#91;-S program] source … target</code></pre>



<p>比較常用的應該只有大寫P 的 port 參數.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">Copy File From Local Host to Remote Server</h2>



<p>如果是要推檔案出去別台電腦：</p>



<pre class="wp-block-code"><code>scp -P port file remote-account@destination:/remote-path</code></pre>



<p>EX:</p>



<pre class="wp-block-code"><code>scp *.zip user@destination_host:/home/max/</code></pre>



<p>滿方便的，可以自動 overwrite exist file.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">Execute remote command</h2>



<p>用單引號或雙引號即可</p>



<pre class="wp-block-code"><code>ssh user1@server1 'command2'

# pipe
$ ssh user1@server1 'command1 | command2'

# multiple commands
$ ssh user1@server1 "command1; command2; command3"</code></pre>



<p>To execute multiple commands, each command needs to be separated using a semicolon(;) to be enclosed within a single quote or double quote,</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">Add backup user account</h2>



<p>在 ubuntu add user:</p>



<pre class="wp-block-code"><code>sudo adduser newuser</code></pre>



<p>設定帳號密碼 </p>



<pre class="wp-block-code"><code>sudo passwd newuser</code></pre>



<p>檢查groups</p>



<pre class="wp-block-code"><code>groups newuser</code></pre>



<p>ubuntu 加入為管理者:</p>



<pre class="wp-block-code"><code>sudo usermod -aG sudo newuser</code></pre>



<p>rocky 加入為管理者:</p>



<pre class="wp-block-code"><code>sudo usermod -aG wheel newuser</code></pre>



<p>切換目前的使用者帳號:</p>



<pre class="wp-block-code"><code>sudo su - newuser</code></pre>



<p>建立 SSH 金鑰, 指令用法：</p>



<pre class="wp-block-code"><code>usage: ssh-keygen &#91;-q] &#91;-b bits] &#91;-t dsa | ecdsa | ed25519 | rsa] &#91;-m format]
          &#91;-N new_passphrase] &#91;-C comment] &#91;-f output_keyfile]
ssh-keygen -p &#91;-P old_passphrase] &#91;-N new_passphrase] &#91;-m format]
           &#91;-f keyfile]
ssh-keygen -i &#91;-m key_format] &#91;-f input_keyfile]
ssh-keygen -e &#91;-m key_format] &#91;-f input_keyfile]
ssh-keygen -y &#91;-f input_keyfile]
ssh-keygen -c &#91;-P passphrase] &#91;-C comment] &#91;-f keyfile]
ssh-keygen -l &#91;-v] &#91;-E fingerprint_hash] &#91;-f input_keyfile]
ssh-keygen -B &#91;-f input_keyfile]
ssh-keygen -D pkcs11
ssh-keygen -F hostname &#91;-f known_hosts_file] &#91;-l]
ssh-keygen -H &#91;-f known_hosts_file]
ssh-keygen -R hostname &#91;-f known_hosts_file]
ssh-keygen -r hostname &#91;-f input_keyfile] &#91;-g]
ssh-keygen -G output_file &#91;-v] &#91;-b bits] &#91;-M memory] &#91;-S start_point]
ssh-keygen -T output_file -f input_file &#91;-v] &#91;-a rounds] &#91;-J num_lines]
          &#91;-j start_line] &#91;-K checkpt] &#91;-W generator]
ssh-keygen -s ca_key -I certificate_identity &#91;-h] &#91;-U]
          &#91;-D pkcs11_provider] &#91;-n principals] &#91;-O option]
          &#91;-V validity_interval] &#91;-z serial_number] file ...
ssh-keygen -L &#91;-f input_keyfile]
ssh-keygen -A
ssh-keygen -k -f krl_file &#91;-u] &#91;-s ca_public] &#91;-z version_number]
          file ...
ssh-keygen -Q -f krl_file file ...
</code></pre>



<p>指令範例:</p>



<pre class="wp-block-code"><code>ssh-keygen -t ed25519</code></pre>



<p>說明: 參數 [-t dsa | ecdsa | ed25519 | rsa], 有4種加密方式。</p>



<p>檢查&nbsp;<code>authorized_keys</code>&nbsp;, 確認公鑰已經在裡面：</p>



<pre class="wp-block-code"><code>cat ~/.ssh/authorized_keys</code></pre>



<p>要切換 ssh 是密碼格式, 還是用key, 修改 /etc/ssh/sshd_config 檔案。</p>



<pre class="wp-block-code"><code>sudo vim /etc/ssh/sshd_config</code></pre>



<p>把&nbsp;<code>PasswordAuthentication</code>&nbsp;的&nbsp;<code>no</code>&nbsp;改成&nbsp;<code>yes</code>。</p>



<p>/etc/ssh/sshd_config 檔案裡可以設定那些帳號才可以登入:</p>



<pre class="wp-block-code"><code>AllowUsers user1 user2</code></pre>



<p>再重啟 sshd service:</p>



<pre class="wp-block-code"><code>service sshd restart</code></pre>



<p>詳細的 ssh 操作流程, 請參考: <br>How To Configure SSH Key-Based Authentication on a Linux Server<br><a href="https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server">https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server</a></p>



<p>ssh 指令用法:</p>



<pre class="wp-block-code"><code>usage: ssh &#91;-46AaCfGgKkMNnqsTtVvXxYy] &#91;-B bind_interface]
           &#91;-b bind_address] &#91;-c cipher_spec] &#91;-D &#91;bind_address:]port]
           &#91;-E log_file] &#91;-e escape_char] &#91;-F configfile] &#91;-I pkcs11]
           &#91;-i identity_file] &#91;-J &#91;user@]host&#91;:port]] &#91;-L address]
           &#91;-l login_name] &#91;-m mac_spec] &#91;-O ctl_cmd] &#91;-o option] &#91;-p port]
           &#91;-Q query_option] &#91;-R address] &#91;-S ctl_path] &#91;-W host:port]
           &#91;-w local_tun&#91;:remote_tun]] destination &#91;command &#91;argument ...]]
</code></pre>



<p></p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">Rocky Linux</h2>



<p>這個問題，不只在Ubuntu Linux 在Rocky Linux 也會遇到：</p>



<figure class="wp-block-image size-full"><img decoding="async" width="726" height="435" src="https://stackoverflow.max-everyday.com/wp-content/uploads/2024/03/Screen-Shot-2024-03-10-at-11.07.14-AM.png?v=1710040209" alt="" class="wp-image-5472" srcset="https://stackoverflow.max-everyday.com/wp-content/uploads/2024/03/Screen-Shot-2024-03-10-at-11.07.14-AM.png?v=1710040209 726w, https://stackoverflow.max-everyday.com/wp-content/uploads/2024/03/Screen-Shot-2024-03-10-at-11.07.14-AM-600x360.png?v=1710040209 600w" sizes="(max-width: 726px) 100vw, 726px" /></figure>



<p>一樣，是少了 inet4</p>



<p>使用指令：</p>



<pre class="wp-block-code"><code>dhclient eth0</code></pre>



<p>結果：畫面會卡住。只能按Ctrl+C 中斷。</p>



<p>使用 </p>



<pre class="wp-block-code"><code>sudo ip addr add 192.168.211.17/16 dev eth0
sudo ip link set dev eth0 up</code></pre>



<p>測試結果無效&#8230;，網路回不來。</p>



<p>建議，有重要的檔案，最好設定排程，定時地備份到別台電腦，避免這個網卡掛掉，資料拿不出來。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2024/02/ubuntu-lost-eth0-inet-ipv4/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>rocky linux dnf update requires kernel-core-uname-r</title>
		<link>https://stackoverflow.max-everyday.com/2023/08/rocky-linux-dnf-update-requires-kernel-core-uname-r/</link>
					<comments>https://stackoverflow.max-everyday.com/2023/08/rocky-linux-dnf-update-requires-kernel-core-uname-r/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Fri, 25 Aug 2023 02:04:52 +0000</pubDate>
				<category><![CDATA[電腦相關應用]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rocky]]></category>
		<guid isPermaLink="false">https://stackoverflow.max-everyday.com/?p=5008</guid>

					<description><![CDATA[在 rocky linux 使用 dnf upd...]]></description>
										<content:encoded><![CDATA[
<p>在 rocky linux 使用 dnf update 時顯示錯誤訊息:</p>



<pre class="wp-block-code"><code>Error:
 Problem: package kernel-4.18.0-425.13.1.el8_7.x86_64 requires kernel-core-uname-r = 4.18.0-425.13.1.el8_7.x86_64, but none of the providers can be installed
  - conflicting requests</code></pre>



<h2 class="wp-block-heading">執行畫面</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1621" height="570" src="https://stackoverflow.max-everyday.com/wp-content/uploads/2023/08/2023-08-25-09_57_30-Window.jpg?v=1692928702" alt="" class="wp-image-5009" srcset="https://stackoverflow.max-everyday.com/wp-content/uploads/2023/08/2023-08-25-09_57_30-Window.jpg?v=1692928702 1621w, https://stackoverflow.max-everyday.com/wp-content/uploads/2023/08/2023-08-25-09_57_30-Window-600x211.jpg?v=1692928702 600w, https://stackoverflow.max-everyday.com/wp-content/uploads/2023/08/2023-08-25-09_57_30-Window-1024x360.jpg?v=1692928702 1024w, https://stackoverflow.max-everyday.com/wp-content/uploads/2023/08/2023-08-25-09_57_30-Window-768x270.jpg?v=1692928702 768w, https://stackoverflow.max-everyday.com/wp-content/uploads/2023/08/2023-08-25-09_57_30-Window-1536x540.jpg?v=1692928702 1536w" sizes="(max-width: 1621px) 100vw, 1621px" /></figure>



<h2 class="wp-block-heading">說明</h2>



<p>增加使用 <code>--refresh --nobest --skip-broken</code> 參數, 一樣錯誤. </p>



<h2 class="wp-block-heading">解法</h2>



<p>先使用指令</p>



<pre class="wp-block-code"><code>rpm -qa kernel* | sort</code></pre>



<p>列出系統目前使用的 kernal 有那些. </p>



<p>再使用指令</p>



<pre class="wp-block-code"><code>dnf remove kernel-....</code></pre>



<p>把你有問題的 kernal 從系統移除, 這時候, 再用 dnf update 就可以成功地不顯示錯誤訊息.</p>



<h2 class="wp-block-heading">執行畫面</h2>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="739" height="872" src="https://stackoverflow.max-everyday.com/wp-content/uploads/2023/08/2023-08-25-10_00_25-Window.jpg" alt="" class="wp-image-5010" srcset="https://stackoverflow.max-everyday.com/wp-content/uploads/2023/08/2023-08-25-10_00_25-Window.jpg?v=1692928980 739w, https://stackoverflow.max-everyday.com/wp-content/uploads/2023/08/2023-08-25-10_00_25-Window-508x600.jpg?v=1692928980 508w" sizes="(max-width: 739px) 100vw, 739px" /></figure>



<p></p>



<h2 class="wp-block-heading">資料來源</h2>



<p>Cannot update Fedora due to kernel error<br><a href="https://discussion.fedoraproject.org/t/cannot-update-fedora-due-to-kernel-error/78706/8?replies_to_post_number=7">https://discussion.fedoraproject.org/t/cannot-update-fedora-due-to-kernel-error/78706/8?replies_to_post_number=7</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2023/08/rocky-linux-dnf-update-requires-kernel-core-uname-r/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Install Eclipse IDE in AlmaLinux &#038; Rocky Linux 8</title>
		<link>https://stackoverflow.max-everyday.com/2023/02/install-eclipse-ide-in-almalinux-rocky-linux-8/</link>
					<comments>https://stackoverflow.max-everyday.com/2023/02/install-eclipse-ide-in-almalinux-rocky-linux-8/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Mon, 27 Feb 2023 08:04:02 +0000</pubDate>
				<category><![CDATA[電腦相關應用]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rocky]]></category>
		<guid isPermaLink="false">https://stackoverflow.max-everyday.com/?p=4443</guid>

					<description><![CDATA[到 eclipse 網站下載需要的版本，還有下載...]]></description>
										<content:encoded><![CDATA[
<p>到 eclipse 網站下載需要的版本，還有下載用的網址：<br>Download Eclipse IDE Linux<br><a href="https://www.eclipse.org/downloads/">https://www.eclipse.org/downloads/</a></p>



<p>取得下載連結後，到主機上執行 wget 指令，下載到 Downloads folder.</p>



<pre class="wp-block-code"><code>cd Downloads
wget (這裡是你的 eclipse 下載連結)
tar -xvf eclipse-jee-2022-12-R-linux-gtk-x86_64.tar.gz</code></pre>



<p>你的 eclipse 壓縮檔的檔名，可能會與我不同。</p>



<p>解開 tar.gz 檔後，就會看到 ellipse 資料夾，點2點，就有 eclipse 可以使用了。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="640" src="https://stackoverflow.max-everyday.com/wp-content/uploads/2023/02/Screen-Shot-2023-02-27-at-3.59.05-PM-2-1024x640.png?v=1677485016" alt="" class="wp-image-4450" srcset="https://stackoverflow.max-everyday.com/wp-content/uploads/2023/02/Screen-Shot-2023-02-27-at-3.59.05-PM-2-1024x640.png?v=1677485016 1024w, https://stackoverflow.max-everyday.com/wp-content/uploads/2023/02/Screen-Shot-2023-02-27-at-3.59.05-PM-2-600x375.png?v=1677485016 600w, https://stackoverflow.max-everyday.com/wp-content/uploads/2023/02/Screen-Shot-2023-02-27-at-3.59.05-PM-2-768x480.png?v=1677485016 768w, https://stackoverflow.max-everyday.com/wp-content/uploads/2023/02/Screen-Shot-2023-02-27-at-3.59.05-PM-2-1536x960.png?v=1677485016 1536w, https://stackoverflow.max-everyday.com/wp-content/uploads/2023/02/Screen-Shot-2023-02-27-at-3.59.05-PM-2.png?v=1677485016 1680w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2023/02/install-eclipse-ide-in-almalinux-rocky-linux-8/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Install Python 3.9 on Rocky Linux 8</title>
		<link>https://stackoverflow.max-everyday.com/2023/02/how-to-install-python-3-9-on-rocky-linux-8/</link>
					<comments>https://stackoverflow.max-everyday.com/2023/02/how-to-install-python-3-9-on-rocky-linux-8/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Mon, 27 Feb 2023 06:32:29 +0000</pubDate>
				<category><![CDATA[Python筆記]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[rocky]]></category>
		<guid isPermaLink="false">https://stackoverflow.max-everyday.com/?p=4424</guid>

					<description><![CDATA[我的 Rocky Linux 8裡的 pytho...]]></description>
										<content:encoded><![CDATA[
<p>我的 Rocky Linux 8裡的 python 是  3.6.8 用起來有些物件沒辦法使用，需要upgrade to new version.</p>



<p>先用 <code>sudo dnf list</code> 或用指令：<code>sudo dnf search python</code> 可以看到，預設最多只有到 python3.9, 要升到 3.10 或 3.11 就要下比較多指令</p>



<p>先使用 </p>



<pre class="wp-block-code"><code>sudo dnf install python39</code></pre>



<p>或</p>



<pre class="wp-block-code"><code>sudo yum install python39</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="647" height="411" src="https://stackoverflow.max-everyday.com/wp-content/uploads/2023/02/Screen-Shot-2023-02-27-at-2.20.58-PM.png" alt="" class="wp-image-4427" srcset="https://stackoverflow.max-everyday.com/wp-content/uploads/2023/02/Screen-Shot-2023-02-27-at-2.20.58-PM.png?v=1677479323 647w, https://stackoverflow.max-everyday.com/wp-content/uploads/2023/02/Screen-Shot-2023-02-27-at-2.20.58-PM-600x381.png?v=1677479323 600w" sizes="(max-width: 647px) 100vw, 647px" /></figure>



<p>按下Y 之後，應該會取到目前 python 3.9 的最後一版 3.9.13</p>



<pre class="wp-block-preformatted">Installed:
  python39-3.9.13-2.module+el8.7.0+1092+55aa9635.x86_64                         
  python39-libs-3.9.13-2.module+el8.7.0+1092+55aa9635.x86_64                    
  python39-pip-20.2.4-7.module+el8.7.0+1064+ad564229.noarch                     
  python39-pip-wheel-20.2.4-7.module+el8.7.0+1064+ad564229.noarch               
  python39-setuptools-50.3.2-4.module+el8.5.0+673+10283621.noarch               
  python39-setuptools-wheel-50.3.2-4.module+el8.5.0+673+10283621.noarch         

Complete!</pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="653" height="417" src="https://stackoverflow.max-everyday.com/wp-content/uploads/2023/02/Screen-Shot-2023-02-27-at-2.31.21-PM.png" alt="" class="wp-image-4429" srcset="https://stackoverflow.max-everyday.com/wp-content/uploads/2023/02/Screen-Shot-2023-02-27-at-2.31.21-PM.png?v=1677479538 653w, https://stackoverflow.max-everyday.com/wp-content/uploads/2023/02/Screen-Shot-2023-02-27-at-2.31.21-PM-600x383.png?v=1677479538 600w" sizes="(max-width: 653px) 100vw, 653px" /></figure>



<p></p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>使用下面的指令來升級：</p>



<pre class="wp-block-code"><code>sudo dnf update -y
sudo dnf install curl gcc openssl-devel bzip2-devel libffi-devel zlib-devel wget make -y
wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz
tar -xf Python-3.10.0.tar.xz
cd Python-3.10.0
./configure --enable-optimizations
make -j 2
nproc
make altinstall</code></pre>



<p>在這個資料夾下指令：</p>



<pre class="wp-block-code"><code>python3.10 --version</code></pre>



<p>應就會會看到：</p>



<pre class="wp-block-preformatted">Python 3.10.0</pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>雖然升級上去了，但還是遇到很多問題，像是 tkinter, 還要另外針對 python3.9 做安裝。@_@；</p>



<p>Fedora 的Linux平台使用查詢指令</p>



<pre class="wp-block-code"><code>sudo dnf list python3*</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="723" height="471" src="https://stackoverflow.max-everyday.com/wp-content/uploads/2024/03/MobaXterm_Personal_23.2_2024-03-19-08-44-d2.png?v=1710809239" alt="" class="wp-image-5582" srcset="https://stackoverflow.max-everyday.com/wp-content/uploads/2024/03/MobaXterm_Personal_23.2_2024-03-19-08-44-d2.png?v=1710809239 723w, https://stackoverflow.max-everyday.com/wp-content/uploads/2024/03/MobaXterm_Personal_23.2_2024-03-19-08-44-d2-600x391.png?v=1710809239 600w" sizes="(max-width: 723px) 100vw, 723px" /></figure>



<p>可以看到每一個python版本都有自帶的 tkinter 套件, 如果想安裝 python 3.8 版的 tkinter, 請下指令:</p>



<pre class="wp-block-code"><code>sudo dnf install python38-tkinter</code></pre>



<p>想安裝 python 3.8 版的 tkinter</p>



<pre class="wp-block-code"><code>sudo dnf install python39-tkinter</code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>如果是 ubuntu 平台安裝 tkinter:</p>



<pre class="wp-block-code"><code>sudo apt install python3-tk</code></pre>



<p>On CentOS, RedHat, and Oracle Linux systems:</p>



<pre class="wp-block-code"><code>sudo yum install -y tkinter tk-devel</code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">多個python3 版本, 使用 python3 指令時, 要使用那一個版本?</h2>



<p>請使用指令來指派預設的 python3 版本,</p>



<p>Debian / Ubuntu:</p>



<pre class="wp-block-code"><code>sudo update-alternatives --config python3</code></pre>



<p>CentOS / Rocky:</p>



<pre class="wp-block-code"><code>sudo alternatives --config python3</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="603" height="195" src="https://stackoverflow.max-everyday.com/wp-content/uploads/2024/03/MobaXterm_Personal_23.2_2024-03-19-09-54-f.png?v=1710813385" alt="" class="wp-image-5586" srcset="https://stackoverflow.max-everyday.com/wp-content/uploads/2024/03/MobaXterm_Personal_23.2_2024-03-19-09-54-f.png?v=1710813385 603w, https://stackoverflow.max-everyday.com/wp-content/uploads/2024/03/MobaXterm_Personal_23.2_2024-03-19-09-54-f-600x194.png?v=1710813385 600w" sizes="(max-width: 603px) 100vw, 603px" /></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2023/02/how-to-install-python-3-9-on-rocky-linux-8/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to install Chrome browser on Rocky Linux or AlmaLinux</title>
		<link>https://stackoverflow.max-everyday.com/2023/02/how-to-install-chrome-browser-on-rocky-linux-or-almalinux/</link>
					<comments>https://stackoverflow.max-everyday.com/2023/02/how-to-install-chrome-browser-on-rocky-linux-or-almalinux/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Mon, 27 Feb 2023 06:10:03 +0000</pubDate>
				<category><![CDATA[電腦相關應用]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rocky]]></category>
		<guid isPermaLink="false">https://stackoverflow.max-everyday.com/?p=4421</guid>

					<description><![CDATA[Download GPG key: 輸出的訊息：...]]></description>
										<content:encoded><![CDATA[
<p></p>



<p>Download GPG key:</p>



<pre class="wp-block-code"><code>sudo dnf install wget -y</code></pre>



<p>輸出的訊息：</p>



<pre class="wp-block-preformatted">$ sudo dnf install wget -y
[sudo] password for max: 
Sorry, try again.
[sudo] password for max: 
Rocky Linux 8 - AppStream                       5.3 kB/s | 4.8 kB     00:00    
Rocky Linux 8 - BaseOS                          7.7 kB/s | 4.3 kB     00:00    
Rocky Linux 8 - Extras                          4.8 kB/s | 3.1 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64  8.0 kB/s | 8.7 kB     00:01    
Extra Packages for Enterprise Linux 8 - x86_64  1.7 MB/s |  14 MB     00:08    
Package wget-1.19.5-10.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
</pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<pre class="wp-block-code"><code>wget https://dl.google.com/linux/linux_signing_key.pub</code></pre>



<p>輸出訊息：</p>



<pre class="wp-block-preformatted">$ wget https://dl.google.com/linux/linux_signing_key.pub
--2023-02-27 13:58:36--  https://dl.google.com/linux/linux_signing_key.pub
Resolving dl.google.com (dl.google.com)... 172.217.163.46, 2404:6800:4012:4::200e
Connecting to dl.google.com (dl.google.com)|172.217.163.46|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14613 (14K) [application/octet-stream]
Saving to: 'linux_signing_key.pub'

linux_signing_key.p 100%[===================>]  14.27K  --.-KB/s    in 0s      

2023-02-27 13:58:37 (66.5 MB/s) - 'linux_signing_key.pub' saved [14613/14613]
</pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<pre class="wp-block-code"><code>sudo rpm --import linux_signing_key.pub
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
</code></pre>



<p>輸出訊息：</p>



<pre class="wp-block-preformatted">--2023-02-27 14:01:34--  https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
Resolving dl.google.com (dl.google.com)... 172.217.163.46, 2404:6800:4012:4::200e
Connecting to dl.google.com (dl.google.com)|172.217.163.46|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 100101712 (95M) [application/x-rpm]
Saving to: 'google-chrome-stable_current_x86_64.rpm'

google-chrome-stabl 100%[===================>]  95.46M   120MB/s    in 0.8s    

2023-02-27 14:01:35 (120 MB/s) - 'google-chrome-stable_current_x86_64.rpm' saved [100101712/100101712]</pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<pre class="wp-block-code"><code>sudo dnf install google-chrome-stable_current_x86_64.rpm</code></pre>



<p>輸出訊息：</p>



<pre class="wp-block-preformatted">Last metadata expiration check: 0:09:44 ago on Mon 27 Feb 2023 01:52:57 PM CST.
Dependencies resolved.
================================================================================
 Package                   Arch      Version              Repository       Size
================================================================================
Installing:
 google-chrome-stable      x86_64    110.0.5481.177-1     @commandline     95 M
Installing dependencies:
 liberation-fonts          noarch    1:2.00.3-7.el8       baseos           19 k
 liberation-sans-fonts     noarch    1:2.00.3-7.el8       baseos          609 k
 liberation-serif-fonts    noarch    1:2.00.3-7.el8       baseos          608 k
 mesa-vulkan-drivers       x86_64    22.1.5-2.el8         appstream       5.9 M
 vulkan-loader             x86_64    1.3.224.0-2.el8      appstream       138 k

Transaction Summary
================================================================================
Install  6 Packages

Total size: 103 M
Total download size: 7.3 M
Installed size: 329 M
Is this ok [y/N]:</pre>



<p>這時候，要輸入 Y</p>



<p>然後就安裝好了～</p>



<pre class="wp-block-preformatted">Installed:
  google-chrome-stable-110.0.5481.177-1.x86_64                                  
  liberation-fonts-1:2.00.3-7.el8.noarch                                        
  liberation-sans-fonts-1:2.00.3-7.el8.noarch                                   
  liberation-serif-fonts-1:2.00.3-7.el8.noarch                                  
  mesa-vulkan-drivers-22.1.5-2.el8.x86_64                                       
  vulkan-loader-1.3.224.0-2.el8.x86_64                                          

Complete!</pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>檢查 repo 有無進系統環境中</p>



<pre class="wp-block-code"><code>sudo dnf repolist</code></pre>



<p>執行結果：</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="652" height="144" src="https://stackoverflow.max-everyday.com/wp-content/uploads/2023/02/Screen-Shot-2023-02-27-at-2.06.14-PM.png" alt="" class="wp-image-4422" srcset="https://stackoverflow.max-everyday.com/wp-content/uploads/2023/02/Screen-Shot-2023-02-27-at-2.06.14-PM.png?v=1677478155 652w, https://stackoverflow.max-everyday.com/wp-content/uploads/2023/02/Screen-Shot-2023-02-27-at-2.06.14-PM-600x133.png?v=1677478155 600w" sizes="(max-width: 652px) 100vw, 652px" /></figure>



<p>可以看到 google-chrome 就是正確了。</p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2023/02/how-to-install-chrome-browser-on-rocky-linux-or-almalinux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
