✨ 주요 기능: - Proxmox VE 9.0에서 apt update 오류 해결 - No-subscription 저장소 자동 구성 - Enterprise 저장소 자동 비활성화 - Ceph 저장소 설정 (기본 비활성) 🛠️ 포함 파일: - fix-pve9-repos.sh: 자동 설정 스크립트 - README.md: 한글 설치 가이드 및 사용법 📦 설치 방법: curl -fsSL https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/fix-pve9-repos.sh | bash 🔧 해결하는 문제: - PVE 8.0 post-install 스크립트가 9.0에서 작동하지 않는 문제 - Debian 13 Trixie 기반 저장소 설정 오류 - apt update 실행 시 발생하는 인증 오류 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
78 lines
2.5 KiB
Bash
78 lines
2.5 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Proxmox VE 9.0 Repository Fix Script
|
|
# Fixes apt update issues by properly configuring no-subscription repositories
|
|
|
|
echo "🔧 Fixing Proxmox VE 9.0 repositories..."
|
|
|
|
# 0) Install required keyrings (usually pre-installed)
|
|
install -d -m 0755 /usr/share/keyrings
|
|
if [ ! -f /usr/share/keyrings/proxmox-archive-keyring.gpg ]; then
|
|
echo "📦 Installing proxmox-archive-keyring..."
|
|
apt-get update
|
|
apt-get install -y proxmox-archive-keyring || true
|
|
fi
|
|
|
|
CODENAME="trixie" # PVE 9 = Debian 13 Trixie
|
|
|
|
# 1) Configure PVE no-subscription repository (deb822 format)
|
|
echo "📝 Configuring PVE no-subscription repository..."
|
|
cat >/etc/apt/sources.list.d/proxmox.sources <<EOF
|
|
Types: deb
|
|
URIs: http://download.proxmox.com/debian/pve
|
|
Suites: ${CODENAME}
|
|
Components: pve-no-subscription
|
|
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
|
|
Enabled: yes
|
|
EOF
|
|
|
|
# 2) Configure Ceph no-subscription repository (disabled by default)
|
|
echo "📝 Configuring Ceph no-subscription repository..."
|
|
cat >/etc/apt/sources.list.d/ceph.sources <<EOF
|
|
Types: deb
|
|
URIs: http://download.proxmox.com/debian/ceph-squid
|
|
Suites: ${CODENAME}
|
|
Components: no-subscription
|
|
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
|
|
Enabled: no
|
|
EOF
|
|
|
|
# 3) Disable enterprise repositories in .sources files
|
|
echo "🔒 Disabling enterprise repositories..."
|
|
for f in /etc/apt/sources.list.d/*.sources; do
|
|
[ -f "$f" ] || continue
|
|
if grep -q "enterprise\.proxmox\.com" "$f"; then
|
|
awk -v RS= -v ORS="\n\n" '{
|
|
if ($0 ~ /enterprise\.proxmox\.com/) {
|
|
if ($0 ~ /Enabled:/) sub(/Enabled:.*/, "Enabled: no");
|
|
else $0 = $0 "\nEnabled: no";
|
|
}
|
|
print
|
|
}' "$f" > "$f.new" && mv "$f.new" "$f"
|
|
echo " ✓ Disabled enterprise repo in $f"
|
|
fi
|
|
done
|
|
|
|
# 4) Comment out enterprise repos in old .list files & remove duplicate no-sub entries
|
|
echo "🔒 Cleaning up old repository files..."
|
|
for f in /etc/apt/sources.list /etc/apt/sources.list.d/*.list; do
|
|
[ -f "$f" ] || continue
|
|
if grep -q "enterprise\.proxmox\.com" "$f" 2>/dev/null; then
|
|
sed -i -E 's|^(deb .*enterprise\.proxmox\.com.*)$|# \1|' "$f"
|
|
echo " ✓ Commented enterprise repo in $f"
|
|
fi
|
|
done
|
|
rm -f /etc/apt/sources.list.d/pve-no-subscription.list 2>/dev/null || true
|
|
|
|
# 5) Update package lists
|
|
echo "🔄 Updating package lists..."
|
|
apt-get update
|
|
|
|
echo ""
|
|
echo "✅ Proxmox VE 9.0 repository configuration completed!"
|
|
echo " - No-subscription repository: ENABLED"
|
|
echo " - Enterprise repository: DISABLED"
|
|
echo " - apt update should now work correctly"
|
|
echo ""
|