DEV Community

Ajeet Singh Raina
Ajeet Singh Raina

Posted on

How I cleaned up Jetson Nano disk space by 40%

I was trying to install NVIDIA DeepStream 6.0 on my tiny IoT Edge device - Jetson Nano but I hardly got 291 MB space left on my device.

 df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p1   15G   14G  291M  98% /
none            947M     0  947M   0% /dev
tmpfs           986M   40K  986M   1% /dev/shm
tmpfs           986M   44M  943M   5% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           986M     0  986M   0% /sys/fs/cgroup
tmpfs           198M   20K  198M   1% /run/user/1000
Enter fullscreen mode Exit fullscreen mode

I followed the below steps to free up some disk space in NVIDIA Jetson Nano:

Step 1. Update the existing repo

sudo apt update
Enter fullscreen mode Exit fullscreen mode

Step 2. Remove unnecessary packages

sudo apt autoremove -y
Enter fullscreen mode Exit fullscreen mode

Step 3. Clean up your repo

sudo apt clean
Enter fullscreen mode Exit fullscreen mode

Step 4. Remove Libreoffice related packages

sudo apt remove thunderbird libreoffice-* -y
Enter fullscreen mode Exit fullscreen mode

Step 5. Remove samples

sudo rm -rf /usr/local/cuda/samples \
/usr/src/cudnn_samples_* \
/usr/src/tensorrt/data \
/usr/src/tensorrt/samples \
/usr/share/visionworks* ~/VisionWorks-SFM*Samples \
/opt/nvidia/deepstream/deepstream*/samples

Step 6. Remove local repos

sudo apt purge cuda-repo-l4t-local libvisionworks-repo -y
sudo rm /etc/apt/sources.list.d/cuda*local
/etc/apt/sources.list.d/visionworks*repo*
sudo rm -rf /usr/src/linux-headers-*

Step 7. Remove GUI

sudo apt-get purge gnome-shell ubuntu-wallpapers-bionic light-themes chromium-browser* libvisionworks libvisionworks-sfm-dev -y
sudo apt-get autoremove -y
sudo apt clean -y

Step 8. Remove static libs

sudo rm -rf /usr/local/cuda/targets/aarch64-linux/lib/.a \
/usr/lib/aarch64-linux-gnu/libcudnn
.a \
/usr/lib/aarch64-linux-gnu/libnvcaffe_parser*.a \
/usr/lib/aarch64-linux-gnu/libnvinfer*.a \
/usr/lib/aarch64-linux-gnu/libnvonnxparser*.a \
/usr/lib/aarch64-linux-gnu/libnvparsers*.a

Woah! I was able to install NVIDIA DeepStream 6.0 on my 16GB SD card.

Top comments (0)