Add Arch Linux CT support and pacman integration

Add Arch Linux container support and integrate pacman into install utilities. New files: ct/archlinux.sh (container build/update script), install/archlinux-install.sh (install entrypoint), and json/archlinux.json (metadata). misc/install.func: detect_arch in detect_os, add pacman bootstrap, and implement pacman handlers for pkg_upgrade, pkg_install, pkg_remove, pkg_clean and package refresh; include openssh install path for pacman and provide a cleanup_lxc override to run pkg_clean. Enables creating/updating Arch Linux LXC containers and proper package manager handling.
This commit is contained in:
CanbiZ (MickLesk)
2026-04-27 13:46:18 +02:00
parent c199428604
commit 796b79241c
4 changed files with 134 additions and 1 deletions

42
ct/archlinux.sh Normal file
View File

@@ -0,0 +1,42 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
# Source: https://archlinux.org/
APP="Arch Linux"
var_tags="${var_tags:-os}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-512}"
var_disk="${var_disk:-4}"
var_os="${var_os:-archlinux}"
var_version="${var_version:-base}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /var ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating Arch Linux LXC"
$STD pacman -Syu --noconfirm
msg_ok "Updated Arch Linux LXC"
exit
}
start
build_container
description
msg_ok "Completed successfully!"
msg_custom "🚀" "${GN}" "${APP} setup has been successfully initialized!"

View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
# Source: https://archlinux.org/
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
motd_ssh
customize
cleanup_lxc

38
json/archlinux.json Normal file
View File

@@ -0,0 +1,38 @@
{
"name": "Arch Linux",
"slug": "archlinux",
"categories": [2],
"date_created": "2026-04-27",
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": null,
"documentation": "https://wiki.archlinux.org/",
"website": "https://archlinux.org/",
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/arch-linux.webp",
"description": "Arch Linux is a lightweight, rolling-release Linux distribution that follows a keep-it-simple philosophy. It provides a minimalist base system that users can build upon according to their needs.",
"install_methods": [
{
"type": "default",
"script": "ct/archlinux.sh",
"config_path": null,
"resources": {
"cpu": 1,
"ram": 512,
"hdd": 4,
"os": "Arch Linux",
"version": "base"
}
}
],
"default_credentials": {
"username": null,
"password": null
},
"notes": [
{
"text": "Arch Linux is a rolling-release distribution. Run 'pacman -Syu' regularly to keep the system up to date.",
"type": "info"
}
]
}

View File

@@ -37,7 +37,7 @@
# Global variables for OS detection
OS_TYPE="" # debian, ubuntu, devuan, alpine, fedora, rocky, alma, centos, opensuse, gentoo, openeuler
OS_FAMILY="" # debian, alpine, rhel, suse, gentoo
OS_FAMILY="" # debian, alpine, rhel, suse, gentoo, arch
OS_VERSION="" # Version number
PKG_MANAGER="" # apt, apk, dnf, yum, zypper, emerge
INIT_SYSTEM="" # systemd, openrc, sysvinit
@@ -128,6 +128,11 @@ detect_os() {
OS_FAMILY="suse"
PKG_MANAGER="zypper"
;;
arch | archlinux)
OS_TYPE="arch"
OS_FAMILY="arch"
PKG_MANAGER="pacman"
;;
gentoo)
OS_FAMILY="gentoo"
PKG_MANAGER="emerge"
@@ -167,6 +172,8 @@ _bootstrap() {
yum install -y curl &>/dev/null
elif command -v zypper &>/dev/null; then
zypper install -y curl &>/dev/null
elif command -v pacman &>/dev/null; then
pacman -Sy --noconfirm curl &>/dev/null
elif command -v emerge &>/dev/null; then
emerge --quiet net-misc/curl &>/dev/null
fi
@@ -428,6 +435,9 @@ EOF
zypper)
$STD zypper refresh
;;
pacman)
$STD pacman -Sy --noconfirm
;;
emerge)
$STD emerge --sync
;;
@@ -466,6 +476,9 @@ pkg_upgrade() {
zypper)
$STD zypper -n update
;;
pacman)
$STD pacman -Su --noconfirm
;;
emerge)
$STD emerge --quiet --update --deep @world
;;
@@ -503,6 +516,9 @@ pkg_install() {
zypper)
$STD zypper install -y "${packages[@]}"
;;
pacman)
$STD pacman -S --noconfirm "${packages[@]}"
;;
emerge)
$STD emerge --quiet "${packages[@]}"
;;
@@ -538,6 +554,9 @@ pkg_remove() {
zypper)
$STD zypper remove -y "${packages[@]}"
;;
pacman)
$STD pacman -R --noconfirm "${packages[@]}"
;;
emerge)
$STD emerge --quiet --unmerge "${packages[@]}"
;;
@@ -572,6 +591,9 @@ pkg_clean() {
zypper)
$STD zypper clean
;;
pacman)
$STD pacman -Sc --noconfirm
;;
emerge)
$STD emerge --quiet --depclean
;;
@@ -1084,6 +1106,9 @@ EOF
zypper)
pkg_install openssh
;;
pacman)
pkg_install openssh
;;
emerge)
pkg_install net-misc/openssh
;;
@@ -1280,3 +1305,13 @@ os_info() {
echo "Pkg Manager: $PKG_MANAGER"
echo "Init System: $INIT_SYSTEM"
}
# ------------------------------------------------------------------------------
# cleanup_lxc()
#
# Overrides core.func version to support all OS types (not just Alpine/Debian)
# Cleans package caches and removes unnecessary packages after installation
# ------------------------------------------------------------------------------
cleanup_lxc() {
pkg_clean
}