LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-16-2019, 09:40 PM   #1
Ecobureau
LQ Newbie
 
Registered: Feb 2019
Location: Queenstown, NZ
Distribution: Ubuntu
Posts: 3

Rep: Reputation: Disabled
dpkg: warning: version 'uname' has bad syntax: version number does not start with digit


Hi
My problems started with the Ubuntu 'repeat loop login' problem. I've experienced it before in both 16.04 and now in 18.04.2. Previously it was due to the nvidia driver problem and solved. This time I was unable to complete the removal and reinstallation process, because of the above error. I tried numerous other proposed remedies, but all failed with the above error. In the end I was able to install lubuntu and so at least have a GUI.

This error means I am completely unable to update any packages (or some upgrades) as dpkg and depmod fall over.

It looks as if my kernel (4.15.0-generic) is in some way corrupted, but am unable to roll back or readily replace.

My system is dual boot, via GRUB, with win10 as the alternative (the dual boot operates OK). This failure coincided with both a win10 update and some Ubuntu upgrades. I suspect I may have to reinstall Ubuntu, but need to retain much critical data and win10 software. My win10 OS and software are on an SSD, win data on one HD, linux OS and data on a further HD.

Any suggestions or help would be much appreciated before I take the nuclear option.
 
Old 02-17-2019, 01:40 PM   #2
Brains
Member
 
Registered: Apr 2009
Distribution: Debian testing
Posts: 948

Rep: Reputation: 239Reputation: 239Reputation: 239
Quote:
In the end I was able to install lubuntu and so at least have a GUI
need to retain much critical data and win10 software
You can either boot the Ubuntu Live, or Lubuntu Live and easily access both Ubuntu installed and Windows 10 installed to retrieve data through the graphical file manager. To open directories that require root access, you right click on that directory and select "Open as root". Since you also mention you have also installed Lubuntu, same thing applies from this installation. But reinstalling Ubuntu should not affect the Windows 10 partitions unless you direct the Ubuntu installer to install automatic, when it comes to the partitioning stage you simply select "Custom partitioning" or similar where you can highlight only the Ubuntu partitions and designate their mount points and file system format. Ubuntu 18.04 does not create a separate swap partition, so there should only be a root partition (/) that you need to select and designate as root with desired file system which should default to ext4.
Quote:
My system is dual boot, via GRUB
The quote above would lead one to believe you installed both Windows 10 and Ubuntu in legacy BIOS mode, which means there should not be a EFI system partition which would be required for a UEFI system, whatever the case, if there is a EFI partition, you don't need to instruct the installer to use it, it should use it automatically if you are installing in UEFI mode. Only the existing Ubuntu root partition should be selected to use and designated as root for the new install, the new install should not affect anything Windows related.
Quote:
Previously it was due to the nvidia driver problem and solved
Which Nvidia driver did you install?
1: The .run installer from Nvidia downloads (latest but not necessarily greatest)
2: The PPA version by enabling PPA repositories and installing "latest but not necessarily greatest"
3: The recommend stable version through "Software & Update/Additional Drivers"
Quote:
This failure coincided with both a win10 update and some Ubuntu upgrades
Windows 10 update should not affect Ubuntu on a separate drive. Perhaps some clarification can shed better light.

And last but not least, you can also boot the Ubuntu Live, chroot into the installed Ubuntu and attempt to revert damages and or apply updates and roll back whatever kernel is giving you issues. The .run Nvidia driver installer will always pump out a error "Taints kernel", but this usually has no ill effect if the driver installation completed successfully.

From while running Ubuntu in live mode, run command: sudo fdisk -l to find the Ubuntu root partition device, perhaps based on the information you provided so far, /dev/sdc1. Replace the xxxx in the first command in the code below with the appropriate device and continue issuing the commands listed, after the sudo chroot /mnt command, you will be able to execute commands in the installed Ubuntu as root, such as apt update, apt upgrade, uname -a to see kernel version installed, apt reinstall linux-image-4.15.0-45-generic to reinstall the current kernel, if this is not the version produced by the uname -a command, change the version number to match the output of uname -a command. Once you are done, continue on with the rest of the commands to exit the chroot and unmount everything.
Code:
sudo mount /dev/xxxx /mnt
sudo mount --bind /dev /mnt/dev 
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo mount -o bind /run /mnt/run
sudo chroot /mnt
exit
sudo umount /mnt/run
sudo umount /mnt/sys
sudo umount /mnt/proc
sudo umount /mnt/dev/pts
sudo umount /mnt/dev
sudo umount /mnt

Last edited by Brains; 02-17-2019 at 02:46 PM.
 
Old 02-17-2019, 11:05 PM   #3
Ecobureau
LQ Newbie
 
Registered: Feb 2019
Location: Queenstown, NZ
Distribution: Ubuntu
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks Brains for your comprehensive reply.



