Automated initialization & modern CLI environment (fzf, ripgrep, bat, fd-find, FDclone) setup scripts for Debian / Ubuntu environments (Bare-metal, VMs, Proxmox LXC containers).
🇬🇧 English | 🇯🇵 日本語 | 📝 Changelog
🤖 Note / 免責事項
This repository and scripts were generated and optimized in collaboration with AI (Google Gemini).
本リポジトリに含まれるシェルスクリプトおよび本READMEは、AI (Google Gemini) との対話・協働によって生成・最適化されたものです。
An interactive script to streamline the initial setup of Debian / Ubuntu:
- Package Update & Base Tools: Runs
apt update/upgradeand installscurl,git,sudo,nano,bash-completion, etc. - Root & User Environment: Enables colored prompts (
root@xxxx:~#) andbash-completionout of the box. - Locale & Timezone: Configures
Asia/Tokyotimezone and generatesja_JP.UTF-8(Auto-detects Debian vs Ubuntu package differences). - SSH Root Login (Enable / Disable): Safely enables or disables SSH root password login (
/etc/ssh/sshd_configandsshd_config.d/). - User Creation: Interactively creates a new user with
sudoprivileges.
Installs fzf (latest Git build) and FDclone, automatically resolving command name conflicts on Ubuntu/Debian (fd vs fdfind, bat vs batcat).
- Multi-User / sudo Support: When executed via
sudo, automatically installsfzfand applies.bashrcconfigurations to bothrootand the invoking user ($SUDO_USER). - Protects FDclone Config: Preserves original
/etc/fdclone/fd2rc.orgsafely. - Conflict Avoidance:
- Sets Rust
fdasfdfindinfzfbackend to co-exist withFDclone(fd). - Sets
alias bat='batcat'.
- Sets Rust
- System Maintenance Script (
upg):- Automatically creates
/usr/local/bin/upgand creates a symlink to/usr/bin/upg(ensuring compatibility with Proxmox LXC containers and restricted PATH environments). - One-shot system update and cleanup: supports Debian / Ubuntu (
apt-get), Alpine Linux (apk), as well assnapandflatpak.
- Automatically creates
Recommended for fresh/minimal containers with wget:
bash -c "$(wget -qO- https://raw.githubusercontent.com/TouryuTamane/debian-init-scripts/main/init-setup.sh)"(Or with curl: bash -c "$(curl -fsSL https://raw.githubusercontent.com/TouryuTamane/debian-init-scripts/main/init-setup.sh)")
bash -c "$(wget -qO- https://raw.githubusercontent.com/TouryuTamane/debian-init-scripts/main/fzf_fdclone.sh)"
source ~/.bashrc(Or with curl: bash -c "$(curl -fsSL https://raw.githubusercontent.com/TouryuTamane/debian-init-scripts/main/fzf_fdclone.sh)")
upggit clone https://github.com/TouryuTamane/debian-init-scripts.git
cd debian-init-scripts
chmod +x *.sh
sudo ./init-setup.sh
sudo ./fzf_fdclone.shDebian / Ubuntu 環境(実機、VM、Proxmox LXCコンテナ等)の初期セットアップおよび、モダンCLI(fzf, ripgrep, bat, fd-find)と伝統のファイラー FDclone を最高に共存させる統合セットアップスクリプト群です。
Debian / Ubuntu の初期構築で必要な処理をまとめた対話型インタラクティブスクリプトです。
- パッケージ更新 & 基本ツール導入:
apt update/upgradeおよびcurl,git,sudo,nano,bash-completion等の導入 - Root & ユーザー環境の最適化:
rootを含む環境で色付きプロンプト(root@xxxx:~#)およびbash-completion(コマンド補完)を自動有効化 - 日本語化 & タイムゾーン設定:
Asia/Tokyoへの変更とja_JP.UTF-8ロケール生成(Debian/Ubuntuの差分を自動判別) - SSH Root ログイン設定 (許可 / 禁止):
/etc/ssh/sshd_configおよびsshd_config.d/を安全に書き換え(許可・無効化に対応) - 一般ユーザー追加:
sudo権限を付与したユーザーの対話的作成
fzf (Git最新版) と FDclone を導入し、Ubuntu/Debian特有のコマンド名衝突(fd と bat)を安全に回避しながら .bashrc へ最適なエイリアス・プレビュー設定を追記します。
-
マルチユーザー / sudo 実行対応:
sudo経由で実行された場合、rootだけでなく実行元の一般ユーザー($SUDO_USER)の環境にも自動でfzfインストールおよび.bashrc設定を適用 -
FDclone設定の保護: 既存の
/etc/fdclone/fd2rc.orgを自動退避してオリジナルの英語設定を安全に維持 -
名前衝突対策:
-
Rust製
fdはfdfindとしてfzfの検索バックエンドに明示指定し、FDclone(fd) と共存 -
batコマンドはbatcatへ自動エイリアス設定 -
一括メンテナンスツール
upgの自動作成:/usr/local/bin/upgを生成し、同時に/usr/bin/upgへのシンボリックリンクを自動作成(Proxmox LXC や最小環境での PATH 不足時でも確実に動作)- Debian / Ubuntu (
apt-get) に加え、Alpine Linux (apk)、さらにsnap/flatpakの一括アップデートと後片付け (autoremove,clean) に対応
新規コンテナや最小環境(wget 標準搭載)向け推奨ワンライナー:
bash -c "$(wget -qO- https://raw.githubusercontent.com/TouryuTamane/debian-init-scripts/main/init-setup.sh)"(curl がある場合: bash -c "$(curl -fsSL https://raw.githubusercontent.com/TouryuTamane/debian-init-scripts/main/init-setup.sh)")
bash -c "$(wget -qO- https://raw.githubusercontent.com/TouryuTamane/debian-init-scripts/main/fzf_fdclone.sh)"
source ~/.bashrc(curl がある場合: bash -c "$(curl -fsSL https://raw.githubusercontent.com/TouryuTamane/debian-init-scripts/main/fzf_fdclone.sh)")
セットアップ完了後、いつでも以下のコマンドでシステム全体の更新と掃除を行えます。
upggit clone https://github.com/TouryuTamane/debian-init-scripts.git
cd debian-init-scripts
chmod +x *.sh
sudo ./init-setup.sh
sudo ./fzf_fdclone.sh- 高い冪等性 (Idempotency): 何度実行しても既存の設定を無駄に破壊しません。
- 環境に配慮した設計: Proxmox LXC や Minimal インストール直後の環境でもストレスなく極上のCLI環境へ移行できます。