/usr/sbin/grub-mkconfig: 1: /etc/default/grub: If: 찾을 수 없음

/usr/sbin/grub-mkconfig: 1: /etc/default/grub: If: 찾을 수 없음

내가 달릴 sudo update-grub2때나sudo update-grub

나는 응답을 받는다

소스 파일 `/etc/default/grub' /usr/sbin/grub-mkconfig: 1: /etc/default/grub: If: 찾을 수 없음

하지만 내 /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=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#Originally...
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT="splash radeon.si_support=0 amdgpu.si_support=1 radeon.cik_support=0 amdgpu.cik_support=1"
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"

오류가 무엇인지 알 수 있나요? 감사해요!

답변1

오류 메시지

/usr/sbin/grub-mkconfig: 1: /etc/default/grub: If: not found

당신에게 그 사실을 알려주는 것이 아니다.파일 /etc/default/grubIf찾을 수 없다는 것은 해당 파일의 1번 줄에서 명령을 찾을 수 없다는 뜻입니다 . 그 이유는 If주석 블록의 일부여야 하기 때문입니다. 즉

 If you change this file, run 'update-grub' afterwards to update

해야한다

# If you change this file, run 'update-grub' afterwards to update

sudoedit /etc/default/grub파일을 편집 하고(예를 들어) 누락된 항목을 삽입 해야 합니다.#

답변2

비슷한 오류가 발생했는데 무슨 일이 일어났는지 잘 모르겠지만 최근 업데이트 중에 /etc/default/grub 파일에 추가 줄이 추가되었습니다.

"/etc/default/grub" 34L, 1279C

해당 파일의 맨 아래에 있었고 주석을 달았더니 다시 문제가 해결되었습니다!

관련 정보