
sudo update-grub
GRUB 구성 파일을 편집하고 업데이트하고 싶었지만 결과는 다음과 같습니다.
Sourcing file `enter code here`/etc/default/grub
/usr/sbin/grub-mkconfig: 1: /etc/default/grub: *******#: not found
그 *는 내 계정 비밀번호와 비슷한 숫자입니다. 나도 시도했지만 sudo update-grub2
역시 효과가 없었습니다. 어떡해?
답변1
시스템의 명령 update-grub
(실제로 명령에 대한 약간의 단축키 )에는 아무런 문제가 없습니다. 파일을 편집할 때 파일 grub-mkconfig -o /boot/grub/grub.cfg
에 정크 텍스트를 삽입했을 뿐입니다 ./etc/default/grub
zanna@toaster:~$ sudo update-grub
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 35: /etc/default/grub: junk: not found
내 경우에는 junk
35번째 줄에 있습니다. 귀하의 경우에는 1번째 줄에 있습니다. 처음에 잘못된 텍스트를 삽입했거나 전체 파일을 덮어썼습니다.
파일을 다시 편집하고 포함된 줄 *******
(또는 질문에 표시되는 모든 항목)과 거기에 있어서는 안 되는 삽입한 다른 줄을 제거하여 이 문제를 해결할 수 있습니다.
일반적으로 시스템에 대한 가장 최근에 다운로드한 패키지 관리자 버전의 파일을 에서 찾을 수 있습니다 /var/lib/ucf/cache/:etc:default:grub
. 예를 들어 다음을 실행하여 이 파일을 읽을 수 있습니다.
cat /var/lib/ucf/cache/:etc:default:grub
다음 예를 실행하여 편집한 파일과 이 파일의 차이점을 확인할 수 있습니다.
diff /var/lib/ucf/cache/:etc:default:grub /etc/default/grub
누락되거나 파손된 부품을 교체해야 하는 최악의 시나리오에서는 /etc/default/grub
이 명령을 사용할 수 있습니다(참고:이 명령으로 기존 항목을 /etc/default/grub
자동으로 덮어씁니다.).
sudo cp /var/lib/ucf/cache/:etc:default:grub /etc/default/grub
답변2
파일이 /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=hidden
GRUB_TIMEOUT=10
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"
당신은 시도 할 수 있습니다:
sudo grub-mkconfig -o /boot/grub/grub.cfg
또한 참조하십시오이 우분투 포럼 스레드.