sudo apt-get download linux-image-3.19.0-25-generic
将下载软件包:
linux-image-3.19.0-25-generic_3.19.0-25.26~14.04.1_amd64.deb
并尝试列出(或安装):
dpkg --listfiles linux-image-3.19.0-25-generic_3.19.0-25.26~14.04.1_amd64.deb
返回错误:
illegal package name: character `~' not allowed
遵循 Ubuntu 内核构建说明时也是如此。为什么内核版本和软件包包含非法字符?为什么 Ubuntu 内核文档 (https://wiki.ubuntu.com/内核)对实际发布的内核版本有什么看法(它说了很多不匹配的内容)?
答案1
您使用了错误的命令。dpkg --listfiles
是针对已安装的软件包,而不是随机.deb
文件。来自man dpkg
:
-L, --listfiles package-name...
List files installed to your system from package-name.
因此,当您执行 时dpkg --listfiles linux-image-3.19.0-25-generic_3.19.0-25.26~14.04.1_amd64.deb
,linux-image-3.19.0-25-generic_3.19.0-25.26~14.04.1_amd64.deb
将被视为包名称,而不是linux-image-3.19.0-25-generic
。
改用dpkg-deb --contents
:
$ dpkg-deb --contents linux-image-3.19.0-25-generic_3.19.0-25.26\~14.04.1_amd64.deb
drwxr-xr-x root/root 0 2015-07-25 05:01 ./
drwxr-xr-x root/root 0 2015-07-25 04:52 ./lib/
drwxr-xr-x root/root 0 2015-07-25 04:52 ./lib/firmware/
drwxr-xr-x root/root 0 2015-07-25 04:52 ./lib/firmware/3.19.0-25-generic/
drwxr-xr-x root/root 0 2015-07-25 04:52 ./lib/firmware/3.19.0-25-generic/korg/
-rw-r--r-- root/root 15764 2015-07-25 04:52 ./lib/firmware/3.19.0-25-generic/korg/k1212.dsp
drwxr-xr-x root/root 0 2015-07-25 04:52 ./lib/firmware/3.19.0-25-generic/tigon/
-rw-r--r-- root/root 2668 2015-07-25 04:52 ./lib/firmware/3.19.0-25-generic/tigon/tg3.bin
-rw-r--r-- root/root 3884 2015-07-25 04:52 ./lib/firmware/3.19.0-25-generic/tigon/tg3_tso5.bin
-rw-r--r-- root/root 7004 2015-07-25 04:52 ./lib/firmware/3.19.0-25-generic/tigon/tg3_tso.bin
...
而且您不需要sudo
使用apt-get download
。