* Add robust package and repository management helpers
Introduces unified helper functions for package installation, repository management, and legacy cleanup across Debian/Ubuntu upgrades. Adds retry logic for APT operations, keyring cleanup, service management, version checks, and tool-specific repository setup. Refactors setup functions for Composer, FFmpeg, Go, Ghostscript, ImageMagick, Java, hardware acceleration, and MariaDB to use new helpers, improving reliability and upgrade safety.
* english comment
Extended the MongoDB setup function to handle both Debian and Ubuntu distributions, mapping their codenames to supported MongoDB suites. Updated the GPG key URL and output path, and adjusted the repository source file structure to match MongoDB's nested layout.
Fallback to 'bookworm' for unknown Debian releases and update repository verification to check the correct nested path for MongoDB. Also adjust the sources.list format to match the new repository structure.
Simplifies the arguments passed to verify_repo_available by removing the MongoDB version and org path from the suite parameter. Also sets the repository component to 'main' instead of using the variable REPO_COMPONENT.
Update the repository path passed to verify_repo_available to include the MongoDB version, ensuring the correct repository is checked for availability.
Enhances the setup_mongodb function to explicitly map Debian codenames to MongoDB-supported suites and adds a fallback to 'bookworm' if the repository is unavailable for the detected suite. This improves compatibility with newer Debian releases and provides clearer error handling.
Enhances the setup_nodejs function by improving checks for existing Node.js and npm installations, ensuring jq is installed, handling APT update failures with retries, and providing clearer messaging. Also refines global Node module installation logic with better version checks, update/install messaging, and error handling. Ensures a safe working directory for npm to avoid errors.
Adds explicit mapping of 'trixie', 'forky', and 'sid' to 'bookworm' for MongoDB repository setup. Improves error handling by failing early if the repository is unavailable, instead of attempting a fallback.