linux | No pain,No gain. https://ufirst.jp/memo Mon, 29 Jan 2024 03:42:40 +0000 ja hourly 1 https://wordpress.org/?v=6.9.4 https://i0.wp.com/ufirst.jp/memo/wp-content/uploads/2022/08/apple-touch-icon-76x76-precomposed.png?fit=32%2C32&ssl=1 linux | No pain,No gain. https://ufirst.jp/memo 32 32 126496119 Docker Desktop WindowsのVMをDドライブへ移動する https://ufirst.jp/memo/2024/01/docker-desktop-windows%e3%81%aevm%e3%82%92d%e3%83%89%e3%83%a9%e3%82%a4%e3%83%96%e3%81%b8%e7%a7%bb%e5%8b%95%e3%81%99%e3%82%8b/ https://ufirst.jp/memo/2024/01/docker-desktop-windows%e3%81%aevm%e3%82%92d%e3%83%89%e3%83%a9%e3%82%a4%e3%83%96%e3%81%b8%e7%a7%bb%e5%8b%95%e3%81%99%e3%82%8b/#respond Mon, 29 Jan 2024 03:42:39 +0000 https://ufirst.jp/memo/?p=3867 Docker DesktopをWindowsへインストールすると通常 CドライブへVM用ファイルが保存されどんどんディスクを食いつぶしていく。DockerのデータをDドライブへ移行する手順をメモ

D:\docker\wsl にDockerのイメージをコピーするため事前にD:\docker\wsl ディレクトリを作成しておく

wsl --export docker-desktop-data  docker-desktop-data.tar
wsl --unregister docker-desktop-data

wsl --import docker-desktop-data D:\docker\wsl .\docker-desktop-data.tar

]]>
https://ufirst.jp/memo/2024/01/docker-desktop-windows%e3%81%aevm%e3%82%92d%e3%83%89%e3%83%a9%e3%82%a4%e3%83%96%e3%81%b8%e7%a7%bb%e5%8b%95%e3%81%99%e3%82%8b/feed/ 0 3867
WSLでエラー(0x80370102) https://ufirst.jp/memo/2024/01/wsl%e3%81%a7%e3%82%a8%e3%83%a9%e3%83%bc0x80370102/ https://ufirst.jp/memo/2024/01/wsl%e3%81%a7%e3%82%a8%e3%83%a9%e3%83%bc0x80370102/#respond Mon, 29 Jan 2024 01:54:06 +0000 https://ufirst.jp/memo/?p=3860 WSLをインストールしWindows StoreからUbuntuをインストールし起動したところ、次のエラー

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80370102
Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.
For information please visit https://aka.ms/enablevirtualization

解決策

Windowsボタン+Rで以下のウィンドウを開き、
「OptionalFeatures.exe」と入力

Windowsの機能の有効化または無効化 ウィンドウで表示される下から2番めの「仮想マシンプラットフォーム」にチェクを入れる

再起動後にUbuntuを起動

正常に起動確認

]]>
https://ufirst.jp/memo/2024/01/wsl%e3%81%a7%e3%82%a8%e3%83%a9%e3%83%bc0x80370102/feed/ 0 3860
Rocky Linux8 VirtualBox – Guest Additions インストール手順 https://ufirst.jp/memo/2023/02/rocky-linux8-virtualbox-guest-additions-%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e6%89%8b%e9%a0%86/ https://ufirst.jp/memo/2023/02/rocky-linux8-virtualbox-guest-additions-%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e6%89%8b%e9%a0%86/#respond Sat, 04 Feb 2023 01:02:36 +0000 https://ufirst.jp/memo/?p=3753 Rocky Linux8をVirtualBoxで利用したく共有フォルダを利用するため「VirtualBox – Guest Additions」をインストールしたので手順をメモ。

# cat /etc/redhat-release
Rocky Linux release 8.7 (Green Obsidian)
dnf update -y kernel*
dnf update

reboot
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
mount /dev/sr0 /mnt
/mnt/VBoxLinuxAdditions.run
]]>
https://ufirst.jp/memo/2023/02/rocky-linux8-virtualbox-guest-additions-%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e6%89%8b%e9%a0%86/feed/ 0 3753
Rocky Linux8 Dockerコンテナの日本語化 https://ufirst.jp/memo/2023/01/rocky-linux8-docker%e3%82%b3%e3%83%b3%e3%83%86%e3%83%8a%e3%81%ae%e6%97%a5%e6%9c%ac%e8%aa%9e%e5%8c%96/ https://ufirst.jp/memo/2023/01/rocky-linux8-docker%e3%82%b3%e3%83%b3%e3%83%86%e3%83%8a%e3%81%ae%e6%97%a5%e6%9c%ac%e8%aa%9e%e5%8c%96/#respond Wed, 18 Jan 2023 14:57:28 +0000 https://ufirst.jp/memo/?p=3736 Rocky LinuxのDocker Officel Imageでコンテナを起動したあと次のことを実行し日本語化する

