0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Rocky Linux10 への移行作業めも

Last updated at Posted at 2025-07-20

Rocky Linux10 への移行作業めも

インストール準備

インストールメディア作成

まずは、インストールメディアの作成から
公式からx86_64のDVDなISOファイルをGETし、
USBメモリーに入れる。

# 指したメディアがなんなのか?確認
dmesg
(抜く)
dmesg
今回の場合、sdd1と特定。

もっと見やすく
lsblk -f


# 公式の通り、NOT "sdd1" but "sdd"(メディア全体)をof(output file?)に指定する。
dd if=Rocky-10.0-x86_64-boot.iso of=/dev/sdd

起動成功。

PCセッティング準備

Windowsと同等を目指す。

日本語インストール

設定 → Keyboard → 入力ソース →「+」押下 → 日本語(Anthy)選択
キーボードショートカット → タイピング → 次の入力ソースへ切り替える → 半角ボタン
iBus-Anthyの設定 → 入力タイプ → キーボードレイアウト:jp

デュアルディスプレイ設定

設定→デバイス→Displays
ディスプレイモードをJoin Displays選択
→ 勝手にデュアルディスプレイに設定される模様

省電力設定Off

設定 → 電源 → 省電力 → ブランクスクリーン → 「しない」に変更
※お好みで
→ Power Modeなる概念に変わった模様

キーボードショートカット設定

設定→デバイス→Keyboard

# <Ctrl> + <Alt> + t で端末(Terminal起動)
# ※Gnome-terminal から Ptyxis なるものに変わったらしい
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ name "Ptyxis"
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ command "ptyxis"
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ binding "<Primary><Alt>t"
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/']"

# ランチャー (ホームフォルダー → Super+E)
gsettings set org.gnome.settings-daemon.plugins.media-keys home "['<Super>e']"

# ナビゲーション (すべての通常のウィンドウを隠す → Super+D)
gsettings set org.gnome.desktop.wm.keybindings show-desktop "['<Super>d']"

クリックパッドの右クリックを有効に (ノートPC用)

gsettings set org.gnome.desktop.peripherals.touchpad click-method areas

日本語表記ディレクトリを英語表記に変更

#sudo apt install xdg-user-dirs-gtk
LANG=C xdg-user-dirs-gtk-update
nautilus -q

# Super+E などでNautilus起動

rootなしでインストールする

rootなしでインストールする。

nautilus設定変更

とりあえず、Windowsっぽくする。

# Use list view by default
gsettings set org.gnome.nautilus.preferences default-folder-viewer "list-view"

# Sort files by type
gsettings set org.gnome.nautilus.preferences default-sort-order "type"

# 種類の表示
gsettings set org.gnome.nautilus.list-view default-visible-columns "['name', 'type', 'size', 'date_modified', 'starred']"

# 日付表示
gsettings set org.gnome.desktop.interface clock-show-date true

# 参考
#https://github.com/GNOME/nautilus/blob/master/data/org.gnome.nautilus.gschema.xml
#yum install dconf-editor

# 設定値確認
gsettings list-recursively

yumリポジトリの国内Mirror指定

# 国内Mirror指定
cd /etc/yum.repos.d/
---
# vi rocky-devel.repo
baseurl=https://ftp.riken.jp/$contentdir/$releasever/devel/$basearch/os/

# vi rocky.repo
baseurl=https://ftp.riken.jp/$contentdir/$releasever/extras/$basearch/os/
---

# 更新
sudo yum clean all && yum check-update

Desktop Entry の登録

cd /usr/share/applications

sudo vi xxx.desktop
--- (既存のを参考にコピーなどする)
[Desktop Entry]
Name=xxx
StartupWMClass=xxx
Comment=xxx Desktop
GenericName=xxx for Linux
Exec=/zzz/xxx.sh
Icon=/usr/share/pixmaps/xxx.png
Type=Application
StartupNotify=true
Keywords=filesystem
Terminal=false
---

# バリデートチェック
desktop-file-validate xxx.desktop 

Windowsのスタートアップっぽいの

cd /usr/share/applications
# 以下のように自動起動したい任意のdesktopファイルをコピー
sudo cp -p google-chrome.desktop /etc/xdg/autostart

WindowsでZip圧縮されたファイルの解凍

文字化け対策
unzip -O cp932 XXX.zip
# alias unzipSjis='unzip -O cp932' とか

アプリインストール


Slackデスクトップアプリ

公式rpmでインストール可能

