Steps to rebuild plasma configs and cache on plasma desktop package update

update
plasma

#1

There has been multiple forum posts from Manjaro KDE users regarding Plasma desktop stability after Plasma desktop update

For example upgrading from Plasma 5.9 to 5.10 causing plasma desktop to lag or plasmashell crash, desired settings not applying under system settings or happen to be unavailable or disabled.

Same principle applies to point release upgrades. eg from 5.10 --> 5.10.1 --> 5.10.2

Inorder to fix such upgrade issues execute steps detailed below to backup existing plasma configs and cache. Thereafter reboot and login for default configs to take effect and rebuild plasma cache.

To backup existing plasma config.

cd ~/.config
for j in plasma*; do mv -- "$j" "${j%}.bak"; done

To backup existing cache

mv ~/.config/Trolltech.conf ~/.config/Trolltech.conf.bak
mv ~/.cache/ ~/cache.bak
mkdir ~/.cache
kbuildsycoca5 --noincremental && kbuildsycoca4 --noincremental

Note: ~/.cache directory also contains cache for non plasma applications.
For eg. pacaur would maintain git clone under ~/.cache. For such applications u need to one by one copy respective folders and files to new ~/.cache directory after reboot.

Remember not to copy plasma specific files and ksycoca from ~/cache.bak to new ~/.cache.
Just incase if you happen to do so dolphin would prompt you to confirm overwriting existing files.
Suggest to cancel copy process, else again old cache would take effect.

Later if required u can delete remaining .bak files and directories once manjaro KDE desktop is running without any issues.

For KDE issues not resolved even after resetting configs and rebuilding plasma cache create a forum post and if required report upstream to KDE Bugzilla.


Plasma can't remember favorites
KWin Regression in "[Stable Update] 2018-04-14"
Kde reset
KWin Regression in "[Stable Update] 2018-04-14"
Root '/' and '/home' become 'read only'
[Testing Update] 2017-06-28 - Kernels, Cinnamon, Deepin, Calamares, Plasma 5
[Stable Update] 2017-11-16 - Kernels, Mesa, KDE Apps, KDE Framework, LibreOffice, Cinnamon
Plasma - icons are broken all over
#2

Hello. This looks amazing, thank you - i have never heard of this technique before. Two questions please:

  1. My separate /home is LUKS-encrypted [but / is unencrypted]. Does this matter wrt your procedure?

  2. Here is the contents of my ~/.cache. Is it really important that i bother copying across everything [non-Plasma i mean] from here, afterwards? Lots of these things look non-critical to me, ie, i hope that not bothering to restore them afterwards would not actually matter…?

