LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 05-13-2021, 04:00 AM   #1
gglq000
Member
 
Registered: Mar 2012
Posts: 65

Rep: Reputation: Disabled
linux-source installed is older than running version


apt get install linux-source install linux-source-4.15.0
But my running kernel is 5.4.0-72-generic.
Why?
Cant it download the similar version as 5.4.0 if I download and install linux-source package? Makes no sense!!!
 
Old 05-13-2021, 04:11 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,836

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
yes, obviously you can install linux-source-<version> the same way as your kernel itself.
But we have no idea what OS is it, how is it configured (the package management system) and how did you install that kernel.
 
Old 05-21-2021, 09:53 PM   #3
gglq000
Member
 
Registered: Mar 2012
Posts: 65

Original Poster
Rep: Reputation: Disabled
Here is my log:
in brief:
ubuntu1804, kernel (default, comes with installation): 5.4
but apt install linux-source causes to download 4.15??


root@ubuntu-desktop:/git.co/dev-learn/cuda/linux/cuda-by-example/p75# lsb_release --all
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
root@ubuntu-desktop:/git.co/dev-learn/cuda/linux/cuda-by-example/p75# uname -r
5.4.0-73-generic
root@ubuntu-desktop:/git.co/dev-learn/cuda/linux/cuda-by-example/p75# dpkg -l | grep linux-source
root@ubuntu-desktop:/git.co/dev-learn/cuda/linux/cuda-by-example/p75# apt install linux-source
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-hwe-5.4-headers-5.4.0-56 linux-hwe-5.4-headers-5.4.0-58 linux-hwe-5.4-headers-5.4.0-60
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
linux-source-4.15.0
Suggested packages:
kernel-package libqt3-dev
The following NEW packages will be installed:
linux-source linux-source-4.15.0
0 upgraded, 2 newly installed, 0 to remove and 132 not upgraded.
Need to get 129 MB of archives.
After this operation, 146 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://mirror.arizona.edu/ubuntu bionic-updates/main amd64 linux-source-4.15.0 all 4.15.0-143.147 [129 MB]
Get:2 http://mirror.arizona.edu/ubuntu bionic-updates/main amd64 linux-source all 4.15.0.143.130 [2,484 B]
Fetched 129 MB in 11s (11.4 MB/s)
Selecting previously unselected package linux-source-4.15.0.
(Reading database ... 350420 files and directories currently installed.)
Preparing to unpack .../linux-source-4.15.0_4.15.0-143.147_all.deb ...
Unpacking linux-source-4.15.0 (4.15.0-143.147) ...
Selecting previously unselected package linux-source.
Preparing to unpack .../linux-source_4.15.0.143.130_all.deb ...
Unpacking linux-source (4.15.0.143.130) ...
Setting up linux-source-4.15.0 (4.15.0-143.147) ...
Setting up linux-source (4.15.0.143.130) ...
root@ubuntu-desktop:/git.co/dev-learn/cuda/linux/cuda-by-example/p75#

root@ubuntu-desktop:/git.co/dev-learn/cuda/linux/cuda-by-example/p75# dpkg -l | grep linux-source
ii linux-source 4.15.0.143.130 all Linux kernel source with Ubuntu patches
ii linux-source-4.15.0 4.15.0-143.147 all Linux kernel source for version 4.15.0 with Ubuntu patches
 
Old 05-21-2021, 10:02 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,321
Blog Entries: 28

Rep: Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141
If it were I, I'd open the Synaptic package manager and search for the correct version of the kernel sources.

If Synaptic is not installed, I'd install it. It's superior to the "software centers" that seem to be all the rage today.

Also, please surround any terminal output with "code" tags which become available when you click the "Advanced" button beneath the compose/edit post window. It makes terminal output much easier to read.
 
Old 05-22-2021, 02:31 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,836

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
which kernel is installed? You need to install the same version of linux-source.
4.15 (not 5.4) is the default and that's why linux-source-4.15.0 was selected.
 
Old 05-24-2021, 03:21 PM   #6
gglq000
Member
 
Registered: Mar 2012
Posts: 65

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
which kernel is installed? You need to install the same version of linux-source.
4.15 (not 5.4) is the default and that's why linux-source-4.15.0 was selected.
how you set the default?
I set the boot default in /etc/grub/default. Dont tell me I did not set there!
 
Old 05-24-2021, 03:24 PM   #7
gglq000
Member
 
Registered: Mar 2012
Posts: 65

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by frankbell View Post
If it were I, I'd open the Synaptic package manager and search for the correct version of the kernel sources.

If Synaptic is not installed, I'd install it. It's superior to the "software centers" that seem to be all the rage today.

Also, please surround any terminal output with "code" tags which become available when you click the "Advanced" button beneath the compose/edit post window. It makes terminal output much easier to read.
ok, I will take note of the code tag. I was sort of lazy.
Can synaptic used from cmdline??

