I'm running Raspberry Pi OS Bookworm with the GNOME desktop environment, and this is the method I use to install LibreOffice. I hope this helps!
Step 1 – Remove current installation:Step 2 – Install a minimal, GTK-based LibreOffice setup:Step 3 – Don’t forget your language support packages!
These are required for spell checking and proper help/documentation.
For example, US English:Optional – Detect and install language packages automatically:
Use the following script to detect your system’s configured locales and install matching language support packages for LibreOffice, Hunspell, and Hyphenation.
Let me know if this helped or if anything can be improved further!
Step 1 – Remove current installation:
Code:
sudo apt-get remove --purge libreoffice*sudo apt-get autoremove
Code:
sudo apt install libreoffice-{writer,calc,impress,gtk3,gnome,style-colibre}
These are required for spell checking and proper help/documentation.
For example, US English:
Code:
sudo apt install hyphen-en-us hunspell-en-us libreoffice-help-en-us libreoffice-l10n-en-us
Use the following script to detect your system’s configured locales and install matching language support packages for LibreOffice, Hunspell, and Hyphenation.
Code:
INSTALLED_PACKAGES=""; echo "Searching for language packages..."; TOTAL_LOCALES=$(locale -a | grep -Ei 'utf-8|utf8' | wc -l); COUNT=0; for loc in $(locale -a | grep -Ei 'utf-8|utf8'); do ((COUNT++)); echo "➡ Processing ($COUNT/$TOTAL_LOCALES): $loc"; full_locale=$(echo $loc | awk -F'[_\\.@]' '{print tolower($1 "-" $2)}'); base_locale=$(echo $full_locale | cut -d'-' -f1); for pkg_type in hunspell hyphen libreoffice-help libreoffice-l10n; do base_pkg="${pkg_type}-${base_locale}"; full_pkg="${pkg_type}-${full_locale}"; found_pkgs=($(apt-cache search "^${pkg_type}-${base_locale}" | awk '{print $1}')); if [[ ${#found_pkgs[@]} -gt 0 ]]; then for pkg in "${found_pkgs[@]}"; do if [[ "$pkg" =~ ^${pkg_type}-${base_locale}$ ]]; then best_pkg="$pkg"; break; elif [[ -z "$best_pkg" ]]; then best_pkg="$pkg"; fi; done; INSTALLED_PACKAGES+=" $best_pkg"; elif apt-cache show "$full_pkg" &>/dev/null && ! apt-cache policy "$full_pkg" | grep -q 'Candidate: (none)'; then INSTALLED_PACKAGES+=" $full_pkg"; elif apt-cache show "$base_pkg" &>/dev/null && ! apt-cache policy "$base_pkg" | grep -q 'Candidate: (none)'; then INSTALLED_PACKAGES+=" $base_pkg"; fi; done; done; if [[ -n "$INSTALLED_PACKAGES" ]]; then echo "⚙ Packages to be installed: $INSTALLED_PACKAGES"; COUNT=0; TOTAL_PACKAGES=$(echo $INSTALLED_PACKAGES | wc -w); for pkg in $INSTALLED_PACKAGES; do ((COUNT++)); echo "➡ Installing ($COUNT/$TOTAL_PACKAGES): $pkg"; if apt-cache show "$pkg" | grep -q "Conflicts"; then echo "⚠ Conflict detected: Skipping $pkg."; else sudo apt-get install --ignore-missing -y "$pkg" >/dev/null 2>&1 || echo "☒ Failed: $pkg"; fi; done; echo "Checking for missing dependencies..."; sudo apt-get install -f -y >/dev/null 2>&1; else echo "☑ No language packages found to install."; fi; echo "Finished!"
Let me know if this helped or if anything can be improved further!
Statistics: Posted by Wobbo — Fri Apr 11, 2025 7:25 pm