Jetson nano: You don't have enough free space in /var/cache/apt/archives/

I flashed my 16 GB sandisk SD card with jetpack 4.4. Now whenever I try to install any package with apt-get, I get this error.

0 upgraded, 17 newly installed, 0 to remove and 32 not upgraded.
Need to get 1,242 kB of archives.
After this operation, 6,886 kB of additional disk space will be used.
E: You don't have enough free space in /var/cache/apt/archives/.

How can I resolve this issue? Should I use an external USB stick or memory device or use an SD card with more memory?

nabil@nabil:~$ df -h --total
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p1   15G   15G     0 100% /
none            1.8G     0  1.8G   0% /dev
tmpfs           2.0G  4.0K  2.0G   1% /dev/shm
tmpfs           2.0G  142M  1.8G   8% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs           397M     0  397M   0% /run/user/1000
total            23G   15G  7.8G  66% -

One thing I’d try first is:
sudo apt-get clean

Perhaps the cache just has a lot in it from past installs which you don’t need cached.

Installing a removable media where the package tool works is probably a bad idea. It is important to know that although this is where something being saved failed due to insufficient space, that this directory itself is not the cause. Run this command:
df -H -T -t ext4

This will show you that the rootfs is the only ext4 filesystem (unless you’ve modified something). The “/var” is a subset of “/”. Any space you can free will contribute to making more available for your own use.

In many cases you could mount something like a USB stick for the purpose you are thinking, but it is not wise to do so with part of the operating system. A more common use would be for example to use a USB thumb drive for “/home” or “/usr/local”, which will not leave the system unbootable or with a correct package database if you forget to plug it in.

1 Like

Excuse me. I have tried “sudo apt-get clean”. But it didn’t work. I still have disk full.
截屏2021-04-11 下午11.34.35

If you have serial console (or any other access), then it becomes a case of removing content you don’t need. In the case of non-package content, just file deletes. In the case of packages you don’t need, then via “sudo apt-get remove ...packagename...”. There are cases where package operations will need temp space, and so they might fail until you have released at least some space with file deletes.

If you happen to have a large file somewhere which you want to keep, and which does not normally get used, then you could temporarily compress the file (assuming temp space for compression is not needed), e.g., “bzip2 -9 ...somefile...”.

Thx. I just need to delete files in ./Trash folder(I used delete button to do removing instead of ‘rm’ command before.)