我的软硬件环境如下:
1 2 3 | 系统:Ubuntu 12.04 64位 显卡:Geforce 7300 GT 显示器:ViewSonic VG800 |
安装完显卡驱动后,启动画面和控制台都无法显示,显示器提示“频率超出范围”。原因就是启动画面和控制台的分辨率是我的显示器所不支持的,解决方法当然是修改它们的分辨率。
1)安装 grub2
1 | $ sudo apt-get install grub2
|
2)修改 /etc/default/grub 文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | $ sudo gedit /etc/default/grub :::bash # 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=1280x1024 #去掉此行的注释,将值修改为自己显示器的最佳分辨率 # 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" |
3) 修改 /etc/grub.d/00_header 文件
在 set gfxmode=${GRUB_GFXMODE}
这行下面添加新行,内容是:set gfxpayload=keep
4)更新 grub:
1 | $ sudo update-grub #或者sudo update-grub2 |
5)重启系统
本作品由 Yysfire 创作,采用进行许可。转载时请在显著位置标明本文永久链接:
http://yysfire.github.io/linux/change-startup-screen-and-resolution-of-ubuntu-12.04.html