LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 02-11-2017, 08:35 PM   #1
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Rep: Reputation: 169Reputation: 169
Can not update grub


I can not update grub after making changes.

Code:
andy@7:~$ sudo update-grub
/usr/sbin/grub-mkconfig: 1: /etc/default/grub: #: not found
 
Old 02-11-2017, 09:45 PM   #2
ardvark71
LQ Veteran
 
Registered: Feb 2015
Location: Oregon, USA
Distribution: Lubuntu 14.04, Windows Vista
Posts: 6,277
Blog Entries: 3

Rep: Reputation: 839Reputation: 839Reputation: 839Reputation: 839Reputation: 839Reputation: 839Reputation: 839
Quote:
Originally Posted by Fixit7 View Post
I can not update grub after making changes.
Hi Andy...

Using the code tags, please post the entire contents found in...

Code:
/etc/default/grub
There might be something in there that's off. Also, take a look here for examples of what could be wrong.

Regards...
 
1 members found this post helpful.
Old 02-11-2017, 09:45 PM   #3
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,474
Blog Entries: 15

Rep: Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159
Code:
/etc/default/grub: #: not found
-::Looks like that file is missing.-::-

Do you have a backup of /etc/default/grub?
 
1 members found this post helpful.
Old 02-11-2017, 09:51 PM   #4
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Quote:
Originally Posted by ardvark71 View Post
Hi Andy...

Using the code tags, please post the entire contents found in...

Code:
/etc/default/grub
There might be something in there that's off. Also, take a look here for examples of what could be wrong.

Regards...
Code:
# 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_HIDDEN_TIMEOUT=10
#GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=10

#GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true

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"
 
Old 02-11-2017, 09:51 PM   #5
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Quote:
Originally Posted by Ztcoracat View Post
Code:
/etc/default/grub: #: not found
-::Looks like that file is missing.-::-

Do you have a backup of /etc/default/grub?
No, the grub file is there.
 
Old 02-11-2017, 09:56 PM   #6
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: Devuan+lxde
Posts: 655

Rep: Reputation: 190Reputation: 190
Assuming it is BIOS and not uefi, did you run
Code:
grub-mkconfig -o /boot/grub/grub.cfg
?
 
1 members found this post helpful.
Old 02-11-2017, 10:02 PM   #7
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Before I run that command, what does it do ?

I have been editing grub with Geany.

Last edited by Fixit7; 02-11-2017 at 10:04 PM.
 
Old 02-11-2017, 10:04 PM   #8
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: Devuan+lxde
Posts: 655

Rep: Reputation: 190Reputation: 190
It generates a configuration file. See here

You should then be able to run update-grub

Last edited by TheEzekielProject; 02-11-2017 at 10:07 PM.
 
1 members found this post helpful.
Old 02-11-2017, 10:44 PM   #9
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
I get this message.

Quote:
andy@7:~$ sudo grub-mkconfig -o /boot/grub/grub.cfg
[sudo] password for andy:
/usr/sbin/grub-mkconfig: 1: /etc/default/grub: #: not found
 
Old 02-11-2017, 10:58 PM   #10
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: Devuan+lxde
Posts: 655

Rep: Reputation: 190Reputation: 190
A Google search for similar messages seems to suggest a malformed character of some sort. You mentioned you edited Grub with Geany and I'd bet it comes from that. I'd imagine one of the # being the culprit here

Code:
/usr/sbin/grub-mkconfig: 1: /etc/default/grub: #: not found
What changes did you make with Geany?
 
1 members found this post helpful.
Old 02-11-2017, 11:36 PM   #11
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
I did preface some lines with #.

I will take them out and see what happens.

I was trying to get a grub menu to show up when booting up.
 
Old 02-11-2017, 11:38 PM   #12
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,474
Blog Entries: 15

Rep: Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159
Did a recent update or upgrade include upgrading the kernel?

-If you remember what changes you made you can always undue what you did:-

http://askubuntu.com/questions/36272...ub-doesnt-work

-::-I generally use nano or vi to edit that file.-::-
 
1 members found this post helpful.
Old 02-11-2017, 11:44 PM   #13
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
You get the gold star. :-)

I found a backup copy of grub and copied it over the version with too many "#" in it.

Now I can run sudo update-grub successfully.
 
1 members found this post helpful.
Old 02-11-2017, 11:53 PM   #14
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,474
Blog Entries: 15

Rep: Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159
Quote:
Originally Posted by Fixit7 View Post
I did preface some lines with #.

I will take them out and see what happens.

I was trying to get a grub menu to show up when booting up.
BTW,Ubuntu does not display the GRUB menu by default. To see GRUB during boot you need to press the right-hand SHIFT key during boot.
------------------------------------------------------------------------------------------

In order to get Grub to show you should be able to put a # (pound sign) in front of
Code:
GRUB_HIDDEN_TIMEOUT=0
That should of worked. And I see that you uncommented:
Code:
GRUB_TIMEOUT=10
That should of given you 10 seconds of the Grub Menu.
 
Old 02-11-2017, 11:54 PM   #15
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,474
Blog Entries: 15

Rep: Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159Reputation: 1159
Quote:
Originally Posted by Fixit7 View Post
You get the gold star. :-)

I found a backup copy of grub and copied it over the version with too many "#" in it.

Now I can run sudo update-grub successfully.
Cool!-
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Black screen after grub following update. Now can't access Timeshift to rollback update. mgerson Linux Mint 7 02-27-2016 03:40 AM
update-grub (grub-probe) failed by unknown filesystem. yek Linux - Software 7 03-13-2015 09:38 AM
[SOLVED] grub-install and grub-update are ignored CollieJim Linux - Software 11 01-14-2015 02:25 AM
[SOLVED] Recurring Grub rescue mode after update-grub harris4got Linux - Software 6 04-23-2012 09:30 AM
GRUB splashimage configuration / update GRUB rudL Linux - Software 1 05-10-2004 07:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 11:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration