获取发行版使用的内核源码

rpm

可以执行如下命令下载内核源码包:

yumdownloader --source kernel

apt-get

使用如下命令下载内核源码:

sudo apt-get install linux-source

一个具体的示例如下:

longyu@longyu-pc:~$ sudo apt-get install linux-source
[sudo] password for longyu: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  linux-config-4.19 linux-source-4.19
Suggested packages:
  libqt4-dev
The following NEW packages will be installed:
  linux-config-4.19 linux-source linux-source-4.19
0 upgraded, 3 newly installed, 0 to remove and 66 not upgraded.
Need to get 107 MB of archives.
After this operation, 107 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates/main amd64 linux-config-4.19 amd64 4.19.67-2+deb10u2 [422 kB]
Get:2 https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates/main amd64 linux-source-4.19 all 4.19.67-2+deb10u2 [107 MB]
Get:3 https://mirrors.tuna.tsinghua.edu.cn/debian buster/main amd64 linux-source all 4.19+105+deb10u1 [6,644 B]                                             
Fetched 107 MB in 36s (2,950 kB/s)                                                                                                                          
Selecting previously unselected package linux-config-4.19:amd64.
(Reading database ... 246942 files and directories currently installed.)
Preparing to unpack .../linux-config-4.19_4.19.67-2+deb10u2_amd64.deb ...
Unpacking linux-config-4.19:amd64 (4.19.67-2+deb10u2) ...
Selecting previously unselected package linux-source-4.19.
Preparing to unpack .../linux-source-4.19_4.19.67-2+deb10u2_all.deb ...
Unpacking linux-source-4.19 (4.19.67-2+deb10u2) ...
Selecting previously unselected package linux-source.
Preparing to unpack .../linux-source_4.19+105+deb10u1_all.deb ...
Unpacking linux-source (4.19+105+deb10u1) ...
Setting up linux-source-4.19 (4.19.67-2+deb10u2) ...
Setting up linux-source (4.19+105+deb10u1) ...
Setting up linux-config-4.19:amd64 (4.19.67-2+deb10u2) ...

下载的内核源码包位于如下目录中:

longyu@longyu-pc:~$ ls /usr/src/linux-
linux-config-4.19/             linux-headers-4.19.0-6-common/ linux-patch-4.19-rt.patch.xz   
linux-headers-4.19.0-6-amd64/  linux-kbuild-4.19/             linux-source-4.19.tar.xz  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值