不知道大家有沒有這樣的經歷,刪除某個使用 GConf 的軟體后,通過 gconf-editor 你會發現在左側邊欄中與它相關的內容仍然存在。
比如我使用 Archlinux 安裝了 Compiz 后,它會在 GConf 的 /apps 中生成一些東東。刪除 Compiz 后那些東東還是存在於 GConf 中,雖然這不影響使用,但看著還是挺不舒服的。Archlinux 下安裝 iBus 然後卸載后也會出現這種情況。(呵呵,刪除 ~/.gconf 也不頂用)
通過 Goolge 搜索一番,找到 gconf-cleaner 這個軟體(呵呵,估計它已經處於半死不活狀態)。懷著試一試的心態 yaourt -S gconf-cleaner 安裝了這個軟體,可惜使用后還是不能解決上面的問題。
想一想,這種情況肯定是系統某處對那些東西進行了緩存,又 Goolge 之,終於找到一個方法可以解決上面出現的問題(可在 Archlinux 中使用,其他發行版也可,但需要自己更改相應路徑)。
方法如下:
#!/bin/bash rm /etc/gconf/gconf.xml.defaults/* export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` find /usr/share/gconf/schemas -name "*.schemas" | xargs \ /usr/bin/gconftool-2 --makefile-install-rule > /dev/null chmod 755 /etc/gconf/gconf.xml.system PID=`pidof gconfd-2` if [ ! -z "${PID}" ]; then kill ${PID} fi
使用 root 用戶運行上述 shell 即可。
[火星人 ] 刪除軟體后 GConf 中無用項的清理已經有413次圍觀