[kdemeoz@GA-Z97-HD3-Tower ~]$ cd /home/kdemeoz/.cache
[kdemeoz@GA-Z97-HD3-Tower .cache]$ ls -ga
total 138208
drwxr-xr-x 54 kdemeoz     4096 Apr 15 21:48  .
drwx------ 85 kdemeoz     4096 Apr 16 17:05  ..
drwxr-xr-x  2 kdemeoz     4096 Dec 30 16:03  akonadi_ical_resource_0
drwxr-xr-x  2 kdemeoz     4096 Apr 16 18:57  akonadi_kalarm_resource_0
drwxr-xr-x  2 kdemeoz     4096 Apr 16 17:19  akonadi_kalarm_resource_1
drwxr-xr-x  2 kdemeoz     4096 Dec 13 22:22  akonadi_kalarm_resource_2
drwx------  2 kdemeoz     4096 Jan 30 16:16  babl
drwxr-xr-x  2 kdemeoz     4096 Dec 10 02:18  calibre
drwxr-xr-x  4 kdemeoz     4096 Mar  1 12:28  cantata
drwx------  4 kdemeoz     4096 Jan 29 20:10  champlain
drwx------  3 kdemeoz     4096 Dec 10 19:48  chromium
drwxr-xr-x  4 kdemeoz     4096 Dec  9 15:44  dolphin
-rw-r--r--  1 kdemeoz    12288 Apr 16 16:04  event-sound-cache.tdb.767768ed550c47be8b6ddf861e71e3bf.x86_64-unknown-linux-gnu
drwx------  8 kdemeoz     4096 Jan 29 20:05  evolution
drwx------  3 kdemeoz     4096 Jan 29 20:05  folks
drwxr-xr-x  2 kdemeoz     4096 Apr 15 20:04  fontconfig
drwx------  3 kdemeoz     4096 Jan 30 16:14  gegl-0.2
drwx------  2 kdemeoz     4096 Jan 29 20:07  geocode-glib
drwxr-xr-x  2 kdemeoz     4096 Dec 10 03:41  g-ir-scanner
drwxr-xr-x  2 kdemeoz     4096 Apr 15 10:06  gstreamer-1.0
-rw-r--r--  1 kdemeoz 10547304 Apr 16 21:33  icon-cache.kcache
drwxr-xr-x  3 kdemeoz     4096 Dec 10 13:27  indicator-sensors                                                                                       
drwxr-xr-x  3 kdemeoz     4096 Dec  9 21:01  kcmshell5                                                                                               
drwxr-xr-x  3 kdemeoz     4096 Jan  2 15:42  kgpg                                                                                                    
drwxr-xr-x  4 kdemeoz     4096 Dec 10 18:26  khelpcenter                                                                                             
drwxr-xr-x  3 kdemeoz     4096 Jan  2 11:37  kinfocenter
drwxr-xr-x  2 kdemeoz     4096 Dec  9 21:15  kio_http
drwxr-xr-x  3 kdemeoz     4096 Apr 11 16:24  krita
drwxr-xr-x  3 kdemeoz     4096 Dec  9 15:43  krunner
drwxr-xr-x  3 kdemeoz     4096 Dec  9 21:11  kscreenlocker_greet
drwxr-xr-x  3 kdemeoz     4096 Dec  9 17:03  ksmserver-logout-greeter
drwxr-xr-x  3 kdemeoz     4096 Dec 11 09:53  ksmserver-switchuser-greeter
drwxr-xr-x  3 kdemeoz     4096 Dec  9 15:43  ksplashqml
-rw-r--r--  1 kdemeoz  1974321 Apr 11 16:30 'ksycoca5_en-AU_0DdpIWNqhkxhU7u_kfBM4q_ZhdY='
-rw-r--r--  1 kdemeoz  1934801 Dec 31 18:48 'ksycoca5_en-AU_aema2Lp7MGBzH6csDgj9hH8xG_Y='
-rw-r--r--  1 kdemeoz  1973646 Apr 14 23:01 'ksycoca5_en-AU_UDY7yo3bWfsY8yrcXjLzk4ko3tc='
-rw-r--r--  1 kdemeoz  1974297 Apr  9 10:49 'ksycoca5_en_UDY7yo3bWfsY8yrcXjLzk4ko3tc='
drwxr-xr-x  2 kdemeoz     4096 Dec 16 17:37  kup
drwxr-xr-x  3 kdemeoz     4096 Dec  9 17:04  kwin
drwx------  3 kdemeoz     4096 Dec 31 12:28 'moonchild productions'
drwx------  3 kdemeoz     4096 Dec  9 21:15  mozilla
drwx------  5 kdemeoz     4096 Dec 31 12:31  netsurf
drwx------  2 kdemeoz     4096 Dec  9 15:43  obexd
drwx------  3 kdemeoz     4096 Jan 29 20:08  org.gnome.Maps
-rw-r--r--  1 kdemeoz 10547304 Feb 20 19:26  org.kde.dirmodel-qml.kcache
drwxr-xr-x  6 kdemeoz     4096 Feb 22 18:48  plasmashell
-rw-------  1 kdemeoz     2544 Mar  9 13:33  plasma-svgelements-air_v1.2
-rw-------  1 kdemeoz    44442 Mar  9 13:33  plasma-svgelements-breath_v0.2.0
-rw-------  1 kdemeoz     3440 Mar  9 13:33  plasma-svgelements-breeze-dark_v5.30
-rw-------  1 kdemeoz     3440 Mar  9 13:33  plasma-svgelements-breeze-light_v5.20
-rw-------  1 kdemeoz     3440 Mar  9 13:33  plasma-svgelements-default_v5.30
-rw-------  1 kdemeoz    91964 Apr 15 21:48  plasma-svgelements-oxygen_v1.0
-rw-r--r--  1 kdemeoz 16875624 Mar  9 13:31  plasma_theme_air_v1.2.kcache
-rw-r--r--  1 kdemeoz 16875624 Mar  9 13:31  plasma_theme_breath_v0.2.0.kcache
-rw-r--r--  1 kdemeoz 16875624 Mar  9 13:31  plasma_theme_breeze-dark_v5.30.kcache
-rw-r--r--  1 kdemeoz 16875624 Mar  9 13:31  plasma_theme_breeze-light_v5.20.kcache
-rw-r--r--  1 kdemeoz 16875624 Mar  9 13:31  plasma_theme_default_v5.30.kcache
-rw-r--r--  1 kdemeoz 16875624 Apr 16 21:25  plasma_theme_oxygen_v1.0.kcache
-rw-r--r--  1 kdemeoz 10547304 Apr  1 18:24  plasma_wallpaper_preview.kcache
-rw-r--r--  1 kdemeoz   165196 Dec  9 15:44  qt_compose_cache_little_endian_767768ed550c47be8b6ddf861e71e3bf
-rw-r--r--  1 kdemeoz   165196 Dec  9 21:21  qt_compose_cache_little_endian_GA-Z97-HD3-Tower
drwxr-xr-x  3 kdemeoz     4096 Dec 10 03:26  shutter
drwx------  3 kdemeoz     4096 Apr 11 16:40  simple-scan
drwx------  3 kdemeoz     4096 Dec 30 10:52  slimjet
drwxr-xr-x  3 kdemeoz     4096 Dec 31 11:31  spectacle
drwx------  2 kdemeoz     4096 Dec 28 20:39  stardict
drwxr-xr-x  5 kdemeoz     4096 Dec  9 17:23  systemsettings
drwxr-xr-x  3 kdemeoz     4096 Dec 23 17:34  TeamViewer
drwxr-xr-x  4 kdemeoz     4096 Dec  9 15:47  thumbnails
drwx------  3 kdemeoz     4096 Dec 28 17:21  thumbnail.so
drwx------  3 kdemeoz     4096 Dec 10 01:57  thunderbird
drwxr-xr-x  2 kdemeoz     4096 Apr 15 21:44  tracker
drwx------  3 kdemeoz     4096 Dec 10 01:21  vivaldi
drwx------  3 kdemeoz     4096 Dec 10 01:28  vivaldi-snapshot
drwxr-xr-x  3 kdemeoz     4096 Dec 14 20:16  winetricks
drwxr-xr-x  3 kdemeoz     4096 Jan  4 13:57  yakuake
[kdemeoz@GA-Z97-HD3-Tower .cache]$ 


