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

Bug #1853977 reported by Philippe Vaucher on 2019-11-26
44
This bug affects 9 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Undecided
Unassigned
nvidia-graphics-drivers (Ubuntu)
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

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
Launchpad Janitor (janitor) wrote :

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

Changed in nvidia-graphics-drivers (Ubuntu):
status: New → Confirmed
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?

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 :-)

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
Kevin K (stafio) wrote : AlsaInfo.txt

apport information

Kevin K (stafio) wrote : CRDA.txt

apport information

apport information

Kevin K (stafio) wrote : IwConfig.txt

apport information

Kevin K (stafio) wrote : Lspci.txt

apport information

apport information

Kevin K (stafio) wrote : Lsusb.txt

apport information

Kevin K (stafio) wrote : Lsusb-t.txt

apport information

Kevin K (stafio) wrote : Lsusb-v.txt

apport information

Kevin K (stafio) wrote : PaInfo.txt

apport information

apport information

apport information

apport information

apport information

apport information

apport information

Kevin K (stafio) wrote : UdevDb.txt

apport information

apport information

apport information

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers