Ubuntu 20.04 and 22.04 leave EVERY architecture, not just s390x. pikepdf needs qpdf 12.2, whose build requires C++20, while focal ships GCC 9 and publishes no g++-10 for s390x at all. Python 3.8, node 10, cargo 0.67 and OpenSSL 1.1.1 each had a workaround; the pile of them did not. 18.04 follows, already off the lists. The refusal lands before any apt, this script also serving existing machines. AlmaLinux 9 and 10, Rocky 9 and 10 join the catalog on all four architectures: the twelve "latest" URLs were opened, with no index to parse unlike Fedora. They would have booted unreachable though -- the cloud-config forced "groups: users, sudo", but the RHEL family has no sudo group, only wheel, and an unknown group makes useradd fail, hence no password and no key. The very trap already known for Debian, repeated elsewhere. Host side, EPEL and CRB are enabled: without them most -devel packages are missing, silently. The server / graphical choice gains Cinnamon, the Linux Mint desktop, from the distribution's own repositories. Mint's repository is set aside: plain HTTP, and i386/amd64 only, which would rule out arm64 and s390x. Along the way, dnf now installs an ENVIRONMENT rather than a group -- "gnome-desktop" brings gdm and gnome-shell but not base-x, hence no X server. --- FR --- Ubuntu 20.04 et 22.04 partent de TOUTES les architectures, pas seulement de s390x. pikepdf réclame qpdf 12.2, dont la compilation exige C++20, quand focal livre GCC 9 et ne publie même pas de g++-10 pour s390x. Python 3.8, node 10, cargo 0.67 et OpenSSL 1.1.1 avaient chacun leur contournement ; leur accumulation, non. 18.04 suit, déjà hors des listes. Le refus tombe avant tout apt, ce script servant aussi les machines existantes. AlmaLinux 9 et 10, Rocky 9 et 10 entrent au catalogue, sur les quatre architectures : les douze URL « latest » ont été ouvertes, aucun index à analyser contrairement à Fedora. Elles auraient pourtant démarré inaccessibles — le cloud-config imposait « groups: users, sudo », or la famille RHEL n'a pas de groupe sudo mais wheel, et un groupe inconnu fait échouer useradd, donc ni mot de passe ni clé. C'est le piège déjà connu pour Debian, reproduit ailleurs. Côté hôte, EPEL et CRB sont activés : sans eux la plupart des -devel manquent, en silence. Le choix serveur / graphique gagne Cinnamon, le bureau de Linux Mint, depuis les dépôts de la distribution. Le dépôt de Mint lui-même est écarté : il est en HTTP nu et ne publie que i386 et amd64, ce qui exclurait arm64 et s390x. Au passage, dnf installe désormais un ENVIRONNEMENT et non un groupe — « gnome-desktop » apporte gdm et gnome-shell mais pas base-x, donc pas de serveur X. Assisted-by: Claude Opus 5
155 lines
6.5 KiB
Bash
Executable file
155 lines
6.5 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# © 2021-2026 TechnoLibre (http://www.technolibre.ca)
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
|
#
|
|
# Dépendances système ERPLibre pour Fedora (dnf). Équivalent Fedora de
|
|
# install_debian_dependency.sh. « --skip-unavailable » tolère un nom de paquet
|
|
# absent (dnf5) au lieu d'échouer sur tout le lot.
|
|
|
|
. ./env_var.sh
|
|
|
|
EL_USER=${USER}
|
|
|
|
# dnf résilient : rafraîchit le cache (évite « checksum doesn't match » /
|
|
# signature après un cache périmé) et saute les paquets introuvables.
|
|
DNF="sudo dnf install -y --refresh --skip-unavailable"
|
|
|
|
#--------------------------------------------------
|
|
# Dérivés RHEL : dépôts supplémentaires
|
|
#--------------------------------------------------
|
|
# AlmaLinux, Rocky, CentOS Stream et RHEL passent par ce script (install_dev.sh
|
|
# les aiguille sur ID_LIKE=rhel). Contrairement à Fedora, leur jeu de dépôts
|
|
# par défaut est ÉTROIT : la plupart des paquets « -devel » vivent dans CRB
|
|
# (CodeReady Builder), et tout ce qui est communautaire dans EPEL. Sans ces
|
|
# deux dépôts, « --skip-unavailable » saute les paquets EN SILENCE et l'échec
|
|
# n'apparaît qu'à la compilation, très loin d'ici.
|
|
if [ -r /etc/os-release ]; then
|
|
# shellcheck disable=SC1091
|
|
. /etc/os-release
|
|
fi
|
|
case "${ID}" in
|
|
almalinux | rocky | rhel | centos)
|
|
echo -e "\n---- Depots EPEL et CRB (famille RHEL) ----"
|
|
sudo dnf install -y epel-release \
|
|
|| echo "epel-release indisponible : certains paquets manqueront."
|
|
# « crb » sur EL9/EL10 ; « powertools » était le nom sur EL8.
|
|
sudo dnf config-manager --set-enabled crb 2> /dev/null \
|
|
|| sudo dnf config-manager --set-enabled powertools 2> /dev/null \
|
|
|| sudo dnf config-manager --enable crb 2> /dev/null \
|
|
|| echo "CRB/PowerTools non active : certains -devel manqueront."
|
|
;;
|
|
esac
|
|
|
|
#--------------------------------------------------
|
|
# Outils de compilation (build Python via pyenv, extensions Python)
|
|
#--------------------------------------------------
|
|
echo -e "\n---- Groupe outils de développement ----"
|
|
# Groupes par ID (le nom affiché « C Development Tools... » n'est pas matché).
|
|
sudo dnf group install -y --skip-unavailable development-tools c-development \
|
|
|| sudo dnf install -y gcc gcc-c++ make automake patch
|
|
|
|
#--------------------------------------------------
|
|
# PostgreSQL
|
|
#--------------------------------------------------
|
|
echo -e "\n---- Install PostgreSQL Server ----"
|
|
${DNF} postgresql-server postgresql-contrib libpq-devel
|
|
retVal=$?
|
|
if [[ $retVal -ne 0 ]]; then
|
|
echo "dnf install postgresql installation error."
|
|
exit 1
|
|
fi
|
|
# Initialisation du cluster (Fedora ne le fait pas automatiquement).
|
|
if [ ! -f /var/lib/pgsql/data/PG_VERSION ]; then
|
|
echo -e "\n---- Initialisation du cluster PostgreSQL ----"
|
|
# Nettoie un init partiel et FORCE une locale valide : les images cloud
|
|
# Fedora n'ont pas de LANG défini -> « initdb: invalid locale settings ».
|
|
sudo rm -rf /var/lib/pgsql/data
|
|
sudo PGSETUP_INITDB_OPTIONS="--locale=C.UTF-8 --encoding=UTF8" \
|
|
postgresql-setup --initdb || true
|
|
fi
|
|
sudo systemctl enable --now postgresql 2>/dev/null || true
|
|
# PostGIS : optionnel (géospatial), ne bloque pas.
|
|
${DNF} postgis || echo "PostGIS non installé (optionnel)."
|
|
|
|
echo -e "\n---- Creating the ERPLibre PostgreSQL User ----"
|
|
sudo su - postgres -c "createuser -s ${EL_USER}" 2>/dev/null || true
|
|
|
|
#--------------------------------------------------
|
|
# Dépendances de build (extensions Python, Odoo)
|
|
#--------------------------------------------------
|
|
echo -e "\n--- Installing fedora dependency --"
|
|
# git-daemon : sur Fedora la sous-commande « git daemon » N'EST PAS dans le
|
|
# paquet « git » de base (contrairement à Debian/Ubuntu/Arch). ERPLibre sert
|
|
# son manifeste via un « git daemon » local (git://127.0.0.1:9418/) pendant
|
|
# « repo sync » -> sans ce paquet : « git: 'daemon' is not a git command »
|
|
# puis « Connection refused » et l'échec de la synchro du manifeste.
|
|
${DNF} \
|
|
git git-daemon wget libxslt-devel libzip-devel openldap-devel \
|
|
cyrus-sasl-devel \
|
|
libffi-devel bzip2-devel parallel swig cmake portaudio-devel \
|
|
cups-devel xmlsec1 xmlsec1-openssl mariadb-connector-c-devel freetds-devel
|
|
retVal=$?
|
|
if [[ $retVal -ne 0 ]]; then
|
|
echo "dnf fedora tool installation error."
|
|
exit 1
|
|
fi
|
|
|
|
# Dépendances de build pour pyenv (compilation de CPython) — CRITIQUE.
|
|
echo -e "\n---- Dépendances pyenv (compilation Python) ----"
|
|
${DNF} \
|
|
make gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel \
|
|
openssl-devel tk-devel libffi-devel xz-devel patch findutils
|
|
retVal=$?
|
|
if [[ $retVal -ne 0 ]]; then
|
|
echo "dnf pyenv dependencies installation error."
|
|
exit 1
|
|
fi
|
|
|
|
# Dépendances selenium / bindings.
|
|
${DNF} \
|
|
cairo-devel python3-devel pkgconf-pkg-config gobject-introspection-devel \
|
|
libXt-devel || echo "Dépendances selenium partielles (optionnel)."
|
|
|
|
#--------------------------------------------------
|
|
# Node.js + npm (rtlcss, less)
|
|
#--------------------------------------------------
|
|
echo -e "\n---- Installing nodeJS NPM and rtlcss ----"
|
|
${DNF} nodejs npm
|
|
retVal=$?
|
|
if [[ $retVal -ne 0 ]]; then
|
|
echo "dnf nodejs installation error."
|
|
exit 1
|
|
fi
|
|
sudo npm install -g rtlcss less || echo "npm rtlcss/less: erreur (optionnel)."
|
|
|
|
echo -e "\n---- Test tool ----"
|
|
npm install || echo "npm install (prettier/plugin-xml): erreur (optionnel)."
|
|
sudo ln -fs /usr/local/bin/lessc /usr/bin/lessc 2>/dev/null || true
|
|
|
|
#--------------------------------------------------
|
|
# nginx (optionnel)
|
|
#--------------------------------------------------
|
|
if [ "${EL_INSTALL_NGINX}" = "True" ]; then
|
|
echo -e "\n---- Installing nginx ----"
|
|
${DNF} nginx || echo "nginx: erreur (optionnel)."
|
|
fi
|
|
|
|
#--------------------------------------------------
|
|
# wkhtmltopdf (optionnel) — paquet RPM officiel wkhtmltopdf
|
|
#--------------------------------------------------
|
|
if [ "${EL_INSTALL_WKHTMLTOPDF}" = "True" ]; then
|
|
if ! command -v wkhtmltopdf >/dev/null 2>&1; then
|
|
echo -e "\n---- Installing wkhtml (best-effort) ----"
|
|
# wkhtmltopdf ne publie plus de build « fedora-* » ; le RPM AlmaLinux 9
|
|
# (EL9) est compatible Fedora (testé sur F42 : dnf résout les deps).
|
|
# Repli AlmaLinux 8 au besoin.
|
|
_base="https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3"
|
|
sudo dnf install -y "${_base}/wkhtmltox-0.12.6.1-3.almalinux9.x86_64.rpm" \
|
|
|| sudo dnf install -y "${_base}/wkhtmltox-0.12.6.1-3.almalinux8.x86_64.rpm" \
|
|
|| echo "wkhtmltopdf non installé (optionnel)."
|
|
else
|
|
echo -e "\n---- Already installed wkhtml ----"
|
|
fi
|
|
fi
|
|
|
|
echo -e "\n---- Fedora dependency installation done ----"
|