#3

By definition, cache is just temporary for avoiding multiple rewrites to the disk.
So, even if you don’t restore any of the backed up files, the apps should re-create it when they need it.
I am not sure for plasma, since it has those specific commands, coming from upstream, but it should do it as well IMO.
Clearing cache is a good measurer to overcome update glitches for several/all kinds.


#4

Only if non kde application settings are reset to default then u might need to restore from backup or better approach wud be to again apply desired settings / configuration in the application itself.

Ideally application store settings under .config or .local and not .cache

Wrote this post as overcautious user to avoid any hiccups if i run into login issues after knocking off .cache directory.

As mentioned in the post pacaur as default behavior uses .cache directory to clone git directories for aur packages and saves built packages in there so just deleting .cache wud mean losing all packages. U need to decide for urself by inspecting subdirectories under .cache after relogin


#5

To best of my knowledge before login home is decrypted and then mounted and steps mentioned in post is executed after login hence this shud not matter.

Pls do research regarding partition decryption during boot / after login for kde.


#6

Does anyone know of a comprehensive backup script for important system config files. I hate having to manually create .bak versions manually.


#7

That is exactly what i had believed up to this point, hence i’d never imagined that the ~/.cache directory contained anything important [i do not use _pacaur_].


#8

As per other posts today [in my KWin Regression in "[Stable Update] 2018-04-14"], unless anyone is able to discover some root cause in the logs i posted, then it would appear that i would have to prepare to apply your suggestion soon. Before i do, i prefer to have at least a slight understanding of what is supposed to happen.

I read the man page for the for function, & i understand it in broad concept, however your specific command string to be executed in the ~/.config directory is beyond my understanding. Can you please summarise in a few words what it will do? What is the significance of “j” [is it some special function]? My best guess is that this will basically rename any directory or file within the ~/.config directory that incorporates “plasma” in its name, to append “.bak”. Presumably the entire idea is that the reboot will then regenerate brand new virgin versions of each of those.

Does it mean then that my primary user account will lose ALL my detailed Plasma personalisations… eg, fonts, colours, styles, Applications Menu customisations, Desktop Effects, Hot Corners & Edges, Wallpapers, Activities… basically everything? That’s a fairly unappetising prospect… What happens to my secondary user account; does it get obliterated, or do i also have to repeat these steps later when logged into it?


#9

Yes thats exactly the purpose of find command mentioned in the post. But u wud have ur .bak files to revert back ur settings if desired. This will only affect the logged in user account. Secondary user account remains untouched unless same steps are executed after logging into secondary account.

I wud suggest first execute following steps and reboot.


mv ~/.config/Trolltech.conf ~/.config/Trolltech.conf.bak
mv ~/.cache/ ~/cache.bak
mkdir ~/.cache
kbuildsycoca5 --noincremental && kbuildsycoca4 --noincremental

