Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Editing the theme inside `gnome-shell-theme.gresource` prevented Ubuntu from starting

  1. #1
    Join Date
    Aug 2020
    Beans
    6

    Question Editing the theme inside `gnome-shell-theme.gresource` prevented Ubuntu from starting

    I was naively editing gnome-shell-theme.gresource while trying to edit the login/lock-screen background. The full path is given below:

    Code:
    /usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource
    More specifically I changed what was under the #lockDialogGroup section. This prevented my laptop from booting.


    If you run UBUNTU and have a moment: Could you please let me know what is under your #lockDialogGroup in both: /usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource and /usr/share/gnome-shell/theme/gnome-shell-classic.css (I made a change here to at one point but thought I successfully edited it back after it had no effect). This might save my bacon.


    When failing to boot the following would appear (basic terminal-like white text against black background, I can't recall the precise numbers):

    Code:
    /dev/sda2: clean 12345678/12345678 files 12345678/12345678 blocks
    Then, a graphically superior message comes up (grey text against a white background):

    Oh no! Something has gone wrong! A problem has occurred and the system can’t recover. Please contact a system administrator

    Using ctrl + alt + F3 I was able to login without a GUI, and undo the changes based on the contents of the same file. This was possible as I could boot another laptop from USB and select "Try Ubuntu", then just sudo nano path/to/gnome-shell-theme.gresource.

    This did not get me past the error...



    Some basic troubleshooting:

    I ran a bad blocks test to be safe, but it found no HDD failures.

    I booted in recovery mode and selected fsck but this occurs:

    Code:
    /lib/recovery-mode/recover-menu: line 80: /etc/default/rcS: No such file or directory
    fsck from util-linux 2.34
    /dev/sda2 is mounted
    e2fsck: Cannot continue, aborting.
    I also reinstalled GRUB from the Ubuntu on my USB just in case. This didn't seem to do anything.

    When I accidentally held F4 on boot in addition to the the /dev/sda2 message I am given two messages saying there is a problem loading x.509 certificates -65.



    Any ideas and indeed criticisms welcome. I would be particularly keen to know if I can reinstall EVERYTHING inside my /usr/share/gnome-shell/theme file. Can one reinstall the default OS theme from terminal? Thank you for reading the above, I did try to balance detail with brevity.
    Last edited by ajgreeny; August 28th, 2020 at 06:55 PM. Reason: Font normalised. Grammar was incorrect.

  2. #2
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    11,547
    Distro
    Ubuntu

    Re: Editing the theme inside `gnome-shell-theme.gresource` prevented Ubuntu from star

    You need to extract the css file from the gresource database file.
    Then edit the css file and rebuild the gresource file.
    Never edit the gresource file directly.
    Some help on how-to (hopefully) found here: https://askubuntu.com/questions/1227...n-ubuntu-20-04

    From my own experiences playing with this, make a backup copy somewhere first, before doing any editing or extracting.
    (Best to save it somewhere you have quick access to like your home /Documents folder.
    That way if you mess up (again) you can just copy back the riginal and try again later)


    That said, a quick fix to load a login screen would be to install lightdm and set it as the display manager.
    This will at least allow you to load the desktop.
    Should be able to switch to a tty session (ctl+alt+F2-8] and login there and run
    Code:
    sudo apt install lightdm
    type reboot to reboot and you should get the lightdm login screen, which should allow you to login.
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful
    .

  3. #3
    Join Date
    Aug 2020
    Beans
    6

    Exclamation Re: Editing the theme inside `gnome-shell-theme.gresource` prevented Ubuntu from star

    I installed lightd but for some reason after succesfully logging in (further progress than before) , I get the same crash error as before. Additionally, when I run the command

    Code:
     update-alternatives --config gdm3-theme.gresource
    unlike in the guide I am told there is only one gdm3 choice? I don't know if this constitues an issue.

    Furthermore, running
    Code:
    gresource extract /usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource /org/gnome/shell/theme/gdm3.css > $HOME/gdm3.css
    provides only a blank file when I try to open it with nano? Is this because nano wont open a css file? Do I desperately need a GUI?

  4. #4
    Join Date
    Aug 2020
    Beans
    9

    Re: Editing the theme inside `gnome-shell-theme.gresource` prevented Ubuntu from star

    Do you have the libglib2.0-dev package installed? It's needed to properly extract and pack .gresource files.

    I had an issue similar to this earlier, and I think the simplest way to fix the .gresource file is to grab the entire file from somewhere else like a live cd or by downloading the .deb of yaru-theme-gnome-shell (and manually extracting) replacing your .gresource file, then reboot.

  5. #5
    Join Date
    Aug 2020
    Beans
    6

    Re: Editing the theme inside `gnome-shell-theme.gresource` prevented Ubuntu from star

    You are correct but I don't know how best to aquire a functional copy of Yaru. Forgive my ignorance but I thought a copy might be available from GitHub. I only own one device so a total install of Ubuntu from which to copy is not feasible.

    And yes, libglib is definitely installed.

  6. #6
    Join Date
    Aug 2020
    Beans
    6

    Talking Re: Editing the theme inside `gnome-shell-theme.gresource` prevented Ubuntu from star

    Good lord your suggestion worked. Why did I not try this sooner??

    Code:
     sudo apt-get update
    Code:
     sudo apt purge yaru-theme-gnome-shell
    Then after seeing a related warning about Yaru NOT being deleted... (You will die you mutated abomination)

    Code:
    cd /usr/share/gnome-shell/theme/Yaru
    
    sudo rm -r Yaru
    Now for a fresh install...
    Code:
    sudo apt-get install yaru-theme-gnome-shell
    Restart using...
    Code:
    service gdm restart

    Done!

  7. #7
    Join Date
    Aug 2020
    Beans
    6

    Re: Editing the theme inside `gnome-shell-theme.gresource` prevented Ubuntu from star

    Oh God no, it didn't work, I am now stuck in a loop. Every time I login I go back to the login page!

  8. #8
    Join Date
    Aug 2020
    Beans
    9

    Re: Editing the theme inside `gnome-shell-theme.gresource` prevented Ubuntu from star

    First, try reinstalling gdm as well (sorry if it wasn't clear, but I meant downloading the .deb and only extracting the .gresource file). Also, try temporarily disabling your extensions in ~/.local/share/gnome-shell/.

  9. #9
    Join Date
    Aug 2020
    Beans
    6

    Red face Re: Editing the theme inside `gnome-shell-theme.gresource` prevented Ubuntu from star

    Thank you for your patience and sticking with me while I muddled through @cg-152. It's really good to know other people have set their minds to offering help when things aren't going well. I managed to fix the issue in the end.

    For anyone else who edits important files without backups....

    I found a way to undo this mess.

    Use ctrl + alt + F3 to access tty, basically interface with the computer without any GUI.

    Purge the mutilated version of gdm3 that is punishing its creator who made edits without a backup.

    Code:
         Sudo apt purge gdm3
    Go and delete your Yaru folder manually if it still exists. I got a message saying mine did.

    Code:
    cd /usr/share/gnome-shell/theme/
    
        ls
    Yup, damn thing was still there, clinging on for dear life.

    Code:
         sudo rm -r Yaru
    Install fresh gdm3

    Code:
         sudo apt install gdm3
    Code:
         sudo apt install-desktop-theme-minimal
    Start user interface by running...

    Code:
         startx
    Reconfigure gdm3

    Code:
         sudo dpkg-reconfigure gdm3
    The above only seemed to get me from a boot-loop to a login-loop so I also had to change some permissions...

    Code:
         sudo chmod a+wt /tmp
    Hopefully, you can now successfully login. And if you want to edit your login screen you can use [this script from thiggy01][1] instead of bricking your OS.


    [1]: https://github.com/thiggy01/ubuntu-2...gdm-background

  10. #10
    Join Date
    Aug 2020
    Beans
    9

    Re: Editing the theme inside `gnome-shell-theme.gresource` prevented Ubuntu from star

    Thanks for sharing the solution you found, good luck in changing your background!

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •