我的机器上安装了 22.04.2 版本的 Jammy Jellyfish。当我尝试进行更新和升级时,出现以下错误。你们中有没有人知道可能导致这种情况的原因并建议如何解决?非常感谢
Processing triggers for linux-image-5.19.0-38-generic (5.19.0-38.39~22.04.1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.19.0-38-generic
I: The initramfs will attempt to resume from /dev/dm-1
I: (/dev/mapper/vgxubuntu-swap_1)
I: Set the RESUME variable to override this.
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 36: /etc/default/grub: bash:: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-5.19.0-38-generic (--configure):
installed linux-image-5.19.0-38-generic package post-installation script subpro
cess returned error exit status 1
Errors were encountered while processing:
linux-image-5.19.0-38-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
cat /etc/default/grub
这是Baa 建议的命令输出:
hetrengzy@hefto-Ubuntu:~$ cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=45
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
bash: line 1: J: command not found
你能建议如何处理这个吗?非常感谢
添加了一个额外的行
/etc/default/grub
导致了问题bash: line 1: J: command not found
。不确定它是如何到达那里的,但只需将其删除。sudo gedit /etc/default/grub
在文本编辑器中打开此文件。bash: line 1: J: command not found
找到最后说的那一行。