sudo update-grub is not working

Asked by adameus

i installed ubuntu in windows vista with wubi.exe..then i installed startup manager with ubuntu software center..and i get a error message when ubuntu opening vga=769 is ..... gfxpayload=640x480x8,640x480 i cant fix this error message ...
   i search some articles but when i write in terminal

                obo-mus@ubuntu:~$ sudo update-grub
                /etc/default/grub: 1: If: not found
                 obo-mus@ubuntu:~$

     why this file not found??and how to i fix this startup correctly?? i cannot run sudo update-grub.. it just say ''/etc/default/grub: 1: If: not found''

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub2 Edit question
Assignee:
No assignee Edit question
Solved by:
adameus
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

I can give you my default file so you can create the file, sounds like yours is bad or missing

Run:

gksudo gedit /etc/default/grub

delete ALL the text and add this code:

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
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 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_LINUX_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

Save the new file and close gedit, then run:

sudo update-grub

Should be ok

Revision history for this message
delance (olivier-delance) said :
#2

I don't understand question. Do you still use Wubi or did you a true dual boot ?

Revision history for this message
adameus (mustafakara89) said :
#3

thank u so much but i have to explain again.. i can delete all the text in grub..then i save the grub text file.it's OK. but after the grub text , i have to run update-grub u know.. when i try to run update-grub in terminal, it cannot run update-grub..because terminal write that codes >>>

               i write in terminal 'sudo update-grub' then terminal cannot do that command bcs it writes

                      obo-mus@ubuntu:~$ sudo update-grub
                        /etc/default/grub: 1: If: not found
                       obo-mus@ubuntu:~$

i dont understand why ''/etc/default/grub: 1: If: not found'' i didnt run ''sudo update-grub''

Revision history for this message
adameus (mustafakara89) said :
#4

delance , when my computer is booting firstly open Windows Boot Manager (1.Vista 2.Ubuntu) then i select Ubuntu.. After selected Ubuntu opened Grub Boot manager [[1.Ubuntu 2.Ubuntu (recovery mode) 3.Vista loader ]]

Revision history for this message
delance (olivier-delance) said :
#5

Do you still use Wubi or did you a true dual boot ? Please, answer question.
Could you post /etc/default/grub

Revision history for this message
adameus (mustafakara89) said :
#6

yes delance i use wubi, because if i want i can delete ubuntu in windows add/remove programs..i just use wubi ..

Revision history for this message
adameus (mustafakara89) said :
#7

and delance , i didnt use any dual boot program..when i install ubuntu in windows ,wubi make dual boot settings automatically..i didnt do anything..

Revision history for this message
adameus (mustafakara89) said :
#8

i look files in /etc/default..and i see 'grub'..but all files are secret file..

Revision history for this message
adameus (mustafakara89) said :
#9

finally sudo update-grub worked..i ll restart maybe problem solved..

obo-mus@ubuntu:~$ sudo gedit /etc/default/grub
[sudo] password for obo-mus:
obo-mus@ubuntu:~$ sudo update-grub
Generating grub.cfg ...
cat: /boot/grub/video.lst: Böyle bir dosya ya da dizin yok
Found linux image: /boot/vmlinuz-2.6.35-22-generic
Found initrd image: /boot/initrd.img-2.6.35-22-generic
Found Windows Vista (loader) on /dev/sda1
done
obo-mus@ubuntu:~$

Revision history for this message
adameus (mustafakara89) said :
#10

my problem solved..but ubuntu opening with blank screen ..i ll fix it thank u so much :))

Revision history for this message
Tom (tom6) said :
#11

Hi :)

The Wubi guide is here
https://wiki.ubuntu.com/WubiGuide

To see secret files in the file-browser, probably "Nautilus", click on the browser's menus at the top of the file-browser's window

View - "Show hidden files"

double-clicking on the file should allow you to see inside the file but not to write to it. It should open in "read only" mode which will allow you to copy&paste it's contents into here.

I do have a strong feeling we are going the wrong way with this because i think that the wubi install uses the Windows bootloader or grub4dos or something installed in Windows, not in Ubuntu. I could easily be wrong tho.

The problem with the Wubi is that it is highly dependent on Windows systems, particularly the ones that are known to be particularly flaky. While many people have it running fine for many years and although it does suit certain specific scenarios better than a proper dual-boot install i would still say that Wubi is not as good as a proper install, particularly for noobs to linux. I still don't feel ready to run it myself.

I can understand trying it when you are new but really it would be much better at this point to do a simple proper dual-boot install and try to uninstall the Wubi. Of course uninstalling it means using a Windows uninstaller which tend to be fairly hideous and tend to leave traces of things floating around the system so you might need to use the Wubi guide's part 8 of section 8 to help sort Windows out.

Oddly a proper dual-boot install is much easier to get rid of completely leaving absolutely no trace of it on your system although you would have to use linux tools to do so. Note that in the fairly recent space-station virus story it was only all the Windows systems that got knocked out. All the command&control systems were unharmed as they were running linux.

While installing Windows tends to be expensive and time-consuming you will find the proper dual-boot install or any normal linux install is fairly quick and painless. With both Windows and linux installs you often need to spend some time trouble shooting a few things but linux forums, such as this one, are good at helping. With a Windows install you often need to install and do updates for many packages the equivalents of which are already included in the initial install in linux which saves a lot of time.

This guide should help set-up a dual-boot
https://help.ubuntu.com/community/DualBoot
but really it tends to be easier to just boot-up your machine from the Ubuntu Cd/Usb to a LiveCd session (even called that if it's done using a Usb stick) and use the installer icon on it's desktop
https://help.ubuntu.com/community/LiveCD
Just take care to read the installer's window when you get to the "Partitioning Section"

Good luck and regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#12

Hi :)

Ahh, good to hear you solved a Wubi problem!! Nicely done!! I think that to fix the desktop just reboot. If that doesn't do the trick then go up to the top taskbar and click on

System - Administrator - "Synaptic Package Manager"

In synaptic just click on

Edit - "Fix broken packages"

and then click on "Apply". After trying that i would then click on "Mark all updates" and click apply again although i would leave that until you can leave the machine to get on with it as the first updates may take some time!

If that doesn't fix it then try either of synaptic's search tools to find "ubuntu-desktop" and reinstall that.

Since this is a fresh install of Ubuntu it would be good to quickly work through the Medibuntu guide
https://help.ubuntu.com/community/Medibuntu
to sort the multimedia issues. Don't worry about not understanding everything in the guide. I had used it several times before i understood any of it. I just avoided the bit about removing "nonfree components" and still do. I haven't had to pay anything yet but i don't live in the USA so i probably don't need to anyway.

To complete multimedia set-up i like to get flash working so look in synaptic for "flash player" and install the adobe "nonfree" one, again it doesn't cost anything. Nonfree tends to mean "not OpenSource" and the free is as in "Freedom" rather than being about cash cost. I then install mplayer and vlc because they are good multimedia players and bring in extra codecs and stuff.

I hope this helps!
Good luck and regards from
Tom :)

Revision history for this message
adameus (mustafakara89) said :
#13

tom , thank u so much for ur answers and suggestions // i wonder linux/ubuntu and i am sure that i ll ask some questions again :))
 good luck

Revision history for this message
Tom (tom6) said :
#14

You are welcome :)
Good luck and regards from
Tom :)