I see following:
/usr/sbin/synaptic
Unable to init server: Could not connect: Connection refused

(synaptic:10774): Gtk-WARNING **: 04:23:32.835: cannot open display:
 
Old 05-25-2021, 12:09 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,836

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
Quote:
Originally Posted by gglq000 View Post
how you set the default?
I set the boot default in /etc/grub/default. Dont tell me I did not set there!
It is not you who can set the default kernel for a distro. And you cannot change it.

Quote:
Originally Posted by gglq000 View Post
ok, I will take note of the code tag. I was sort of lazy.
Can synaptic used from cmdline??

I see following:
/usr/sbin/synaptic
Unable to init server: Could not connect: Connection refused

(synaptic:10774): Gtk-WARNING **: 04:23:32.835: cannot open display:
That is a different error, most probably root has not access right to your display.

I still do not understand why don't you take the version of your kernel and use that for source package?
 
Old 06-17-2021, 05:34 PM   #9
gglq000
Member
 
Registered: Mar 2012
Posts: 65

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
yes, obviously you can install linux-source-<version> the same way as your kernel itself.
But we have no idea what OS is it, how is it configured (the package management system) and how did you install that kernel.
Can you udescrube little bit more on how you can prep installation of linux-source-<version>???
I can't understand other nonsense posts in the forum.
Here is what I did:


apt install linux-source-`uname -r` -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-source-5.4.0-74-generic
E: Couldn't find any package by glob 'linux-source-5.4.0-74-generic'
E: Couldn't find any package by regex 'linux-source-5.4.0-74-generic'
 
Old 06-17-2021, 05:36 PM   #10
gglq000
Member
 
Registered: Mar 2012
Posts: 65

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gglq000 View Post
Can you udescrube little bit more on how you can prep installation of linux-source-<version>???
I can't understand other nonsense posts in the forum.
Here is what I did:


apt install linux-source-`uname -r` -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-source-5.4.0-74-generic
E: Couldn't find any package by glob 'linux-source-5.4.0-74-generic'
E: Couldn't find any package by regex 'linux-source-5.4.0-74-generic'
This is bit better, helps somewhat, gives list containing version closer to my running kernel but not exactly:

apt-cache search linux-source

linux-source - Linux kernel source with Ubuntu patches
linux-source-4.15.0 - Linux kernel source for version 4.15.0 with Ubuntu patches
linux-source-4.18.0 - Linux kernel source for version 4.18.0 with Ubuntu patches
linux-source-5.0.0 - Linux kernel source for version 5.0.0 with Ubuntu patches
linux-source-5.3.0 - Linux kernel source for version 5.3.0 with Ubuntu patches

and I was able to install 5.3.0 instead of 4.x
root@nonroot-SYS-7049GP-TRT:~# apt install linux-source-5.3.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
libncurses-dev | ncurses-dev kernel-package libqt3-dev
The following NEW packages will be installed:
linux-source-5.3.0
0 upgraded, 1 newly installed, 0 to remove and 245 not upgraded.
Need to get 135 MB of archives.
After this operation, 146 MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 linux-source-5.3.0 all 5.3.0-74.70 [135 MB]
Fetched 135 MB in 21s (6,475 kB/s)
Selecting previously unselected package linux-source-5.3.0.
(Reading database ... 188974 files and directories currently installed.)
Preparing to unpack .../linux-source-5.3.0_5.3.0-74.70_all.deb ...
Unpacking linux-source-5.3.0 (5.3.0-74.70) ...
Setting up linux-source-5.3.0 (5.3.0-74.70) ...
 
Old 06-17-2021, 08:56 PM   #11
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939
The "Linux source" packages are really only necessary unless you are curious, or if some source-compiled package that you need to install needs to refer to the correct layout of some C-language struct that is exposed by some API-call.

Since they are quite "bulky," be sure to keep only the ones that you need ... and then, only if you are curious or if you otherwise actually need them. (If you are "simply curious," you can browse the source-code much easier online ...)

Last edited by sundialsvcs; 06-17-2021 at 09:00 PM.
 
  


Reply



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
LXer: Update WhatsApp Now, Adobe Warning Creative Cloud Users with Older Apps, Kernels Older than 5.0.8 Are Vulnerable to Remote Code Execut LXer Syndicated Linux News 0 05-14-2019 07:12 PM
[SOLVED] How to find a file which is older than 5 days but youger than 6 days? thomas2004ch Linux - Software 1 10-29-2013 03:30 AM
Need to match older machine to an older version of Linux fredb47 Linux - Distributions 10 10-27-2011 11:08 AM
installing newer software from source when older version installed from a slackbuild Cultist Slackware 3 01-04-2011 04:07 PM

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

All times are GMT -5. The time now is 03:56 AM.

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
Open Source Consulting | Domain Registration