Run your apps in sandboxes
If you're a Linux user, you probably know that it's a good idea to do a fresh install of your operating system every once in a while. Over time, system upgrades can lead to compatibility issues and conflicts between different applications. But who wants to go through the hassle of reinstalling everything from scratch?
What about “Flatpak”?
Flatpak is a fantastic app manager that helps you avoid those annoying application conflicts. How, you ask? Flatpak packages run in isolated environments, or "sandboxes," on your system. This means that each app has its own dependencies, so there's no risk of one app interfering with another. Plus, you can install multiple apps with a single command using a simple script, making it easy to keep your system up to date and running smoothly.
So how does it works?
Installing Flatpak
Before you can begin installing applications with Flatpak, you will need to install the Flatpak package itself. This can be done from the command line using the Pacman package manager:
sudo pacman -S flatpak
Once Flatpak is installed, you will need to add the Flathub repository, which contains a large number of applications. To do this, run the following command:
flatpak remote-add --if-not-exists flathub <https://flathub.org/repo/flathub.flatpakrepo>
Here is some useful documents for going deeper:
Usual commands
Then the script for multiple apps
You can create a script with a list of multiple application IDs to automate the process of installing multiple Flatpak applications. Here's an example of what the script could look like:
#!/bin/bash
# Add the Flathub repository
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
# Define an array of application IDs
applications=(
com.visualstudio.code
com.discordapp.Discord
com.stremio.Stremio
nz.mega.MEGAsync
com.brave.Browser
com.dropbox.Client
org.nomacs.ImageLounge
com.prusa3d.PrusaSlicer
org.inkscape.Inkscape
org.gimp.GIMP
cc.arduino.arduinoide
org.fritzing.Fritzing
org.audacityteam.Audacity
com.valvesoftware.Steam
com.github.eneshecan.WhatsAppForLinux
com.sindresorhus.Caprine
md.obsidian.Obsidian
net.codeindustry.MasterPDFEditor
org.librepcb.LibrePCB
)
# Loop through the array of applications
for app in "${applications[@]}"; do
# Install the application
flatpak install -y flathub $app
done
# Update all installed applications
flatpak update
Save this script to a file with a .sh
extension, such as install-apps.sh
, and make it executable using the following command:
chmod +x install-apps.sh
Then run the script using the following command:
bash install-apps.sh
This script will add the Flathub repository if it's not already added, and then install each application in the applications
array. It will also update all installed applications at the end. You can add or remove applications from the array as needed.
Pacman
or any other distro you love.#!/bin/bash
# Define the list of packages to install
packages=(
Pulseaudio LADSPA Equalizer
clipgrab
)
# Iterate over the list of packages and install them one by one
for package in "${packages[@]}"; do
sudo pacman -S $package
done
Conclusion
Now that we have our script ready, with a single command, we can easily install all our preferred apps, and enjoy the excitement of testing out our new setup without worrying about any conflicts or system issues.
So, let's take a deep breath, hit the <Enter
↵
>
button, and see how our new script performs.
Wait for it….
Wait for it….
Wait for it….
Done!
— wait, there is still maybe a problem….
some workarounds:
- Install this one, FlatSeal will help you to adjust how apps interact with the system.
- If you're getting a
Permission denied: '/dev/ttyACM0’
error when trying to upload or communicate with the board, here are some steps you can try: - Make sure your user account is a member of the
dialout
group, which has permission to access the serial port. You can check by running the command: - if you don’t see
uucp
in the list, add your user account to theuucp
group: - Log out and log back in to apply the group membership changes.
- Try accessing the serial port again and see if you still get a "permission denied" error. If you do, you may need to adjust the permissions of the serial port device file directly by running the command:
groups
sudo usermod -a -G uucp <username>
Replace <username>
with your actual username.
sudo chmod a+rw /dev/ttyACM0