Page 1 of 1

I can't install "Linux-Source".

Posted: 2017-02-03 07:54
by hack3rcon
Hello.
I installed Debian 8.6 amd64 and I can't install "Linux-Source" and Kernel header. It show me an error about "Could not mark all packages....".
Why?

Thank you.

Re: I can't install "Linux-Source".

Posted: 2017-02-03 08:42
by kedaha
And with aptitude? The -s is just to simulate:

Code: Select all

# aptitude install -s linux-headers-$(uname -r) linux-source

Re: I can't install "Linux-Source".

Posted: 2017-02-03 09:26
by hack3rcon
kedaha wrote:And with aptitude? The -s is just to simulate:

Code: Select all

# aptitude install -s linux-headers-$(uname -r) linux-source
Can't install :(
I take a photo and please see "Image"

Thank you.

Re: I can't install "Linux-Source".

Posted: 2017-02-03 09:41
by kedaha
Have you enabled the source archives in your Sources List
On my system:

Code: Select all

root@kedaha:/home/user# aptitude install -s linux-headers-$(uname -r) linux-source
The following NEW packages will be installed:
  linux-source linux-source-3.16{a} 
The following packages will be REMOVED:
  libqt5script5{u} phonon4qt5{u} 
The following packages will be upgraded:
  linux-headers-3.16.0-4-amd64 linux-headers-3.16.0-4-common 
2 packages upgraded, 2 newly installed, 2 to remove and 89 not upgraded.
Need to get 83.7 MB/88.7 MB of archives. After unpacking 81.1 MB will be used.
Do you want to continue? [Y/n/?] 
You might post your sources.list file.

Re: I can't install "Linux-Source".

Posted: 2017-02-03 09:56
by hack3rcon
kedaha wrote:Have you enabled the source archives in your Sources List
On my system:

Code: Select all

root@kedaha:/home/user# aptitude install -s linux-headers-$(uname -r) linux-source
The following NEW packages will be installed:
  linux-source linux-source-3.16{a} 
The following packages will be REMOVED:
  libqt5script5{u} phonon4qt5{u} 
The following packages will be upgraded:
  linux-headers-3.16.0-4-amd64 linux-headers-3.16.0-4-common 
2 packages upgraded, 2 newly installed, 2 to remove and 89 not upgraded.
Need to get 83.7 MB/88.7 MB of archives. After unpacking 81.1 MB will be used.
Do you want to continue? [Y/n/?] 
You might post your sources.list file.

Code: Select all

cat /etc/apt/sources.list


# deb cdrom:[Debian GNU/Linux 8.6.0 _Jessie_ - Official amd64 DVD Binary-1 20160917-14:25]/ jessie contrib main 

# deb cdrom:[Debian GNU/Linux 8.6.0 _Jessie_ - Official amd64 DVD Binary-1 20160917-14:25]/ jessie main contrib  

deb http://security.debian.org/ jessie/updates main contrib 
deb-src http://security.debian.org/ jessie/updates main contrib 

# jessie-updates, previously known as 'volatile'
# A network mirror was not selected during install.  The following entries
# are provided as examples, but you should amend them as appropriate
# for your mirror of choice.

deb http://ftp.debian.org/debian/ jessie-updates contrib main  
deb-src http://ftp.debian.org/debian/ jessie-updates contrib main  

Re: I can't install "Linux-Source".

Posted: 2017-02-03 10:03
by Ardouos
kedaha wrote:Have you enabled the source archives in your Sources List
Correct me if I am wrong, but apt only retrieves from the sources archives if you use the source switch.

Code: Select all

# apt-get source
I do not have sources archives enabled and I could install it fine by the way.

Code: Select all

$ sudo apt-get install linux-source
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  linux-source-3.16
Suggested packages:
  libncurses-dev ncurses-dev libqt4-dev pkg-config
The following NEW packages will be installed:
  linux-source linux-source-3.16
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 83.7 MB of archives.
After this operation, 83.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ftp.uk.debian.org/debian/ jessie/main linux-source-3.16 all 3.16.39-1 [83.7 MB]
Get:2 http://ftp.uk.debian.org/debian/ jessie/main linux-source all 3.16+63 [5,014 B]
Fetched 83.7 MB in 48s (1,737 kB/s)                                            
Selecting previously unselected package linux-source-3.16.
(Reading database ... 120724 files and directories currently installed.)
Preparing to unpack .../linux-source-3.16_3.16.39-1_all.deb ...
Unpacking linux-source-3.16 (3.16.39-1) ...
Selecting previously unselected package linux-source.
Preparing to unpack .../linux-source_3.16+63_all.deb ...
Unpacking linux-source (3.16+63) ...
Setting up linux-source-3.16 (3.16.39-1) ...
Setting up linux-source (3.16+63) ...
$ 
@OP

It looks like you do not have Debian's "jessie" main repo in your sources.
Follow the link that kedaha has shown you, it should tell you what you need to know.

Re: I can't install "Linux-Source".

Posted: 2017-02-03 10:56
by hack3rcon
OK.
Problem solved with add the main repository.

Re: I can't install "Linux-Source".

Posted: 2017-02-03 23:16
by stevepusser
I will bet you have some bad advice to install the linux-source for your current kernel. (not dependent on deb-src lines, by the way) If all you need to do is build a kernel driver (module), the header package is all you need, along with the compilers.

Re: I can't install "Linux-Source".

Posted: 2017-02-04 05:23
by hack3rcon
stevepusser wrote:I will bet you have some bad advice to install the linux-source for your current kernel. (not dependent on deb-src lines, by the way) If all you need to do is build a kernel driver (module), the header package is all you need, along with the compilers.
I need it for VirtualBox.

Re: I can't install "Linux-Source".

Posted: 2017-02-04 11:21
by debiman
hack3rcon wrote:I need it for VirtualBox.
why do you think you need linux sources for virtualbox?
please explain and show us in detail.

Re: I can't install "Linux-Source".

Posted: 2017-02-04 15:04
by stevepusser
hack3rcon wrote:
stevepusser wrote:I will bet you have some bad advice to install the linux-source for your current kernel. (not dependent on deb-src lines, by the way) If all you need to do is build a kernel driver (module), the header package is all you need, along with the compilers.
I need it for VirtualBox.
Yup, bad advice. Check the Debian wiki entry for Virtual Box.

Re: I can't install "Linux-Source".

Posted: 2017-02-04 15:24
by hack3rcon
debiman wrote:
hack3rcon wrote:I need it for VirtualBox.
why do you think you need linux sources for virtualbox?
please explain and show us in detail.
I installed Debian as a VM and I want to install VirtualBox Guest Addition.

Re: I can't install "Linux-Source".

Posted: 2017-02-04 18:40
by stevepusser
Here's a quick and easy way to set up what you need to build the modules in your Debian guest system.

Install module-assistant.

Run

Code: Select all

m-a prepare
as sysadmin (as root or with sudo) in a terminal. This gets everything you need automatically.

That's it, you are done. Now you have a module build environment set up in your guest, ready to build the guest additions.

Again, where did you get the bad instructions to install "linux-source"? You can only use the headers in a linux-source directory if you used it to build your running kernel in there, so that's doubly bad advice, too. They are no use if they are "just installed."