5

I usually use Ubuntu tweak to do cleanup jobs on my PC. This includes apt and program cached data and old kernels. This goes alright for most programs except Mozilla based application - Firefox and Thunderbird.

Ubuntu tweak doesn't seem to know where their cache folders are and always returns 'zero packages can be cleaned' even when the cache folder is full. Check screenshot below:

Screenshot showing empty firefox and thunderbird cache folders

I am looking for a way to clean up ALL my cache data and unneeded packages at one point.

If someone knows how to change the ubuntu tweak cache folders for Firefox and Thunderbird, that would be perfect.

I tried bleachbit last but it crashed my PC to a point I had to re-install Ubuntu.
I am using Ubuntu tweak 0.8.6.

EDIT
Same issue with the screenshot of this question: Why isn't Ubuntu Tweak's Janitor working?

EDIT 2
For the python programmers out there, this answer shows the commands that Ubuntu tweak janitor runs to clean up the system. Maybe something in there will shed more light to this issue.

2
  • Which Ubuntu release and desktop you are using?
    – user.dz
    Feb 13, 2014 at 12:59
  • 1
    @Sneetsher Ubuntu 12.04, ubuntu tweak 0.8.6
    – Parto
    Feb 13, 2014 at 13:49

2 Answers 2

1
+50

As I tested Ubuntu Tweak 0.8.6 in Ubuntu 13.10. It seems that for both, late releases of Mozilla Firefox and Thunderbird moved their cache folders to ~/.cache. Profiles configuration kept in same place ~/.mozilla/firefox/profiles.ini and ~/.thunderbird/profiles.ini.

  • Firefox: ~/.mozilla/firefox/~/.cache/mozilla/firefox/

  • Thunderbird: ~/.thunderbird/~/.cache/thunderbird/

Quick patch:

sudo nano /usr/share/pyshared/ubuntutweak/janitor/mozilla_plugin.py

Add/Change all lines I include cache_path in them (3 new lines, 2 modified app_pathcache_path, keep app_path of the profiles.ini):

import os
import logging

from ubuntutweak.janitor import JanitorCachePlugin
from ubuntutweak.settings.configsettings import RawConfigSetting

log = logging.getLogger('MozillaCachePlugin')

class MozillaCachePlugin(JanitorCachePlugin):
    __category__ = 'application'

    targets = ['Cache',
               'OfflineCache']
    app_path = ''
    cache_path = ''

    @classmethod
    def get_path(cls):
        profiles_path = os.path.expanduser('%s/profiles.ini' % cls.app_path)
        if os.path.exists(profiles_path):
            config = RawConfigSetting(profiles_path)
            try:
                profile_id = config.get_value('General', 'StartWithLastProfile')
                for section in config.sections():
                    if section.startswith('Profile'):
                        relative_id = config.get_value(section, 'IsRelative')
                        if relative_id == profile_id:
                            return os.path.expanduser('%s/%s' % (cls.cache_path, config.get_value(section, 'Path')))
            except Exception, e:
                log.error(e)
                path = config.get_value('Profile0', 'Path')
                if path:
                    return os.path.expanduser('%s/%s' % (cls.cache_path, path))
        return cls.root_path


class FirefoxCachePlugin(MozillaCachePlugin):
    __title__ = _('Firefox Cache')

    app_path = '~/.mozilla/firefox'
    cache_path = '~/.cache/mozilla/firefox'

class ThunderbirdCachePlugin(MozillaCachePlugin):
    __title__ = _('Thunderbird Cache')

    cache_path = '~/.cache/thunderbird'
    app_path = '~/.thunderbird'

I filled an upstream bug report for this, See Cache path of Mozilla Firefox and Thunderbird changed to ~/.cache #24

enter image description here

2
  • You're a genius @Sneetsher. It worked.
    – Parto
    Feb 13, 2014 at 14:51
  • Happy to hear that, I will look if it can be fixed upstream. But it needs to be modified to check either Firefox version or if there any cache path settings. So it will works in all cases. Thank you.
    – user.dz
    Feb 13, 2014 at 15:15
-2

For firefox you could install firebug. Once firebug is installed into firefox you can do a:

ctrl shift del

This will bring up the clear history dialog which includes clearing cache. Giving you nice control over what you clear and what you don't. Here is a screenshot of the feature:

enter image description here

1
  • 1
    I know all about clearing the Firefox history from the clear history dialog but that's not what am looking for. It's just changing Ubuntu tweak's cache folder location for Firefox and Thunderbird so that I can clear ALL my cache at one point.
    – Parto
    Feb 8, 2014 at 17:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .