Score:0

Snap and System broken

au flag

As I was running low on space I tried to move my snap to another disk following the answer from Muhammad here: Move snap packages to another location/directory

It broke everything and I cant get it back... I tried running several times the steps to revert but nothing works. Please help me, I am new to Ubuntu and it feels like my system is broken...

This is what I ran initially:

#Stop auto-updating (will *not* crash snaps already open)
sudo systemctl mask snapd.service
sudo systemctl stop snapd.service
sudo systemctl disable snapd.service

#Copy the data
sudo rsync -avzP /var/lib/snapd/  /mnt/EC89002B88FFF246/Ubuntu/snap/snapd/

#Do backups
sudo mv /var/lib/snapd /var/lib/snapd.bak
sudo cp /etc/fstab /etc/fstab.bak

#Change fstab (Change $USER with your name or change the path totally)
echo "/mnt/EC89002B88FFF246/Ubuntu/snap /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 /var/lib/snapd.bak
else
    echo "WARNING : Re-mounting snapd folder failed, please revert !!!!! "
    echo "WARNING : Re-mounting snapd folder failed, please revert !!!!! "
    echo "WARNING : Re-mounting snapd folder failed, please revert !!!!! "
    echo "WARNING : Re-mounting snapd folder failed, please revert !!!!! "
    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 "Files located at ~/snap/snapd should be removed, but are kept for
    recovery until you, manually reboot the system and make sure the service
    is running correctly. Then you can manually remove the folder ~/snap/snapd
    !!!!!!!!!!!!!!, you should do that manually."

fi

#Restart auto-updating
sudo systemctl unmask snapd.service
sudo systemctl start snapd.service
sudo systemctl reenable snapd.service

I am not expert but it seems like it did not restore properly var/lib/snap: Disk Analyzer output

Please help me

uz flag
Jos
At what point did it go wrong, and what was the error message?
David avatar
cn flag
That link says to move snap apps not the snap environment which you can not do. If you want a stable OS and the quickest fix reinstall.
Josselin Somerville avatar
au flag
Is there a way to revert snap and then I would reinstall all the apps I use? Right now, here are the problems: - It takes even more storage (probably the backups but I am afraid to delete anything now). I have only 700MB left which was not the case before - None of the snap apps work correctly - When I boot, I see a bunch of [FAILED] such as core18 (there are many of FAILED). I know that it was a snap-installed app.
Josselin Somerville avatar
au flag
If I want to reinstall snap from scratch, can I just deletee every folder related to snap and then run: `sudo apt update` `sudo apt install snapd` `sudo snap install snap-store` Are they any necessary files on snap for my system? If not, why do I see some fails when I boot my system?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.