The cleanest possible reinstall of an app

Hi,

After a certain rash experiment (hyprland installation) I lost a great deal of normal functionality with my Plasma desktop. Reinstalling all the packages helped a lot:

$ sudo pacman -Qqn | sudo pacman -S -

Unfortunately, some minor (configuration?) issues remain. Among them, Gnome app theming, and, specifically, Foliate reader. The latter just fails to start. Probably, GUI failure: I can see foliate on the system monitor, I can kill it, but no more. I tried

$ yay -Rsn foliate
...
$ yay -S foliate

without success. What else can I do?

1 Like

Look for cache or configuration files in your HOME.

Pacman will not touch your HOME by default, so any files left there are up to you to manage.

1 Like

No trace of foliate either in ~/.config or in ~/.local/share. What then? The Foliate is installed now.

~/.local/share> yay -Ql foliate
foliate /usr/
foliate /usr/bin/
foliate /usr/bin/foliate
foliate /usr/share/
foliate /usr/share/applications/
foliate /usr/share/applications/com.github.johnfactotum.Foliate.desktop
foliate /usr/share/com.github.johnfactotum.Foliate/
foliate /usr/share/com.github.johnfactotum.Foliate/com.github.johnfactotum.Foliate.gresource
foliate /usr/share/glib-2.0/
foliate /usr/share/glib-2.0/schemas/
foliate /usr/share/glib-2.0/schemas/com.github.johnfactotum.Foliate.gschema.xml
foliate /usr/share/icons/
foliate /usr/share/icons/hicolor/
foliate /usr/share/icons/hicolor/scalable/
foliate /usr/share/icons/hicolor/scalable/apps/
foliate /usr/share/icons/hicolor/scalable/apps/com.github.johnfactotum.Foliate.svg
foliate /usr/share/icons/hicolor/symbolic/
foliate /usr/share/icons/hicolor/symbolic/apps/
foliate /usr/share/icons/hicolor/symbolic/apps/com.github.johnfactotum.Foliate-symbolic.svg
foliate /usr/share/locale/
foliate /usr/share/locale/ar/
foliate /usr/share/locale/ar/LC_MESSAGES/
foliate /usr/share/locale/ar/LC_MESSAGES/com.github.johnfactotum.Foliate.mo
foliate /usr/share/locale/cs/
foliate /usr/share/locale/cs/LC_MESSAGES/
foliate /usr/share/locale/cs/LC_MESSAGES/com.github.johnfactotum.Foliate.mo
...

UPD
System monitor line on the invisible app looks like this:

foliate   /usr/bin/gjs-console -m /usr/bin/foliate

ls -al ~/.cache/
→ there is com.github.johnfactotum.Foliate

ls -al ~/.local/share/
→ there is com.github.johnfactotum.Foliate

This is foliate version 3.1.1 from the repos - not from AUR
yay can be used but an AUR helper is not needed - pacman is sufficient

starting it from terminal looks like this (in a VM)
foliate 
libEGL warning: DRI3: Screen seems not DRI3 capable
libEGL warning: DRI2: failed to authenticate
libEGL warning: DRI3: Screen seems not DRI3 capable
MESA: error: ZINK: vkCreateInstance failed (VK_ERROR_INCOMPATIBLE_DRIVER)
libEGL warning: egl: failed to create dri2 screen

(com.github.johnfactotum.Foliate:1791): Gtk-WARNING **: 08:25:08.980: Theme parser error: gtk.css:8086:10-13: Expected a valid color.

(com.github.johnfactotum.Foliate:1791): Gtk-WARNING **: 08:25:08.981: Theme parser error: gtk.css:8096:10-13: Expected a valid color.

(com.github.johnfactotum.Foliate:1791): Gtk-WARNING **: 08:25:08.981: Theme parser error: gtk.css:8101:10-13: Expected a valid color.

and then the program window opens

(X11 session - not Wayland)

Thanks! In the terminal, I’ve got an endless flow of

(com.github.johnfactotum.Foliate:36205): Gtk-WARNING **: 10:27:36.970: Unknown key gtk-modules in /home/alexey/.themes/Catppuccin-Mocha/gtk-4.0/settings.ini

