rpi-imager icon indicating copy to clipboard operation
rpi-imager copied to clipboard

Provide a simple way to delete cached image

Open ralphrmartin opened this issue 4 years ago • 17 comments

If you only want to use this to set up one Raspberry Pi, it makes no sense to keep the cached download, which can waste a significant amount of disk space. It is not obvious to users that the file is being cached - I assumed it would be deleted on exit (or perhaps be in /tmp). Please provide some simple user interface for deleting it, e.g. a checkbox "Remove download after installing".

ralphrmartin avatar Apr 13 '21 06:04 ralphrmartin

But if you only ever want to use it to setup that single Pi, does it make sense to keep Raspberry Pi Imager installed? The uninstaller does remove it... (at least on Windows. removing such files on multi-user systems like Linux do is problematic, as it lives in the home folder of each individual user that started it.).

I assumed it would be deleted on exit (or perhaps be in /tmp)

Technically the program does not need any temporary files to function. Can stream files from the Internet straight to SD card, uncompressing on the fly. Caching was added later.

Problem is the UI needs to beginner friendly, leaving out configurable options. It does disable caching automatically if you are low on disk space (if you have less than 5 GB + size of image).

maxnet avatar Apr 13 '21 11:04 maxnet

The standard, Apple way, to uninstall stuff on a Mac is to drag the application to the trash, so that won't delete the cache. It does not have uninstallers like Windows and Linux.

I hardly think it's going to confuse even beginners to say "Keep a copy of the downloaded Raspbian OS for further installations in future".

I'd say its even less friendly to silently waste a few GB, especially for users with small disks.

ralphrmartin avatar Apr 13 '21 13:04 ralphrmartin

The standard, Apple way, to uninstall stuff on a Mac is to drag the application to the trash, so that won't delete the cache.

Yeah, that do is a hard to solve problem.

Apple only cleans up properly for apps that come from Mac Store. But our application is not welcome there (they do not allow any applications that needs to do anything privileged there...)

maxnet avatar Apr 13 '21 14:04 maxnet

I can't actually find the cached image on my Mac.

Is there a standard location for the Rasperry Pi Imager to store images?

I agree with @ralphrmartin that even a simple delete cache on the UI would be helpful. I am said "beginner" on booting different images on to my pi.

Love the app so far tho.

alfieroddan avatar Aug 30 '21 18:08 alfieroddan

I think RPi Imager only caches the last-flashed image, so it doesn't matter if you flash multiple different images onto your SD card. (so I guess a sneaky way to reduce the amount of disk-space used by the cache would be to flash one of the smaller OSes? :wink: )

lurch avatar Aug 31 '21 11:08 lurch

I can't actually find the cached image on my Mac.

Menu "Go" -> "Go to Folder..." -> ~/Library/Caches/Raspberry Pi

maxnet avatar Sep 03 '21 13:09 maxnet

In Linux, you can simply select show hidden files and then open /home/user/.cache/raspberry pi and then simply delete the lastdownload zip file.

raisaab198 avatar Oct 03 '21 07:10 raisaab198

hello, I would like to erase the cache image, but I cannot find it under the "Caches" on macos

beckmx avatar Jan 06 '22 14:01 beckmx

hello, I would like to erase the cache image, but I cannot find it under the "Caches" on macos

Menu "Go" -> "Go to Folder..." -> ~/Library/Caches/Raspberry Pi

At least the "Raspberry Pi" folder should always exists there. If you cannot find a lastdownload.cache file under there, it do can be that there is no cached file. It only caches if there is at least 5 GB + "size of image" disk space available. Also if writing the image failed, the cached file is already deleted.

maxnet avatar Jan 06 '22 14:01 maxnet

@maxnet thanx, well I have 3gigs left but I used to have more before I flash the image, and the "rpi imager" says, "Cached on your computer" but no folder(not hidden) was there. I'll take ur answer as valid then

beckmx avatar Jan 06 '22 14:01 beckmx

Double check from terminal, just in case "Finder" is configured not to show certain files.

Maxs-Mac-mini:~ max$ ls -l ~/Library/Caches/Raspberry\ Pi
total 0
drwxr-xr-x  5 max  staff  160 21 dec 00:22 Imager
Maxs-Mac-mini:~ max$ ls -l ~/Library/Caches/Raspberry\ Pi/Imager
total 2350344
-rw-r--r--    1 max  staff  1203372157 21 dec 00:23 lastdownload.cache
drwxr-xr-x    4 max  staff         128 27 feb  2020 oslistcache
drwxr-xr-x  248 max  staff        7936 22 dec 19:40 qmlcache

Should also be able to elete from shell:

rm ~/Library/Caches/Raspberry\ Pi/Imager/lastdownload.cache

maxnet avatar Jan 06 '22 14:01 maxnet

Where does the imager store it's cached images on Linux ? Because I don't see any related directory/files in ~/.cache/

varac avatar May 31 '22 06:05 varac

It's in your home folder in .cache/rpi-imager

31.05.2022 08:44:31 Varac @.***>:

Where does the imager store it's cached images on Linux ?

— Reply to this email directly, view it on GitHub[https://github.com/raspberrypi/rpi-imager/issues/209#issuecomment-1141727816], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AOZQDD2FQA5RVKML2KRVSP3VMWYM5ANCNFSM422WBC5Q]. You are receiving this because you commented.[Verfolgungsbild][https://github.com/notifications/beacon/AOZQDD4L6HW5SJB6R2VOCVTVMWYM5A5CNFSM422WBC52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIQGWESA.gif]

raisaab198 avatar May 31 '22 20:05 raisaab198

In Linux, you can simply select show hidden files and then open /home/user/.cache/raspberry pi and then simply delete the lastdownload zip file.

Yeah that's great. You can do that in all OSs. But it would clearly be better for the the util provide a way to either

a) not cache; or b) delete the cached image itself

g4r37h avatar Jun 10 '22 17:06 g4r37h

Mildly amusing that this issue is asking for "less caching" and #300 is asking for "more caching" :wink:

lurch avatar Jun 11 '22 08:06 lurch

They are not mutually exclusive issues. Both point to the fact that the utility is lacking in functionality.

g4r37h avatar Jun 11 '22 09:06 g4r37h