I also ran into this issue. In my case the package names were `nvidia-driver-515-open` and `nvidia-dkms-515-open` so I changed `version = int(package_name.split('-')[-1])` to `version = int(package_name.split('-')[2])` and that worked for me (`sudo ubuntu-drivers install` ran to completion). Not sure if that is a robust solution as I don't know how consistent the package names are. Also I'm new here.
I also ran into this issue. In my case the package names were `nvidia- driver- 515-open` and `nvidia- dkms-515- open` so I changed `version = int(package_ name.split( '-')[-1] )` to `version = int(package_ name.split( '-')[2] )` and that worked for me (`sudo ubuntu-drivers install` ran to completion). Not sure if that is a robust solution as I don't know how consistent the package names are. Also I'm new here.