Managing multiple Linux devices in an enterprise environment can be challenging, especially when it comes to deploying applications consistently across all endpoints. Scalefusion Unified Endpoint Management (UEM) offers a robust solution to this problem by enabling IT administrators to install multiple applications simultaneously on Linux devices using Flatpak. This guide provides a step-by-step approach to achieving efficient application deployment.
Understanding Flatpak
Flatpak is a universal package management system for Linux, allowing applications to run on any Linux distribution. It simplifies the installation process and ensures that applications are sandboxed for enhanced security.
Prerequisites
Before you begin, ensure you have the following:
- A Scalefusion UEM account.
- Linux devices enrolled in Scalefusion UEM.
Step 1: Prepare Flatpak Packages
-
Identify Applications: Determine which applications you want to install using Flatpak. Ensure they are available on Flathub or another Flatpak repository. Find the package name by navigating to https://flathub.org/apps then click on the app and copy the last part of the link from the address bar.
-
Create .flatpakref Files (Optional): If you want to use .flatpakref files for easier installation, you can download them from Flathub or create them manually.
Step 2: Prepare the Installation Script
- To deploy multiple applications, you'll need to create a bash script that installs Flatpak, (if not already installed) Flatpak Remote Repository and the desired applications.
Create the Script:
-
Open a UTF-8 compatible text editor (e.g., gedit, for linux or Notepad++ on windows ) and paste the following script:
#!/bin/bash
# This script installs Flatpak and deploys specified applications
# It is designed to run non-interactively for MDM deployment
# Log file setup
LOG_FILE="/var/log/flatpak-deployment.log"
# Function for logging
log() {
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a "$LOG_FILE"
}
# Error handling function
handle_error() {
log "ERROR: $1"
exit 1
}
# Check for root permissions
if [ "$(id -u)" -ne 0 ]; then
handle_error "This script must be run as root or with sudo"
fi
log "Starting Flatpak deployment script"
# Install Flatpak if not already installed
if ! command -v flatpak &> /dev/null; then
log "Installing Flatpak..."
apt-get update -qq || handle_error "Failed to update package lists"
apt-get install -y flatpak -qq || handle_error "Failed to install Flatpak"
log "Flatpak installed successfully"
else
log "Flatpak is already installed"
fi
# Add Flathub repository if not already added
if ! flatpak remote-list | grep -q flathub; then
log "Adding Flathub repository..."
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo || handle_error "Failed to add Flathub repository"
log "Flathub repository added successfully"
else
log "Flathub repository is already configured"
fi
# List of applications to install
# Note: You can find available applications at https://flathub.org/apps
apps=(
com.skype.Client
com.google.Chrome
com.sublimetext.three
com.anydesk.Anydesk
org.filezillaproject.Filezilla
)
# Install each application
for app in "${apps[@]}"; do
if [ "$app" = "ADD_APP_PACKAGE_NAME" ]; then
log "No applications specified in the script. Please edit the 'apps' array."
continue
fi
log "Installing $app..."
if flatpak list | grep -q "$app"; then
log "$app is already installed, skipping"
else
flatpak install --noninteractive flathub "$app" || {
log "Warning: Failed to install $app. Continuing with other applications."
}
log "$app installed successfully"
fi
done
log "Flatpak deployment script completed"
exit 0
-
Replace the entries in the apps array in place of ADD_APP_PACKAGE_NAME with the Flatpak package names of the applications you wish to install.
-
Save the file with a .sh extension, for example, install_apps.sh
Step 2: Upload and Deploy the Script via Scalefusion
Scalefusion allows you to remotely execute scripts on enrolled devices, facilitating seamless application deployment.
-
Access the Scalefusion Dashboard:
-
Log in to your Scalefusion account and navigate to the dashboard.
-
-
Upload the Script:
-
Navigate to Application Management > Enterprise Store, click on Upload New App, and select Upload Linux Script.
-
-
-
In the Upload Shell Scripts wizard, provide a Script Name for identification.
-
Upload the install_apps.sh file you created.
-
Choose the Execution Level:
-
Device: Executes the script for all existing users on the device.
-
User: Executes the script for the currently logged-in user.
-
-
Configure the Schedule:
-
Run Once On Publish: Executes the script once upon publishing.
-
Run At Every Login: Executes the script at each user login.
-
Run On Schedule: Sets specific days and times for script execution.
-
-
-
Click Save to process the script.
-
-
Deploy the Script:
-
After saving, select the device profiles to which you want to publish the script.
-
Click Publish to deploy the script to the selected devices.
-
Step 3: Verify Installation
After deployment, it's essential to confirm that the applications have been installed successfully.
- Check Device Status:
- In the Scalefusion dashboard, navigate to the Application Management > Enterprise Apps section.
-
-
Click on the three-dots on your deployed script, select details then view status > view details.
-
2. Confirm Application Installation:
-
On the Linux device, open a terminal and run:
flatpak list
-
-
This command will display a list of installed Flatpak applications. Verify that your desired applications are present.
-
Conclusion
Deploying multiple applications across Linux devices is streamlined with Scalefusion UEM and Flatpak. By following this guide, IT administrators can ensure consistent application environments across all managed devices, enhancing productivity and reducing manual intervention.
For more detailed information, refer to Scalefusion's official documentation on Deploying Linux Shell Scripts.
0 Comments
No Comments