The error occurs because you're using a wildcard (cuda*) and the system is trying to match exact package names including .deb files which aren't actually installed packages.
Try these steps instead:
- First, list all installed CUDA packages:
dpkg -l | grep -i cuda
- Then remove the packages specifically:
sudo apt remove --purge cuda cuda-runtime-12-6 cuda-drivers
Or if you want to remove all CUDA-related packages at once, you can try:
sudo apt remove --purge "cuda*" "nvidia-cuda*"
If you also want to remove the CUDA repository:
sudo rm /etc/apt/sources.list.d/cuda*
After removal, update your package list:
sudo apt update
If you still have issues, you might need to remove packages one by one based on the output of the dpkg -l | grep -i cuda command.