跑步泊坞窗在苹果电脑上
docker pull ubuntu:14.04
docker run -i -t ubuntu:14.04 /bin/bash
Linux 标准库
root@d112db1e835e:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
我的目标是淘汰我用来构建一些优秀的旧 C 代码的专用笔记本电脑,并改用 Docker 容器。
为了编译我的代码,我Makefile
希望运行
Makefile: /usr/bin/make -C /lib/modules/$(shell uname -r)/build M=$(PWD)/linux/$* modules
不幸的是该modules
文件夹是空的
mysuer@d112db1e835e:~/robot$ ls -al /lib/modules/
ls: cannot access /lib/modules/: No such file or directory
在我的 Linux 机器上,我可以找到这些模块
$ ls -al /lib/modules/
total 28
drwxr-xr-x 7 root root 4096 Dez 13 2016 .
drwxr-xr-x 24 root root 4096 Apr 24 2017 ..
drwxr-xr-x 5 root root 4096 Dez 13 2016 3.13.0-105-generic
drwxr-xr-x 5 root root 4096 Jun 23 2015 3.13.0-55-generic
drwxr-xr-x 5 root root 4096 Jul 10 2015 3.13.0-57-generic
drwxr-xr-x 5 root root 4096 Nov 3 2015 3.13.0-65-generic
drwxr-xr-x 5 root root 4096 Nov 24 2015 3.13.0-68-generic
但我的泊坞窗中没有模块。
在我的码头工人上
uname -r
4.9.60-linuxkit-aufs
因此
/usr/bin/make -C /lib/modules/4.9.60-linuxkit-aufs/build .... FAILS
/lib/modules/4.9.60-linuxkit-aufs
不在这里。
我该如何解决这个问题?
尝试安装标头
apt-cache search linux-headers-4
linux-headers-4.2.0-18 - Header files related to Linux kernel version 4.2.0
linux-headers-4.2.0-18-generic - Linux kernel headers for version 4.2.0 on 64 bit x86 SMP
linux-headers-4.2.0-18-lowlatency - Linux kernel headers for version 4.2.0 on 64 bit x86 SMP
linux-headers-4.2.0-19 - Header files related to Linux kernel version 4.2.0
linux-headers-4.2.0-19-generic - Linux kernel headers for version 4.2.0 on 64 bit x86 SMP
linux-headers-4.2.0-19-lowlatency - Linux kernel headers for version 4.2.0 on 64 bit x86 SMP
linux-headers-4.2.0-21 - Header files related to Linux kernel version 4.2.0
linux-headers-4.2.0-21-generic - Linux kernel headers for version 4.2.0 on 64 bit x86 SMP
linux-headers-4.2.0-21-lowlatency - Linux kernel headers for version 4.2.0 on 64 bit x86 SMP
linux-headers-4.2.0-22 - Header files related to Linux kernel version 4.2.0
...
我没有找到 4.9.60 的标题
root@d112db1e835e:~# apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-headers-4.9.60-linuxkit-aufs
E: Couldn't find any package by regex 'linux-headers-4.9.60-linuxkit-aufs'
或者
root@d112db1e835e:~# apt-cache search linux-headers-4.9
root@d112db1e835e:~#
没有候选人
root@d112db1e835e:~# apt-get install linux-headers
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package linux-headers is a virtual package provided by:
linux-headers-4.4.0-1010-aws 4.4.0-1010.10
linux-headers-4.4.0-1009-aws 4.4.0-1009.9
... FILTERED ...
linux-headers-3.13.0-100-lowlatency 3.13.0-100.147
linux-headers-3.13.0-100-generic 3.13.0-100.147
You should explicitly select one to install.
E: Package 'linux-headers' has no installation candidate
root@d112db1e835e:~#
不退回任何包裹
root@d112db1e835e:~# apt-cache search linux-source
linux-source - Linux kernel source with Ubuntu patches
linux-source-3.13.0 - Linux kernel source for version 3.13.0 with Ubuntu patches