今天我的 Debian 工作计算机上有一些软件包和内核更新。运行 sudo apt-get install 时,我得到以下信息:
paul@icarus:~$ sudo apt-get install
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libwine-gecko-1.4
Use 'apt-get autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 19 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-3.2.0-4-amd64 (3.2.65-1) ...
Running depmod.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms 3.2.0-4-amd64 /boot/vmlinuz-3.2.0-4-amd64
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-4-amd64 /boot/vmlinuz-3.2.0-4-amd64
update-initramfs: Generating /boot/initrd.img-3.2.0-4-amd64
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168f-2.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168f-1.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8105e-1.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-3.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-2.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-1.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-2.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-1.fw for module r8169
W: TMPDIR is mounted noexec, will not cache run scripts.
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.2.0-4-amd64 /boot/vmlinuz-3.2.0-4-amd64
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.2.0-4-amd64 /boot/vmlinuz-3.2.0-4-amd64
grub-mkconfig: You must run this as root
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.2.0-4-amd64.postinst line 696.
dpkg: error processing linux-image-3.2.0-4-amd64 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
linux-image-3.2.0-4-amd64
N: Ignoring file 'out.log' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'err.log' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'out.log' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'err.log' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'out.log' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'err.log' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
E: Sub-process /usr/bin/dpkg returned an error code (1)
Grub 看起来像是引起了问题。但如果我只是以 root 身份或使用 sudo 运行 grub-mkconfig,我仍然会收到权限错误:
root@icarus:~# grub-mkconfig
grub-mkconfig: You must run this as root
paul@icarus:~$ sudo grub-mkconfig -o /boot/grub/grub.cfg
grub-mkconfig: You must run this as root
到底是怎么回事?
答案1
尝试这个
~$ su
password:
root@ ~$ grub-mkconfig > /boot/grub/grub.cfg
它应该有效。因为它的许可,所以必须是根用户,即使使用也不是普通用户须藤。也许这是 Debian 的新政策。