If problem still persists then execute all steps mentioned in the post i.e clear and rebuild cache + configs. Then reboot.


#10

Read following blog post (Refer step 1 for rsync command example for creating backup) Do read manpage for rsync to validate the options applied to rsync.

https://veilofmaya.vivaldi.net/linux-spring-cleaning-pt1software/


#11

Thank you. Maybe i will apply your method initially within today’s temporary TEST account i created KWin Regression in “[Stable Update] 2018-04-14”, given that you’ve explained the changes occur only on a per-account basis. This way i can safely do it in TEST, observe the results [not having personalised this, i don’t really care what happens in it], then re-run my “crash test” in this “reset” account. If the crash no longer occurs then i can confidently apply the method to my real accounts. Conversely if this does not solve the problem then i would not have reset my real user accounts for no reason.


KWin Regression in "[Stable Update] 2018-04-14"
#12

I wrote this post after reading
https://wiki.archlinux.org/index.php/KDE#Troubleshooting

Also refer to Kwin subsection on arch wiki (URL pasted below). Run the command before and after reproducing ur issue. capture both the output and attach to ur bugreport on bugs.kde.org

https://wiki.archlinux.org/index.php/KDE#Getting_current_state_of_KWin_for_support_and_debug_purposes

Suggestions:

  1. If temporary test account created after upgrade and problem is already non-reproducible then plasma configs or cache must be the problem.

  2. If temporary test account created after upgrade and problem is persistent, then plasma configs and cache must not be the problem since upon first login to new account clean configs and cache are generated.

I am guessing this cud be a plasma widget u might have installed which is crashing in background or a known bug with Kwin.

Also refer to following bug reports from kde bugzilla

https://bugs.kde.org/show_bug.cgi?id=345532

https://bugs.kde.org/show_bug.cgi?id=298671

https://bugs.kde.org/show_bug.cgi?id=311505

https://bugs.kde.org/show_bug.cgi?id=368847


KWin Regression in "[Stable Update] 2018-04-14"
#13

As far as pacaur you still dont need it unless you care about having access to cached package builds.
The similar is true for other application caches.
IE - not very important, unless for some reason you rely on those caches… like losing your ‘recent files’ list from VLC or something similar.
Like, if you wanted all previously installed packages in pacmans cache you would need to copy /var/cache/pacman/pkg/ … but you only need that for downgrading packages locally… and if you have a reason to need that, you probably would know.


#14

sudo pacman -Rs –noconfirm $(pacman -Qqdt)

egh … I would suggest not using --noconfirm when removing packages in general … but certainly not for newbies … unless it is more important to avoid questions like ‘should I say yes or no?’ than to avoid breakage…

Also an ‘n’ there will remove config files aswell… so a better command might be

sudo pacman -Rns $(pacman -Qqdt)


#15

Theres really no need as there are full fledged utilities, like the mentioned rsync. Unless you want to make a tiny one yourself because you have specific needs… but that would probably still deploy either simple commands or utilities - just whipped up to your version of perfection, with some added sprinkles to save time.

For example… if we wanted to automate the process above we would make a script like this:
(notice though, the examples of these arent ‘system files’ so much as they are ‘user’ files)

https://pastebin.com/xL9d88rN
[///Note:
to use it … save it into a file like kde-bakkedup.sh
then make it executable with
chmod +x kde-bakkedup.sh
then you can run it with
./kde-bakkedup.sh
EndNote///]

I’ll leave this classic-looking guide here:
http://tldp.org/LDP/Bash-Beginners-Guide/html/


#16

Ya I know I can script whatever I want, just being lazy. Thanks.


#17

sudo pacman -Rns $(pacman -Qqdt)

Oops i always run this after applying update upon system reboot.

@kdemeoz what is the output of the command mentioned above.


#18

Oh no, i have not done any of your procedure here after all. As i wrote on the parallel thread KWin Regression in "[Stable Update] 2018-04-14", i realised there is no point, once i saw your:


#19

I meant output of

sudo pacman -Rns $(pacman -Qqdt)

may be u have unwanted packages installed which might cause weird issues


#20

Yes i knew you were asking me to run that command, but i misunderstood that maybe you thought i had already performed your full procedure, ie, i mistakenly thought that command was only relevant for me IF i had earlier done your procedure [which as i mentioned, is not now applicable].

Please tell me… is this command going to initially list any orphaned packages, giving me a chance to abort, or is it going to simply delete everything it finds immediately? I do not want to inadvertently destroy my system, that would be a much worse outcome than the current status.