Quote:
Originally Posted by Brains View Post
You can either boot the Ubuntu Live, or Lubuntu Live and easily access both Ubuntu installed and Windows 10 installed to retrieve data through the graphical file manager. To open directories that require root access, you right click on that directory and select "Open as root". Since you also mention you have also installed Lubuntu, same thing applies from this installation. But reinstalling Ubuntu should not affect the Windows 10 partitions unless you direct the Ubuntu installer to install automatic, when it comes to the partitioning stage you simply select "Custom partitioning" or similar where you can highlight only the Ubuntu partitions and designate their mount points and file system format. Ubuntu 18.04 does not create a separate swap partition, so there should only be a root partition (/) that you need to select and designate as root with desired file system which should default to ext4.

The quote above would lead one to believe you installed both Windows 10 and Ubuntu in legacy BIOS mode, which means there should not be a EFI system partition which would be required for a UEFI system, whatever the case, if there is a EFI partition, you don't need to instruct the installer to use it, it should use it automatically if you are installing in UEFI mode. Only the existing Ubuntu root partition should be selected to use and designated as root for the new install, the new install should not affect anything Windows related.

Which Nvidia driver did you install?
1: The .run installer from Nvidia downloads (latest but not necessarily greatest)
2: The PPA version by enabling PPA repositories and installing "latest but not necessarily greatest"

In the past this option worked, but not this time

3: The recommend stable version through "Software & Update/Additional Drivers"

Windows 10 update should not affect Ubuntu on a separate drive. Perhaps some clarification can shed better light.

And last but not least, you can also boot the Ubuntu Live, chroot into the installed Ubuntu and attempt to revert damages and or apply updates and roll back whatever kernel is giving you issues. The .run Nvidia driver installer will always pump out a error "Taints kernel", but this usually has no ill effect if the driver installation completed successfully.

From while running Ubuntu in live mode, run command: sudo fdisk -l to find the Ubuntu root partition device, perhaps based on the information you provided so far, /dev/sdc1. Replace the xxxx in the first command in the code below with the appropriate device and continue issuing the commands listed, after the sudo chroot /mnt command, you will be able to execute commands in the installed Ubuntu as root, such as apt update, apt upgrade, uname -a to see kernel version installed, apt reinstall linux-image-4.15.0-45-generic to reinstall the current kernel, if this is not the version produced by the uname -a command, change the version number to match the output of uname -a command.

My version of apt does not have reinstall as an option, instead I could only use apt install

Once you are done, continue on with the rest of the commands to exit the chroot and unmount everything.
Code:
sudo mount /dev/xxxx /mnt
sudo mount --bind /dev /mnt/dev 
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo mount -o bind /run /mnt/run
sudo chroot /mnt
exit
sudo umount /mnt/run
sudo umount /mnt/sys
sudo umount /mnt/proc
sudo umount /mnt/dev/pts
sudo umount /mnt/dev
sudo umount /mnt

I ran all the above code and it fell over again with the same core messages.

Below I've included the output from attempting to reinstall

Reading package lists...
Building dependency tree...
Reading state information...
linux-image-4.15.0-45-generic is already the newest version (4.15.0-45.48).
The following packages were automatically installed and are no longer required:
dkms lib32gcc1 libc6-i386 libcuda1-340 libxnvctrl0 screen-resolution-extra
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Setting up linux-firmware (1.173.3) ...
update-initramfs: Generating /boot/initrd.img-uname
WARNING: missing /lib/modules/uname
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: Bad version passed uname
dpkg: warning: version 'uname' has bad syntax: version number does not start with digit
dpkg: warning: version 'uname' has bad syntax: version number does not start with digit
dpkg: warning: version 'uname' has bad syntax: version number does not start with digit
dpkg: warning: version 'uname' has bad syntax: version number does not start with digit
depmod: ERROR: Bad version passed uname
update-initramfs: Generating /boot/initrd.img-uname
WARNING: missing /lib/modules/uname
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: Bad version passed uname
dpkg: warning: version 'uname' has bad syntax: version number does not start with digit
dpkg: warning: version 'uname' has bad syntax: version number does not start with digit
dpkg: warning: version 'uname' has bad syntax: version number does not start with digit
dpkg: warning: version 'uname' has bad syntax: version number does not start with digit
depmod: ERROR: Bad version passed uname
update-initramfs: Generating /boot/initrd.img--r
/usr/sbin/mkinitramfs: option requires an argument -- 'r'
W: non-GNU getopt
update-initramfs: failed for /boot/initrd.img--r with 1.
dpkg: error processing package linux-firmware (--configure):
installed linux-firmware package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-generic:
linux-image-generic depends on linux-firmware; however:
Package linux-firmware is not configured yet.

dpkg: error processing package linux-image-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-image-generic (= 4.15.0.45.47); however:
Package linux-image-generic is not configured yet.

dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-signed-generic:
linux-signed-generic depends on linux-generic; however:
Package linux-generic is not configured yet.