(com.github.johnfactotum.Foliate:36205): Gtk-WARNING **: 10:27:36.979: Unknown key gtk-modules in /home/alexey/.themes/Catppuccin-Mocha/gtk-4.0/settings.ini

No program window, unsurprisingly. This gtk thing is a leftover from Hyprland, sure. What can I do about it?

~/.local/share> yay -Ss foliate
aur/foliate-2 2.6.4-3 (+3 0.01)
    Version 2 of Foliate: A simple and modern GTK eBook reader
aur/foliate-git 2.6.4.r103.g1613ac8-2 (+11 0.01)
    Simple and modern GTK eBook reader
extra/foliate 3.1.1-1 (592.7 KiB 3.4 MiB) (Installed)
    A simple and modern GTK eBook reader
~/.local/share>

It’s Plasma on X11, now.

based upon the error messages, you should try setting another theme

It is a GTK app - there is some compatibility layer config to optically present GTK apps well in Plasma / QT environments.
Don’t know much about it. Never touched the defaults.

I have a Plasma VM as well - will see what it looks like there.

Result:
works just as well as the above install, which was done in Xfce4

No idea. :man_shrugging:
I get a warning as well - but it still works:

(com.github.johnfactotum.Foliate:1720): Gtk-WARNING **: 09:07:03.437: Unknown key gtk-modules in /home/jo/.config/gtk-4.0/settings.ini



I just removed it again (pacman -Rns foliate) - these where the packages that where installed with it:

Packages (13) bubblewrap-0.10.0-1  enchant-2.8.2-1  gjs-2:1.80.2-2  gtk4-1:4.14.5-1  harfbuzz-icu-9.0.0-1  hyphen-2.8.8-6  js115-115.15.0-1  libadwaita-1:1.5.4-1  libmanette-0.2.9-1  webkitgtk-6.0-2.44.4-1  woff2-1.0.2-5
              xdg-dbus-proxy-0.1.6-1  foliate-3.1.1-1

I haven’t got a warning. I got an endless burst of warnings, nothing else. Also, you probably have a vanilla gtk install, whereas I got something custom. Can I revert to vanilla without stumbling too much?

I tried it on an (almost) pristine installation of Xfce4
as well as on KDE/Plasma, also nearly pristine.
Both in separate VM’s.

It works flawlessly in both.

While it is pretty easy to go back to defaults, I don’t know how easily you’d stumble. :man_shrugging:

and: my method may not be the best - perhaps KDE (or Manjaro) has implemented a kind of “one click” solution to reset to defaults - I just don’t know.

I’d simply delete the ~/.cache and move ~/.config and ~/.local out of the way
and then copy the defaults from /etc/skel

But that needs to be done without the user session running,
so either logged out and from a TTY
or logged out of this user session and logged into a different user account.

… takes way longer to describe than to do it …

~> cd /etc/skel
/etc/skel> ls -a
.  ..  .bash_logout  .bash_profile  .bashrc  .config  .dir_colors  .Xclients  .xinitrc  .zshrc
/etc/skel> ls -a .config
.  ..  autostart  falkon  kdeglobals
/etc/skel>

I just refrained from messing with skel. Not right away :blush:

This hint from Arch Wiki works. The theme still doesn’t look like Adwaita, but the Foliate app starts, at least. Curiously, the warning message now looks exactly like yours:

~> GTK_THEME=Adwaita:dark foliate

(com.github.johnfactotum.Foliate:3170): Gtk-WARNING **: 17:35:37.840: Unknown key gtk-modules in /home/alexey/.config/gtk-4.0/settings.ini

The real solution is close :blush:

UPD

Sorry, it isn’t. The app isn’t functional. When I try to open a file, still the old messages:

(process:2): Gtk-WARNING **: 17:53:29.775: Unknown key gtk-modules in /home/alexey/.themes/Catppuccin-Mocha/gtk-4.0/settings.ini

You must have misunderstood me.
/etc/skel/* holds the default values - you do not “mess” with these files.
That is simply the blueprint of the default values.

You remove ~/.cache and move ~/.local and ~/.config in your $HOME directory - and replace it with what is in /etc/skel

But you can’t do it while logged in into your Plasma session.
This cannot be running when trying to replace these files.

Log out and in to a TTY to do it.

I always recommend “mc” (midnight commander) as a file manager - no need for using the command line then.

sudo pacman -S mc

I don’t much like Wikipedia - but it has good description and pictures of it.

Midnight Commander - Wikipedia



a sequence of actions and commands
log out of graphical session
then
CTRL+ALT+F4 to switch to TTY
log in
rm -rf ~/.cache
mv ~/.local ~/.local.bakup
mv ~/.config ~/.config.backup
cp -r /etc/skel/.config ~/

CTRL+d to log out again
ALT+left or right arrow until you arrive at the display manager again
where you log in normally and will find a default Plasma Desktop

if you don’t want to use the file manager recommendation

Is Foliate Electron based?
(I’m on a Mac currently, and can’t easily check).

I recall recently seeing a recommendation to update adwaita-icon-theme-legacy to version 46.2-3. This apparently solved a few theming related crashes recently. Here’s the Stable Update 2024-10-10 reference:

pacman -Qi adwaita-icon-theme-legacy

at the moment it looks like he just didn’t dare to:

:man_shrugging: which would result in a Plasma session just as it was when the system was freshly installed

None of the already installed programs would be negatively affected - just the UI would be in a “ground state”.
(yes, I did test it)

Yes, that’s one way.

Have you tried running the app in another User account yet for comparison? See what error (if any) exists in a new account.

I tried to follow your advice, with one reservation: I didn’t touch ~/.local, because it contains 6.5GB and I can’t believe that “moving” isn’t lethal. Besides, there’s nothing .local in /etc/skel. Of course, I’m open to discussion :blush:

What I actually did:

  1. Reboot, but instead of logging in again, Ctrl+Alt+F3
  2. In console:
> rm -rf ~/.cache
> cp -R ~/.config ~/.config.old
> cp -R /etc/skel/.* ~
> sudo shutdown -r now

Nothing much as a result. Of course, I lost come configs, which is no big deal, because I can easily revert to my dotfiles. My problem remains in place: all the toxic gnome/gtk settings are there.

Will you please publish your successful manipulations line by line?

First of all:
you didn’t and wouldn’t lose anything when following my example.

I did recommend using a file manager like mc - because you can more easily actually see what you are doing while in TTY.

Deleting the ~/.cache does no harm at all.
And the rest → ~/.config and ~/.local was moved in my example → not deleted, but just renamed, if you will
It will all still be there and can be reverted just as easily.

But you decided to not move ~/.local - because it apparently contains a lot of stuff.
That should be fine - but the stated goal was to reset the Desktop to it’s default.
~/.local isn’t part of that as you correctly saw

mv ~/.local ~/.local.backup
can be reverted by:
mv ~/.local.backup ~/.local
or just by:
cp -R ~/.local.backup ~/.local

You also did substantially change the commands I gave as an example.
For instance this:
cp -R /etc/skel/.* ~
which I gave as this:
cp -r /etc/skel/.config ~/
the effect of which is that you not only copied /etc/skel/.config
but everything in /etc/skel including all the dotfiles there
but that will do no harm

Also you used:
cp -R ~/.config ~/.config.old
… instead of:
mv ~/.config ~/.config.old)

which does just that - you now have a copy, but the original is still in place.

That is where all the “toxic” dotfiles come from - you never removed them.

I already did.

So my only real omission is leaving the original ~/.config in place. What I did next:

> rm -rf ~/.cache
> rm -rf ~/.config
> cp -R /etc/skel/.* ~
> sudo shutdown -r now

On boot I got a black “no signal” monitor. Ctrl+Alt+F3 worked; having put back the backup ~/.config, I’m here again…

… have got no time now - later …

Waiting… :smiley_cat:

I asked this earlier, but you either missed or ignored it:

Have you tried running the app in another User account yet for comparison? See what error (if any) exists in a new account.

Forgive me if I’ve lost track of the issue;
It seemed to concern Foliate, at one point.

I’m the only user here. Besides, it isn’t really a problem with Foliate only: all the gnome/gtk settings are skewed, Foliate just didn’t survive it.