nvidia-340 dpkg: error: version '-' has bad syntax: revision number is empty

Bug #1853977 reported by Philippe Vaucher
64
This bug affects 13 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Confirmed
Undecided
Unassigned
nvidia-graphics-drivers (Ubuntu)
Confirmed
Undecided
Unassigned
nvidia-graphics-drivers-340 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Hello,

When installing `nvidia-340` there is an error is the postinst script:

philippe@pv-desktop:~$ sudo apt install --reinstall nvidia-340
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 to upgrade, 0 to newly install, 1 reinstalled, 0 to remove and 7 not to upgrade.
Need to get 0 B/51.9 MB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 309892 files and directories currently installed.)
Preparing to unpack .../nvidia-340_340.107-0ubuntu0.18.04.4_amd64.deb ...
Stopping nvidia-persistenced
nvidia-persistenced: no process found
Done.
(snip)
Setting up nvidia-340 (340.107-0ubuntu0.18.04.4) ...
dpkg: error: version '-' has bad syntax: revision number is empty
dpkg: error: version '-' has bad syntax: revision number is empty
update-initramfs: deferring update (trigger activated)
INFO:Enable nvidia-340
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
Loading new nvidia-340-340.107 DKMS files...
Building for 4.15.0-70-generic
Building for architecture x86_64
Building initial module for 4.15.0-70-generic
Done.

The comment at https://askubuntu.com/questions/969352/uninstalling-and-then-reinstalling-nvidia-384-kills-colord tells us that /var/lib/dpkg/info/nvidia-340.postinst has a typo: replace $KERNELS with $CURRENT_KERNEL then `dpkg-reconfigure nvidia-340` works as expected.

description: updated
description: updated
description: updated
description: updated
description: updated
description: updated
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1853977

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nvidia-graphics-drivers (Ubuntu):
status: New → Confirmed
Revision history for this message
Wowbagger (ha87psc02) wrote :

This is a stupid uninitialized variable error in the postinstall script:

case "$1" in
    configure)
        # Added manually, since we mangled the arguments, and dpkg-maintscript-helper
        # won't work
        if [ -n "$2" ] && `dpkg --compare-versions "$2" lt "340.106-0ubuntu5"`; then
            rm -f /etc/modprobe.d/nvidia-340.conf
        fi
        CURRENT_KERNEL=$(uname -r)
        NEWEST_KERNEL=$(get_newest_kernel "$KERNELS")

Variable "KERNELS" is not defined, so when get_newest_kernel tries to use dpkg to look up the kernel version it fails.

Defining "KERNELS" to be CURRENT_KERNEL allows the configure to work:

case "$1" in
    configure)
        # Added manually, since we mangled the arguments, and dpkg-maintscript-helper
        # won't work
        if [ -n "$2" ] && `dpkg --compare-versions "$2" lt "340.106-0ubuntu5"`; then
            rm -f /etc/modprobe.d/nvidia-340.conf
        fi
        CURRENT_KERNEL=$(uname -r)
        KERNELS=$CURRENT_KERNEL
        NEWEST_KERNEL=$(get_newest_kernel "$KERNELS")

Seriously - this has been an issue for over a year, and nobody bothered to look into it?

Revision history for this message
Philippe Vaucher (philippe-vaucher) wrote :

Note that the fix was mentionned in the original report.

I usually don't comment for this but I thought if there was more comments more people would notice :-)

Revision history for this message
Kevin K (stafio) wrote : apport information

ProblemType: Bug
ApportVersion: 2.20.11-0ubuntu50
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: kevin 1034 F.... pulseaudio
                      kevin 1050 F.... pipewire-media-
 /dev/snd/seq: kevin 1033 F.... pipewire
CasperMD5CheckResult: skip
CurrentDesktop: KDE
DistroRelease: Ubuntu 20.10
InstallationDate: Installed on 2020-07-26 (99 days ago)
InstallationMedia: Kubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
MachineType: System manufacturer System Product Name
Package: nvidia-graphics-drivers
ProcFB: 0 nouveaudrmfb
ProcKernelCmdLine: BOOT_IMAGE=/@/boot/vmlinuz-5.8.0-26-generic root=UUID=2f537b73-58b5-4b95-ab4e-3e7b86f463e0 ro rootflags=subvol=@ quiet splash hpet=disable vt.handoff=7
ProcVersionSignature: Ubuntu 5.8.0-26.27-generic 5.8.14
RelatedPackageVersions:
 linux-restricted-modules-5.8.0-26-generic N/A
 linux-backports-modules-5.8.0-26-generic N/A
 linux-firmware 1.190