dpkg: error processing package linux-signed-generic (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-firmware
linux-image-generic
linux-generic
linux-signed-generic

any suggestions?

Thanks
 
Old 02-18-2019, 02:17 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 11,025
Blog Entries: 7

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
please use code tags for code, see like this:
Quote:
Originally Posted by Ecobureau View Post
Code:
dpkg: warning: version 'uname' has bad syntax: version number does not start with digit
depmod: ERROR: Bad version passed uname
update-initramfs: Generating /boot/initrd.img-uname
WARNING: missing /lib/modules/uname
to me all this looks like somewhere there's a script that passes the actual string "uname" to depmod and/or update-initramfs, instead of the output of the command uname -r, usually like this:
Code:
$(uname -r)
since you are not doing this manually, i have no clue what went wrong.
maybe you downloaded fishy software when dealing with your nvidia driver?
maybe you made a typing error when setting it up?

edit:
ok here's a wild idea:
you copy-pasted a command from somewhere, that contained something like this:
Code:
sudo update-initramfs -u -k `uname -r`
but the `backticks` got mangled or lost completely, resulting in something like this:
Code:
sudo update-initramfs -u -k uname -r

Last edited by ondoho; 02-18-2019 at 02:20 AM.
 
Old 02-18-2019, 04:13 PM   #5
Brains
Member
 
Registered: Apr 2009
Distribution: Debian testing
Posts: 948

Rep: Reputation: 239Reputation: 239Reputation: 239
Quote:
WARNING: missing /lib/modules/uname
Well, I just came to learn you cannot right click on a directory and open it as root in Ubuntu, must be a Cinnamon thing with Mint only.

I'm guessing, if there is a folder in /lib/modules, it's number/name is not "4.15.0-45-generic". I currently have both 4.15.0-43 and 4.15.0-45 installed, if you select advanced options at the grub boot menu, perhaps you have the option to boot to the 4.15.0-43 (previous) kernel. If so, perhaps you can uninstall the 4.15.0-45 while running the previous (43) kernel then do the apt update apt upgrade thing to reinstall 4.15.0-45.

EDIT:As long as there is a previous kernel installed, you should be able to uninstall the latest, currently in repositories there is still versions 45 down to 20. You may be able to install a previous version if not installed, but this may still give errors with installed 45, might be worth a shot, might work from the chroot if not from the installed Ubuntu.

Last edited by Brains; 02-18-2019 at 04:21 PM.
 
Old 02-21-2019, 01:39 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 11,025
Blog Entries: 7

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
looking closer at your output, i am increasingly sure that you need to re-run this command:
Quote:
Originally Posted by ondoho View Post
Code:
sudo update-initramfs -u -k $(uname -r)
 
Old 02-27-2019, 03:46 PM   #7
Ecobureau
LQ Newbie
 
Registered: Feb 2019
Location: Queenstown, NZ
Distribution: Ubuntu
Posts: 3

Original Poster
Rep: Reputation: Disabled
Unsolvable?

Thanks everyone, but I have been completely unable to fix this problem.
I tried everything suggested including using the Linux advanced options previous kernel and attempting to replace the kernel with an earlier version.
Whenever I came to (re-)install anything, the system fell over at the dpkg/uname problem. There seems to be some fundamental corruption within my installation.

I still have no idea what happened, except it appeared to happen during my attempt to fix the 'repeat login loop' problem. Whether it was actually due to the process I tried I don't know - previously I had successfully fixed this in 16.04.

I've decided to just reinstall Ubuntu and think carefully how to fix the 'repeat login loop' problem if it should occur in the future.
 
Old 02-28-2019, 12:37 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 11,025
Blog Entries: 7

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
Quote:
Originally Posted by Ecobureau View Post
I still have no idea what happened
I still think it must have been
  • some command you entered yourself
  • some badly configured software you added to your system to fix the original problem
  • both
so my advice would be to be very careful about copy-pasting "solutions" found on the web.
never do it blindly.
and some ppas or other .debs you find floating around are not completely trustworthy either.
 
Old 02-28-2019, 01:40 AM   #9
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 12,249

Rep: Reputation: 3788Reputation: 3788Reputation: 3788Reputation: 3788Reputation: 3788Reputation: 3788Reputation: 3788Reputation: 3788Reputation: 3788Reputation: 3788Reputation: 3788
what I can't see: you have to post exactly what did you try and what's happened (and what was expected). Otherwise we will have no real info about this story.
What you wrote is completely useless if (for example) you simply mistyped something. Reinstalling the system will not solve such kind of issues.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Read digit by digit in variable pedropt Programming 6 12-25-2017 04:24 AM
Substitue single-digit, two-digit, and 3-digit numbers with text using sed dmason165 Programming 13 08-07-2009 10:38 AM
pls help on how i can generate 4 digit random number that are unique within the set icylicious Programming 7 08-22-2006 01:00 PM
dpkg-reconfigure linux-image-$(uname -r) Paxmaster Ubuntu 1 12-13-2005 08:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration