Skip to content

Instantly share code, notes, and snippets.

@ibnsamy96
Last active April 6, 2025 10:38
Show Gist options
  • Save ibnsamy96/6df862030f247abc39dfc499a0f4e1a8 to your computer and use it in GitHub Desktop.
Save ibnsamy96/6df862030f247abc39dfc499a0f4e1a8 to your computer and use it in GitHub Desktop.
Issues I've faced during using linux and what I've done to fix them.

Issues I've faced after installing Linux

As a note, I've used kubuntu 24.04 and Ubuntu 22.04.

1. Some initial steps

Follow steps in this guide but don't uninstall snap Essential and strongly recommended things to do directly after a Kubuntu 24.04 LTS installation


2. Installing Flatpak

  1. To install Flatpak on Kubuntu 18.10 (Cosmic Cuttlefish) or later, simply run:
    sudo apt install flatpak
  2. The Flatpak plugin for the Software app makes it possible to install apps without needing the command line. To install on 20.04 or later, run:
    sudo apt install plasma-discover-backend-flatpak
  3. Flathub is the best place to get Flatpak apps. To enable it, run the following in a terminal:
    flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

3. Running hyper terminal

Download from Hyper Terminal Website

I download the .deb file from thier website and installed it without any issue. After installation, I couldn't run the terminal and when I I ran hyper -v in the terminal I got this error:
[4837:1002/012207.804557:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /opt/Hyper/chrome-sandbox is owned by root and has mode 4755.

Fix:

  1. Open a Terminal.
  2. Change Ownership: Run the following command to change the ownership to root:
    sudo chown root:root /opt/Hyper/chrome-sandbox
  3. Set Permissions: Then set the correct permissions (4755):
    sudo chmod 4755 /opt/Hyper/chrome-sandbox
  4. Verify Changes: You can check if the changes have been applied correctly with:
    ls -l /opt/Hyper/chrome-sandbox
    You should see something like:
    -rwsr-xr-x 1 root root ... /opt/Hyper/chrome-sandbox
    The s in the permissions indicates that the SUID bit is set correctly.
  5. Reopen the terminal, or restart the device

4. Having many outdated snap apps

I found outdated versions of firefox and thuderbird on the device due to installing them with snap.

Fix:

  1. Open a Terminal.
  2. Run snap list to see all the installed packages.
  3. Run snap remove firefox and snap remove thunderbird to remove the unused packages.
  4. Remove any other package you don't want.

5. The system freezes on high load

That's due to lack of memory and can be solved partially by increasing the swap size. You won't find the perfect result as the swap is created on the hard disk and it doesn't have the same speed of your ram, but it's better than nothing.

Fix:

  1. Open a Terminal after a fresh start of your device.
  2. Check for Existing Swap File:
    1. Run swapon --show to get the current swap file size.
    2. Run sudo swapoff /swapfile to turn off the existing swap file, if any.
    3. Next, remove the swap file with sudo rm /swapfile.
  3. Create a New Swap File:
    1. Create a 8GB swap file sudo fallocate -l 8G /swapfile.
    2. Run this command to ensure only the root user can access the swap file:sudo chmod 600 /swapfile
  4. Set Up the Swap Area:
    1. Run this command to prepare the file for use as swap: sudo mkswap /swapfile.
    2. Now, activate the swap file with: sudo swapon /swapfile.
  5. Make the Swap File Permanent:
    1. Open the /etc/fstab file in a text editor: sudo nano /etc/fstab.
    2. Add the following line at the end of the file to ensure the swap file is used on every boot: /swapfile none swap sw 0 0
    3. Save and exit the editor (Ctrl + O to save, then Ctrl + X to exit).

6. Not being able to mount the ntfs flashdrive

Mounting the drive shows an error in Dolphin File Explorer and the can't mount it in terminal too.

Fix:

  1. Open a Terminal.
  2. Run sudo ntfsfix -d <path> to fix its damage. Use the right path, ex. /dev/sdd1

7. Installing PWAs using firefox developers edition

For browser reference, chack the installation of Firefox Developers Edition

I'm using frefox developers edition as the default browser for my work as it doesn't need a lot of ram and provides better tools for me as a frontend developer so I needed to install the commonly used PWAs through it.
There is no official way to do so as Mozilla dropped supporting PWAs.

Fix:

  1. Make sure that've installed the browser using mozilla's native repos not flathub.
  2. Install this extension in firefox: https://addons.mozilla.org/en-US/firefox/addon/pwas-for-firefox.
  3. Follow its instructions installing the additional software to your device.
    1. Open your terminal.
    2. Install FUSE OverlayFS sudo apt-get install fuse-overlayfs
    3. Copy the provided firefoxpwa-runtime-overlayfs.service to $HOME/.config/systemd/user
      mkdir -p $HOME/.config/systemd/user && curl https://gist.githubusercontent.com/filips123/29fb511a01ee8016a927a614f32979d3/raw/0987fde6dd9b15283014f22a3d9b3f90a36431fc/firefoxpwa-runtime-overlayfs.service -o $HOME/.config/systemd/user/firefoxpwa-runtime-overlayfs.service
    4. Get the path of the browser directory, it's usually /usr/lib/firefox-devedition and export it to a var in the terminal export FIREFOX_RUNTIME=/usr/lib/firefox-devedition
    5. Modify AssertPathIsDirectory= and lowerdir= paths to point to your normal Firefox runtime.
       sed -i -e "s|%RUNTIME-PATH%|$FIREFOX_RUNTIME|" $HOME/.config/systemd/user/firefoxpwa-runtime-overlayfs.service
    6. Create an empty runtime directory mkdir -p $HOME/.local/share/firefoxpwa/runtime
    7. Install and enable the service systemctl --user enable --now firefoxpwa-runtime-overlayfs.service
    8. Check that the runtime overlay was installed correctly.
    9. Enable "Always patch runtime and profile" in the extension settings.
    10. Check https://pwasforfirefox.filips.si/help/faq

8. Lack of media codecs in some freshly insalled ubuntu-based distributions

I couldn't run videos on ubuntu 22.04. I followed the steps of this article.

Fix:

  1. Open a Terminal.
  2. Run sudo add-apt-repository multiverse to verify that the multiverse repository is enabled on your system.
  3. Run sudo apt update to update the package cache, note that Ubuntu does that automatically.
  4. Install the restricted-extras package based on your distribution:
    • sudo apt install ubuntu-restricted-extras
    • sudo apt install kubuntu-restricted-extras
    • sudo apt install lubuntu-restricted-extras
    • sudo apt install xubuntu-restricted-extras

9. Opening WPS gives an error message "Some formula symbols might not be displayed ..."

This is due to some fonts aren't available in the OS and the WPS expects them to be there.

Fix:

  1. Download the needed fonts from this repo.
  2. Create a folder in the system fonts directory to contain them: sudo mkdir /usr/share/fonts/wps-office.
  3. Run sudo chown -R $USER:$USER /usr/share/fonts/wps-office to set directory owner.
  4. Run sudo chmod -R o+rw,g+rw /usr/share/fonts/wps-office to set read and write permissions.
  5. Run sudo fc-cache -vfs.

9. No feedback is shown in the terminal while entering passwords

I need to enable password feedback for the command line interface so I can see something like ***** instead of nothing when typing in my password in any terminal

Fix:

  1. echo -e "# Enable password feedback\nDefaults pwfeedback" | sudo tee /etc/sudoers.d/pwfeedback
  2. sudo chmod 0440 /etc/sudoers.d/pwfeedback

Note that enabling pwfeedback is discouraged for security reasons, as it allows keyloggers to capture password length. You should only enable it if you understand the risk.


10. Scaling down a monitor that has small resolution

I'll rewrite how the os is scaling it through code as that can't be done using the settings app

Fix:

  1. At a terminal prompt enter: xrandr --listmonitors
    The output will look something like this:
    Monitors: 2
     0: +*eDP-1 1920/344x1080/193+0+0  eDP-1
     1: +DP-1 1440/410x900/257+1920+0  DP-1
    
  2. In the output the end bit is your video output. In my case it's DP-1 which has a ration 16:10.
  3. In a terminal enter: sudo nano /etc/xdg/autostart/.desktop
  4. Enter the below bit of info changing the DP-1 to what ever the output was from your system.
    [Desktop Entry]
    Type=Application
    Name=xrandr
    Exec=xrandr --output DP-1 --scale-from 1728x1080
    OnlyShowIn=GNOME;
    
  5. Reboot your system and you should be set.

Alternatively you can add xrandr --output DP-1 --scale-from 1728x1080 to your .zshrc or .bashrc files.

Note that these commands will work only in x11 environment, not wayland. Check the current environment using command echo $XDG_SESSION_TYPE.

Note that repositioning screens from the settings app may cause issues after this workaround, so you can use this command to reposition your screens:

  • To put DP-1 on the left of eDP-1: xrandr --output DP-1 --pos 0x0 --output eDP-1 --pos 1728x0
  • Change the x,y coordinates values of the previous command to match the needed setup
@ibnsamy96
Copy link
Author

Good to install:
sudo apt install -y zsh zenity htop fonts-firacode zsh-antigen fzf eza iotop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment