############################################################################## # Take Care this section may break the System !!! ##############################################################################
# Move snap folder to Home instead of root
# Create the directory, you can change the location mkdir /home/$USER/snap/snapd
# Copy the data sudo rsync -avzP /var/lib/snapd/ /home/$USER/snap/snapd/
# Change fstab (Change $USER with your name or change the path totally) sudo echo"/home/$USER/snap/snapd /var/lib/snapd none bind 0 0" | sudo tee -a /etc/fstab
# remount fstab or reboot. sudo mkdir /var/lib/snapd sudo mount -a
if ls /var/lib/snapd/ | grep snaps then echo"Re-mounting snapd folder is done successfully !!!!" sudo rm -rf /etc/fstab.bak sudo rm -rf /var/lib/snapd.bak else echo"WARNING : Re-mounting snapd folder failed, please revert !!!!"
# trying to revert automatically sudo cp /etc/fstab.bak /etc/fstab
sudo mount -a sudo umount /var/lib/snapd
sudo mv /var/lib/snapd.bak /var/lib/snapd
echo"Revert automatically is done successfully !!!!"
fi ############################################################################## # Take Care the pervious section may break the System !!! ##############################################################################