# cat /etc/redhat-release 
Rocky Linux release 8.7 (Green Obsidian)

日本語パッケージのインストール

 # dnf -y install langpacks-ja glibc-langpack-ja.x86_64

文字コードの変更

# localectl set-locale LANG=ja_JP.utf8
# source /etc/locale.conf

タイムゾーンを日本に変更

# timedatectl set-timezone Asia/Tokyo
]]>
https://ufirst.jp/memo/2023/01/rocky-linux8-docker%e3%82%b3%e3%83%b3%e3%83%86%e3%83%8a%e3%81%ae%e6%97%a5%e6%9c%ac%e8%aa%9e%e5%8c%96/feed/ 0 3736
Docker上のCentOSで文字化けが発生する https://ufirst.jp/memo/2023/01/docker%e4%b8%8a%e3%81%aecentos%e3%81%a7%e6%96%87%e5%ad%97%e5%8c%96%e3%81%91%e3%81%8c%e7%99%ba%e7%94%9f%e3%81%99%e3%82%8b/ https://ufirst.jp/memo/2023/01/docker%e4%b8%8a%e3%81%aecentos%e3%81%a7%e6%96%87%e5%ad%97%e5%8c%96%e3%81%91%e3%81%8c%e7%99%ba%e7%94%9f%e3%81%99%e3%82%8b/#respond Tue, 17 Jan 2023 10:45:38 +0000 https://ufirst.jp/memo/?p=3730 原因の説明は省略。以下のコマンドを実行することで解消する。

localedef -f UTF-8 -i ja_JP ja_JP.UTF-8
export LANG="ja_JP.UTF-8"
export LANGUAGE="ja_JP:ja"
]]>
https://ufirst.jp/memo/2023/01/docker%e4%b8%8a%e3%81%aecentos%e3%81%a7%e6%96%87%e5%ad%97%e5%8c%96%e3%81%91%e3%81%8c%e7%99%ba%e7%94%9f%e3%81%99%e3%82%8b/feed/ 0 3730
Rocky Linux8 へ PostGISをインストールする https://ufirst.jp/memo/2022/09/rockeylinux8-%e3%81%b8-postgis%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b/ https://ufirst.jp/memo/2022/09/rockeylinux8-%e3%81%b8-postgis%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b/#respond Thu, 08 Sep 2022 22:53:08 +0000 https://ufirst.jp/memo/?p=3658 PowerTools リポジトリを有効にする必要があります。

dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

dnf -y config-manager --set-enabled powertools
# dnf install  postgis33_14
]]>
https://ufirst.jp/memo/2022/09/rockeylinux8-%e3%81%b8-postgis%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b/feed/ 0 3658
RockyLinux8にLet’s Encrypの無料SSL証明書をインストールする手順 https://ufirst.jp/memo/2022/09/rockylinux8%e3%81%ablets-encryp%e3%81%ae%e7%84%a1%e6%96%99ssl%e8%a8%bc%e6%98%8e%e6%9b%b8%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%89%8b%e9%a0%86/ https://ufirst.jp/memo/2022/09/rockylinux8%e3%81%ablets-encryp%e3%81%ae%e7%84%a1%e6%96%99ssl%e8%a8%bc%e6%98%8e%e6%9b%b8%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%89%8b%e9%a0%86/#respond Thu, 08 Sep 2022 15:37:32 +0000 https://ufirst.jp/memo/?p=3661 Let’s EncrypのSSL証明書をインストールするためにはcertbotというパッケージが必要になります。
certbotはyumやdnfコマンドではインストールできない(厳密には古いバージョンが配布されている)ためsnapというパッケージ管理を使います。

snapdのインストール
# dnf install snapd
snapdの有効化
# systemctl enable --now snapd.socket
snapのシンボリックリンクを作成
# ln -s /var/lib/snapd/snap /snap
coreをインストール
# snap install core

ここまででsnapが使えるようになっているはずです。certbotをインストールします。

snap install --classic certbot

certbotのシンボリックリンクを作成しコマンドがすぐに使えるようにします。

sudo ln -s /snap/bin/certbot /usr/bin/certbot

certbotが使えるか確認します。

certbot --version

バージョンが表示されれば問題ありません。 次のコマンドでSSL証明書の取得からApacheの設定ファイル変更まで一括して行います。

sudo certbot --apache

以上で完了ですが、もしサイトが表示されない場合はFirewallの可能性があります。
次を実行して443ポートをアクセス許可します。