# nothing provides libappindicator-gtk3 needed by slack~
が出る為、また、nothing provides libdbusmenu-glib.so.4()(64bit) needed by~ もでる為、調査中
sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm
sudo yum install libappindicator-gtk3
※ダメ

# インストール
https://slack.com/intl/ja-jp/downloads/linux からrpmファイルをDL
sudo yum install ./slack-4.45.69-0.1.el8.x86_64.rpm

thunderbird

簡単に入る癒し系。

ソフトウェアで普通に thunderbird を検索インストール

# メール入力時設定
# 編集 -> 設定 -> 「編集」リボン -> 一般 -> 
#「既定で本文テキストの代わりに段落書式を使用する」のチェックを外す

# バックアップ&リストア
# ・バックアップ
# /home/{user}/.thunderbird 内部のディレクトリをzip圧縮して退避
# ・リストア
# 1. /home/{user}/.thunderbird へ退避zipを解凍
# 2. profiles.ini の Path= を全て1で解凍したディレクトリ名に変更

VLC

音楽・動画再生用。公式手順
インストールするとブラウザ上でも動画系が大体見れるようになる。

# インストール
$> su -
#> yum localinstall https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm
#> yum localinstall https://download1.rpmfusion.org/free/el/rpmfusion-free-release-10.noarch.rpm
#> yum install vlc
#> #不要 yum install vlc-core (for minimal headless/server install)
#> #不要 yum install python-vlc (optionals)

# 確認。
dnf repolist enabled

## midi再生は
(リボン)ツール > 再生 > (設定の表示)すべて > 入力/コーデック
> オーディオコーデック > FluidSynth
でサウンドフォントファイルをどっかから、フリーのやつを落として指定する。
http://awm.jp/~yoya/js/sf2.js/sample/emuaps_8mb.sf2
とか

## libdvdcss
市販DVDはこれ入れないと見れないらしい
sudo yum install rpmfusion-free-release-tainted
sudo yum install libdvdcss

Brasero

CDやDVDの作成やコピーができます
「ソフトウェア」でインストールする。

ffmpegインストール

#要epel + rpmfusion
sudo dnf install epel-release
#sudo dnf config-manager --set-enabled crb
sudo yum install ffmpeg ffmpeg-devel

# 確認
ffmpeg -version
Compile FFmpeg on CentOS
@see https://qiita.com/wankoromaru/items/e1953f692102c08ea34a
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
mkdir ~/ffmpeg_sources

### Yasm
cd ~/ffmpeg_sources
git clone --depth 1 git://github.com/yasm/yasm.git
cd yasm
autoreconf -fiv
./configure --prefix="/usr/local/ffmpeg_build" --bindir="/usr/local/bin"
make && make install && make distclean

### libx264
cd /usr/local/src/ffmpeg_sources
git clone --branch stable --depth 1 https://code.videolan.org/videolan/x264.git
cd x264
./configure --prefix="/usr/local/ffmpeg_build" --bindir="/usr/local/bin" --enable-static
make && make install && make distclean

### libfdk_aac
cd /usr/local/src/ffmpeg_sources
git clone --depth 1 git://git.code.sf.net/p/opencore-amr/fdk-aac
cd fdk-aac
autoreconf -fiv
./configure --prefix="/usr/local/ffmpeg_build" --disable-shared
make && make install && make distclean

### libmp3lame
cd /usr/local/src/ffmpeg_sources
curl -O -L https://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz
tar xzvf lame-3.100.tar.gz
cd lame-3.100
./configure --prefix="/usr/local/ffmpeg_build" \
            --bindir="/usr/local/bin" \
            --disable-shared --enable-nasm
make && make install && make distclean

### libvpx
cd /usr/local/src/ffmpeg_sources
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
cd libvpx
./configure --prefix="/usr/local/ffmpeg_build" --disable-examples
make && make install && make clean

### FFmpeg
cd /usr/local/src/ffmpeg_sources
git clone --depth 1 git://source.ffmpeg.org/ffmpeg
cd ffmpeg
PKG_CONFIG_PATH="/usr/local/ffmpeg_build/lib/pkgconfig" \
       ./configure --prefix="/usr/local/ffmpeg_build" \
       --extra-cflags="-I/usr/local/ffmpeg_build/include" \
       --extra-ldflags="-L/usr/local/ffmpeg_build/lib" \
       --bindir="/usr/local/bin" \
       --enable-gpl \
       --enable-nonfree \
       --enable-libfdk_aac \
       --enable-libmp3lame \
       --enable-libvpx \
       --enable-libx264
