GICT knowledge base
How to Clear Browser Cache and Application Data in Ubuntu: A Complete Walkthrough
Published
If you use Ubuntu as your daily driver – whether for work, study, or personal projects – your web browsers and applications quietly collect digital debris over time. Cached web files, cookies, leftover images, and old configurations can quietly pile up, taking precious disk space and sometimes causing odd behaviors or privacy concerns. Maybe a website isn’t loading quite right, or you’re running out of storage, or you want to wipe your tracks before passing your machine to someone else. Whatever the reason, knowing how to clear browser cache and application data on Ubuntu is an essential skill for every user.
This guide is designed for users of all levels. You’ll find clear explanations, step-by-step methods for all major browsers, tips for handling stubborn app data, and a few real-world troubleshooting scenarios. Whether you prefer using the graphical interface or rolling up your sleeves in the terminal, you’ll have everything you need to keep your system tidy and responsive.
Why Clearing Cache and App Data Matters
Modern browsers and apps cache images, scripts, stylesheets, and even whole websites locally as you use them. This cache speeds up browsing but, over time, can:
- Eat up gigabytes of storage
- Cause websites to display outdated content
- Result in login or session errors
- Store cookies and history that compromise privacy
- Sometimes make apps misbehave after updates
Clearing cache and application data gives you a fresh start, resolves odd bugs, and can even speed up your computer.
1. Clearing Browser Cache: Graphical (Point-and-Click) Method
Let’s start with the easiest way for most users: the browser’s built-in options.
a) Firefox
Steps:
- Open Firefox.
- Click the menu icon (three horizontal lines, top right).
- Select Settings.
- Go to Privacy & Security.
- Under Cookies and Site Data, click Clear Data…
- Check Cached Web Content (and Cookies and Site Data if you want to clear logins and site preferences).
- Click Clear and confirm.
- Bonus: Scroll further to History > Clear History to remove browsing history, download history, and more.
b) Google Chrome / Chromium / Brave / Microsoft Edge
All these browsers follow the same basic routine:
- Open the browser.
- Click the three dots (menu, top right).
- Go to Settings.
- Find Privacy and security in the sidebar.
- Click Clear browsing data.
- In the pop-up:
- Check Cached images and files.
- Optionally check Cookies and other site data, Browsing history, etc.
- Select your desired time range (choose “All time” for a thorough clean).
- Click Clear data.
Tip: For a quick shortcut, press Ctrl + Shift + Del in most browsers to jump straight to the clear data dialog.
2. Clearing Browser Cache and App Data from the Terminal
Sometimes, you need a deeper clean – maybe you’re troubleshooting profile corruption, trying to free up a lot of disk space, or can’t open the browser at all. This is where the command line shines.
Warning: Deleting profile folders will reset browsers to their initial state. Back up bookmarks, passwords, or extensions if you need them.
a) Firefox
Cache only:
rm -rf ~/.cache/mozilla/firefox/
Full profile reset (removes history, bookmarks, logins, extensions, etc.):
rm -rf ~/.mozilla/firefox/
b) Google Chrome / Chromium
Cache only:
rm -rf ~/.cache/google-chrome/
rm -rf ~/.cache/chromium/
Full profile/data wipe:
rm -rf ~/.config/google-chrome/
rm -rf ~/.config/chromium/
c) Brave
Cache:
rm -rf ~/.cache/BraveSoftware/
Full profile:
rm -rf ~/.config/BraveSoftware/
d) Microsoft Edge
Cache:
rm -rf ~/.cache/microsoft-edge/
Full profile/data:
rm -rf ~/.config/microsoft-edge/
e) Opera
Cache:
rm -rf ~/.cache/opera/
Profile:
rm -rf ~/.config/opera/
3. Clearing Application Cache and Data for Other Apps
Browsers aren’t the only culprits – other applications (Slack, VSCode, Spotify, Discord, etc.) also collect cache and config files.
a) Where Application Data Lives on Ubuntu
- Cache:
~/.cache/<appname>/ - Config:
~/.config/<appname>/ - Local data:
~/.local/share/<appname>/
b) How to Clean Up
To clear cache for a specific app (e.g., Slack):
rm -rf ~/.cache/Slack/
To reset all settings and user data (factory reset):
rm -rf ~/.config/Slack/
rm -rf ~/.local/share/Slack/
Note: Only delete config or data folders if you’re sure you don’t need to retain your settings, login info, or offline data. For most productivity apps, clearing only the cache is safe and often enough to fix glitches.
c) Bulk Cleaning
To clear all user cache (be cautious):
rm -rf ~/.cache/*
4. Advanced: Using BleachBit for System-Wide Cleaning
If you prefer a graphical, all-in-one tool, BleachBit is an excellent choice for Linux users, similar to CCleaner on Windows.
How to Install and Use BleachBit
- Install:
sudo apt install bleachbit - Launch BleachBit from your applications menu.
- Select browsers and applications you wish to clean (you’ll see options for Firefox, Chrome, system caches, logs, etc.).
- Review what will be deleted (BleachBit shows estimated space savings).
- Click “Clean” to begin.
- You can run BleachBit as your user (to clean your files) or with sudo (for system files like APT cache or logs).
Troubleshooting Tips and Real-World Scenarios
A website isn’t updating or looks broken after a change.
Clear your browser cache – either through the settings or by deleting the ~/.cache folder for your browser.
Chromium won’t launch, or crashes on startup.
Back up and remove ~/.config/chromium/ and ~/.cache/chromium/. Relaunch the browser – it will start fresh.
Running low on disk space, but can’t find large files.
Use ncdu ~, or check ~/.cache/, ~/.config/, and browser cache folders. You may be surprised how much space is reclaimed by deleting years’ worth of cached images and videos.
Need to erase all traces before handing over your laptop.
Clear all browser and app data for your user as described, log out, then use a tool like BleachBit for extra assurance.
Preventative Maintenance
- Make a habit of clearing cache monthly if you browse heavily or notice issues.
- Keep an eye on disk space with tools like
df -hor graphical disk usage analyzers. - Back up browser bookmarks and passwords with built-in export tools or sync features before any major wipe.
- Be cautious with app config and data folders – only delete what you’re sure you don’t want to keep.
FAQ
Will clearing the cache delete my saved passwords or bookmarks?
No, clearing only the cache does not affect passwords or bookmarks. But deleting the entire browser profile (~/.config/... or ~/.mozilla/...) will reset everything. Always back up first if unsure.
Do I need to close the browser before clearing cache via terminal?
Yes, always close browsers before deleting cache or config folders to avoid errors and ensure changes take effect.
Can I automate cache cleanup?
Absolutely! Use cron jobs or scripts to periodically clear cache folders, or use BleachBit’s command-line options for automation.
Conclusion
Clearing browser cache and application data is a straightforward, yet powerful, way to keep your Ubuntu system running at its best. Whether you’re troubleshooting, reclaiming disk space, or just practicing good digital hygiene, you now have the tools and knowledge to tackle browser and app clutter with confidence.
Remember: start with GUI tools for routine maintenance, dive into the terminal for deeper cleaning and troubleshooting, and always back up your data before a full reset. With these habits, you’ll enjoy a faster, more reliable, and more private Ubuntu experience – day after day.
Related guides
How to Set Up zram on a Small VPS
Configure zram on Ubuntu with kernel and swap checks. Understand compressed memory limits, monitor real use and avoid unsafe swap-file changes.
LinuxHow to Find Services That Need a Restart After Updates with needrestart
Find services using outdated libraries with needrestart on Ubuntu. Read restart reports, review automatic restart policy and plan maintenance safely.
LinuxHow to Limit a Linux Service’s Memory with systemd
Limit a Linux service with systemd MemoryHigh, MemoryMax and swap controls. Check cgroup support, diagnose pressure and remove only your own policy.
LinuxHow to Protect SSH with CrowdSec on Ubuntu
Protect SSH with CrowdSec on Ubuntu. Connect log detection to firewall enforcement and test temporary blocking without losing administrator access.
