Playing the online game, Forge of Empires, I get the notice to clear cache. This is run in Chromium Browser on my Raspberry Pi 4 b 4Gb running Raspberry OS 32 bit.


First, you will need a script to clear your history/cache. This one is a good example, but it is written for Windows, so you will need to modify it to use bash and to use the paths for where Chromium is installed on your pi.

Next, you will need a way to run the script every time your pi starts. There are many ways to do this, one of which is crontab:

sudo crontab -e

@reboot /bin/bash /home/pi/script.sh &

| improve this answer | |

Raspberry Pi OS (32-bit) with desktop and recommended software. Image with desktop and recommended software based on Debian Buster.

Since it is Debian, you should look at /home/user/.cache directory.

I could find only two things connected to chromium on my debian based distributive:


So, you might add such strings in your /etc/rc.local boot file. If there is no one, you should create it.

# echo """
/bin/rm -fr /home/ubuntu/.config/chromium/
/bin/rm -fr /home/ubuntu/.cache/chromium/""" >> /etc/rc.local
/bin/chmod +x /etc/rc.local

Replace ubuntu with you username. You can find it by whoami

# /bin/whoami

Now, cache and config will be deleted automatically each boot time.

| improve this answer | |
  • Why do you talking about Ubuntu? The OP is using the Raspberry Pi OS. And please take note that using /etc/rc.local has limitations due to Compatibility with SysV. We have seen many problems here on this site using it. Following the recommendation of the developers from systemd you should avoid using it. – Ingo Aug 8 at 21:44
  • I'm using ubuntu - as a name of user, don't u see? I know about systemd, and as you can read from the documentation, such basic principals of initrc, like boot scripts are supported. Not only 4 compatibility, but as author of systemd mentioned - it will be supported for-ever. So, you always can use /etc/rc.local - on any systemd-based distros, just to deploy something very fast. I've only tried to show topic-starter, how it is easy to erase all chromium's settings and cache by 2 lines only.. – TorwaldzAlive Aug 9 at 14:50
  • With using /etc/rc.local you are wrong. Please read the link I have provided carefully, in particular the last sentence: "Note that there are some areas where systemd currently provides a certain amount of compatibility where we expect this compatibility to be removed eventually." – Ingo Aug 9 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.