make && make install && make distclean
hash -r

## 確認
ffmpeg -L

外付けHDDなどを認識

NTFS形式でフォーマットしてしまったドライブを認識できるようにする。
SDカードのNTFSフォーマットとか。

# repo(EPEL)があること前提
yum install dkms fuse-ntfs-3g ntfsprogs

ClamAV

sudo yum install -y clamav clamav-update clamd.x86_64
sudo sed -e 's/^Example/#Example/g' \
       -e 's/^User.*/User root/g' \
       -e 's/^#LocalSocket /LocalSocket /g' \
       -e 's/^#LocalSocketGroup.*/LocalSocketGroup clamscan/g' \
       -e 's/^#LocalSocketMode /LocalSocketMode /g' \
       -e 's/^#FixStaleSocket /FixStaleSocket /g' \
       -e 's/^#ExcludePath /ExcludePath /g' \
       -i /etc/clamd.d/scan.conf

# 動作確認
sudo freshclam
#wget http://www.eicar.org/download/eicar.com はできなくなってた
echo 'X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*' > eicar.com
clamscan -r -i .

# cron daemonさんの状態確認
systemctl status crond.service

# crond設定
sudo crontab -u root -e
--- 1:00 に実行
0 1 * * * /work/clamscan_ntfy.sh
---
とか

### ウイルスデータベース更新
sudo freshclam

# cron daemon再起動
systemctl restart crond.service

# ntfyでslack連系
curl -kL https://bootstrap.pypa.io/get-pip.py | python
pip -V
sudo pip install ntfy[slack]
echo 'eval "$(ntfy shell-integration)"' >> ~/.bashrc
source ~/.bashrc

設定ファイル追加(~/.ntfy.yml)
---
backends:
  - slack
slack:
  token: <<<slacktoken>>>
  recipient: "#general"

--- # clamscan_ntfy.sh
#!/bin/bash

# 隔離ディレクトリ
QUARANTINE_DIR="/var/quarantine"

# 隔離ディレクトリが存在しない場合は作成
if [ ! -d "$QUARANTINE_DIR" ]; then
  mkdir -p "$QUARANTINE_DIR"
fi

# ウイルスデータベース更新
freshclam

su <<<user>>> -c "~/.local/bin/ntfy send \"ウイルス検査開始します。\""

# clamscanの実行
# -r: 再帰的にスキャン
# -i: 感染ファイルのみ表示
# --move: 感染ファイルを隔離ディレクトリに移動
#clamscan -r -i --move="$QUARANTINE_DIR" "$1" > /tmp/clamscan_results
clamscan -r -i "$1" > /tmp/clamscan_results

# 感染ファイルが検出された場合、ntfyで通知
INFECTED_FILES=$(cat /tmp/clamscan_results | grep FOUND | cut -d ' ' -f 1)
echo $INFECTED_FILES
if [ -n "$INFECTED_FILES" ]; then
  # 感染ファイルリストをメッセージに含める
  MESSAGE="ClamAVでウイルスが検出されました。\nホスト名: $(hostname)\n感染ファイル:\n$INFECTED_FILES"

  # ntfyで通知を送信
  su <<<user>>> -c "~/.local/bin/ntfy send \"$MESSAGE\""
fi

# 一時ファイルを削除
su root -c "rm -f /tmp/clamscan_results"

su <<<user>>> -c "~/.local/bin/ntfy send \"終了します。\""


開発系

VitualBox

最新を確認してDL。

最新が7.2.0の場合
# selinuxの無効化
getenforce
<出力結果>
Enforcing ←有効
cp -piv /etc/selinux/config /etc/selinux/config.`date "+%Y%m%d"`
vi /etc/selinux/config 
--
SELINUX=enforcing
 ↓
SELINUX=disabled
へ変更

reboot
--

# インストール
sudo yum install https://download.virtualbox.org/virtualbox/7.2.0/VirtualBox-7.2-7.2.0_170228_el10-1.x86_64.rpm
#This system is currently not set up to build kernel modules.
の時は↓
sudo yum install kernel-devel kernel-devel-5.14.0-362.13.1.el9_3.x86_64
sudo /sbin/vboxconfig
でvbox再起動。

# 共有フォルダがマウントされない場合
ゲスト側で以下を実行
sudo apt install virtualbox-guest-utils

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?