RfKill:
 0: phy0: Wireless LAN
  Soft blocked: no
  Hard blocked: no
Tags: groovy
Uname: Linux 5.8.0-26-generic x86_64
UpgradeStatus: Upgraded to groovy on 2020-10-26 (7 days ago)
UserGroups: adm cdrom dip lpadmin lxd plugdev sambashare scanner sudo
_MarkForUpload: True
dmi.bios.date: 08/23/2013
dmi.bios.release: 4.6
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 1104
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: P8Z77-V LK
dmi.board.vendor: ASUSTeK COMPUTER INC.
dmi.board.version: Rev X.0x
dmi.chassis.asset.tag: Asset-1234567890
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr1104:bd08/23/2013:br4.6:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKCOMPUTERINC.:rnP8Z77-VLK:rvrRevX.0x:cvnChassisManufacture:ct3:cvrChassisVersion:
dmi.product.family: To be filled by O.E.M.
dmi.product.name: System Product Name
dmi.product.sku: SKU
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
tags: added: apport-collected groovy
Revision history for this message
Kevin K (stafio) wrote : AlsaInfo.txt

apport information

Revision history for this message
Kevin K (stafio) wrote : CRDA.txt

apport information

Revision history for this message
Kevin K (stafio) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Kevin K (stafio) wrote : IwConfig.txt

apport information

Revision history for this message
Kevin K (stafio) wrote : Lspci.txt

apport information

Revision history for this message
Kevin K (stafio) wrote : Lspci-vt.txt

apport information

Revision history for this message
Kevin K (stafio) wrote : Lsusb.txt

apport information

Revision history for this message
Kevin K (stafio) wrote : Lsusb-t.txt

apport information

Revision history for this message
Kevin K (stafio) wrote : Lsusb-v.txt

apport information

Revision history for this message
Kevin K (stafio) wrote : PaInfo.txt

apport information

Revision history for this message
Kevin K (stafio) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Kevin K (stafio) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Kevin K (stafio) wrote : ProcEnviron.txt

apport information

Revision history for this message
Kevin K (stafio) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Kevin K (stafio) wrote : ProcModules.txt

apport information

Revision history for this message
Kevin K (stafio) wrote : PulseList.txt

apport information

Revision history for this message
Kevin K (stafio) wrote : UdevDb.txt

apport information

Revision history for this message
Kevin K (stafio) wrote : WifiSyslog.txt

apport information

Revision history for this message
Kevin K (stafio) wrote : acpidump.txt

apport information

Revision history for this message
Antonín Skala (tony762) wrote :

Hi, I have a same issue when I use unsigned kernel "unsigned-5.11.10-051110"

Revision history for this message
Antonín Skala (tony762) wrote :

with nvidia driver version 465.

Revision history for this message
littlemike (fletchermichael) wrote :

Problem still present. Original poster provide fix to script back in 2019-11-26. Can the package maintainer be notified to make this fix?

Revision history for this message
Seth Arnold (seth-arnold) wrote :

Users are still finding this issue. In #ubuntu, 3 November 2021:

<webchat69v2> https://justpaste.it/97emx

Thanks

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nvidia-graphics-drivers-340 (Ubuntu):
status: New → Confirmed
Revision history for this message
Seth Arnold (seth-arnold) wrote :

Hello Alberto, any chance for a fix for this issue? Users are still finding this issue. In #ubuntu, 25 December 2021:

Sat 25 00:12:58 < sem> if you're curious this is the dryrun: https://pastebin.ubuntu.com/p/N7kP5Z4mRj/
Sat 25 00:15:32 < Bashing-om> sem: I do want to know - looking ^ ,
Sat 25 00:17:13 < sem> do you think this message is relevant? "dpkg: error: version '-' has bad syntax: revision number is empty" https://pastebin.ubuntu.com/p/PGj9rjzKXF/

Thanks

Revision history for this message
sem (semitones) wrote (last edit ):

Addition to the above comment by sarnold, I tried with the 5.4 kernel, and that seemed to compile ok. But it still fails for 5.11 installed on the same system, regardless of changing $KERNELS to $CURRENT_KERNEL. Here is some relevant output:

sudo apt install nvidia-340 # after installing and booting linux 5.4
https://paste.ubuntu.com/p/HqJjsQk7hN/

contents of /var/lib/dkms/nvidia-340/340.108/build/make.log
https://paste.ubuntu.com/p/nGtrn67VBJ/

So to get it working on 20.04.3, I had to install the 5.4 kernel and uninstall the HWE (5.11) kernel.

Revision history for this message
DaveQB (david-dward) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.