firewall-cmd --add-port=443/tcp --zone=public --permanent
firewall-cmd --reload
]]>
https://ufirst.jp/memo/2022/09/rockylinux8%e3%81%ablets-encryp%e3%81%ae%e7%84%a1%e6%96%99ssl%e8%a8%bc%e6%98%8e%e6%9b%b8%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%89%8b%e9%a0%86/feed/ 0 3661
RockyLinux8で「エラー: 修正用の一致する repo はありません: PowerTools.」エラーが発生 https://ufirst.jp/memo/2022/09/rockylinux8%e3%81%a7%e3%80%8c%e3%82%a8%e3%83%a9%e3%83%bc-%e4%bf%ae%e6%ad%a3%e7%94%a8%e3%81%ae%e4%b8%80%e8%87%b4%e3%81%99%e3%82%8b-repo-%e3%81%af%e3%81%82%e3%82%8a%e3%81%be%e3%81%9b%e3%82%93-powertoo/ https://ufirst.jp/memo/2022/09/rockylinux8%e3%81%a7%e3%80%8c%e3%82%a8%e3%83%a9%e3%83%bc-%e4%bf%ae%e6%ad%a3%e7%94%a8%e3%81%ae%e4%b8%80%e8%87%b4%e3%81%99%e3%82%8b-repo-%e3%81%af%e3%81%82%e3%82%8a%e3%81%be%e3%81%9b%e3%82%93-powertoo/#respond Thu, 08 Sep 2022 13:57:02 +0000 https://ufirst.jp/memo/?p=3659 # dnf -y config-manager --set-enabled PowerTools エラー: 修正用の一致する repo はありません: PowerTools.

PowerToolsの名前が変更になった模様「powertools」とする事で実行可能

# dnf  config-manager --set-enabled powertools
]]>
https://ufirst.jp/memo/2022/09/rockylinux8%e3%81%a7%e3%80%8c%e3%82%a8%e3%83%a9%e3%83%bc-%e4%bf%ae%e6%ad%a3%e7%94%a8%e3%81%ae%e4%b8%80%e8%87%b4%e3%81%99%e3%82%8b-repo-%e3%81%af%e3%81%82%e3%82%8a%e3%81%be%e3%81%9b%e3%82%93-powertoo/feed/ 0 3659
Rocky Linux8へPostgreSQL14をインストールする https://ufirst.jp/memo/2022/09/rockeylinux8%e3%81%b8postgresql14%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b/ https://ufirst.jp/memo/2022/09/rockeylinux8%e3%81%b8postgresql14%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b/#respond Thu, 08 Sep 2022 13:35:02 +0000 https://ufirst.jp/memo/?p=3654 当記事の環境

cat /etc/redhat-release 
Rocky Linux release 8.6 (Green Obsidian)

AppStreamを確認します

# dnf module list postgresql
メタデータの期限切れの最終確認: 3:15:34 時間前の 2022年09月08日 19時10分46秒 に実施しました。
Rocky Linux 8 - AppStream
Name                                         Stream                                   Profiles                                            Summary                                                             
postgresql                                   9.6                                      client, server [d]                                  PostgreSQL server and client module                                 
postgresql                                   10 [d]                                   client, server [d]                                  PostgreSQL server and client module                                 
postgresql                                   12                                       client, server [d]                                  PostgreSQL server and client module                                 
postgresql                                   13                                       client, server [d]                                  PostgreSQL server and client module                                 

Extra Packages for Enterprise Linux Modular 8 - x86_64
Name                                         Stream                                   Profiles                                            Summary                                                             
postgresql                                   11                                       client, server                                      PostgreSQL module                                                   

PostgreSQL13まではインストール可能なようですが、14がありません。

公式サイトのインストール方法をチェックします

PostgreSQL: Linux downloads (Red Hat family)

インストールする環境を選択するとインストールコマンドが表示される、親切設計なサイトです。

version 14 , platform Rockey version8 , architecture x86_64 と選択すると次のコマンドが表示されますので、順番に実行します。

# Install the repository RPM:
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

# Disable the built-in PostgreSQL module:
sudo dnf -qy module disable postgresql

# Install PostgreSQL:
sudo dnf install -y postgresql14-server

# Optionally initialize the database and enable automatic start:
sudo /usr/pgsql-14/bin/postgresql-14-setup initdb
sudo systemctl enable postgresql-14
sudo systemctl start postgresql-14
]]>
https://ufirst.jp/memo/2022/09/rockeylinux8%e3%81%b8postgresql14%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b/feed/ 0 3654
Rocky Linux8 で SeLinuxを無効にする https://ufirst.jp/memo/2022/09/rockeylinux8-%e3%81%a7-selinux%e3%82%92%e7%84%a1%e5%8a%b9%e3%81%ab%e3%81%99%e3%82%8b/ https://ufirst.jp/memo/2022/09/rockeylinux8-%e3%81%a7-selinux%e3%82%92%e7%84%a1%e5%8a%b9%e3%81%ab%e3%81%99%e3%82%8b/#respond Thu, 08 Sep 2022 13:20:43 +0000 https://ufirst.jp/memo/?p=3652 CentOS7などと同じやり方で無効化出来ます。

SELinuxの状態確認

# getenforce
Disabled
/etc/selinux/config

#SELINUX=enforcing
SELINUX=disabled
]]>
https://ufirst.jp/memo/2022/09/rockeylinux8-%e3%81%a7-selinux%e3%82%92%e7%84%a1%e5%8a%b9%e3%81%ab%e3%81%99%e3%82%8b/feed/ 0 3652