Centos 7 安装记录

0.安装中选择最小安装

1.centos7安装图形界面

之前转载过一篇“centos6安装图形界面”的文章,地址见http://my.oschina.net/u/1169607/blog/335304,下面介绍下centos7安装图形界面的方法。

安装好字符操作系统后,使用网络安装(网络安装比较简单,不需要配置yum文件):

yum groupinstall "GNOME Desktop" -y

startx

centos7和centos6的安装方法不太一样,只需要执行上面步骤即可。

2.让linux启动后自动进入图形界面或文本界面(转载)

a.开机进入图形界面:安装时选图形启动方式或把/etc /inittab的id:x:initdefault:这行改成id:5:initdefault:。

b.开机不进入图形界面:安装时选文本启动方式或把/etc/inittab的id:x:initdefault:这行改成id:3:initdefault:。

3.安装显卡驱动

3.1安装准备

  1. 根据nvidia显卡的具体型号,从官方网站下载驱动,我的是NVIDIA-Linux-x86-331.20.run

    http://www.geforce.cn/drivers

    如: wget http://cn.download.nvidia.com/XFree86/Linux-x86_64/280.13/NVIDIA-Linux-x86_64-280.13.run;

    具体的版本是否正确,会在安装时候提示,提示里面会给出你的正确版本,比如40.xx 就是适合 Geforce310M[218M]

  2. 安装编译环境:gcc、kernel-devel、kernel-headers

    [root@localhost ~]# yum -y install gcc kernel-devel kernel-headers

  3. 修改/etc/modprobe.d/blacklist.conf 文件,以阻止 nouveau 模块的加载

    方法: 添加blacklist nouveau,注释掉blacklist nvidiafb

    修改后内容如下:

    #

    # Listing a module here prevents the hotplug scripts from loading it.

    # Usually that'd be so that some other driver will bind it instead,

    # no matter which driver happens to get probed first.  Sometimes user

    # mode tools can also control driver binding.

    #

    # Syntax: see modprobe.conf(5).

    #

    # watchdog drivers

    blacklist i8xx_tco

    # framebuffer drivers

    blacklist aty128fb

    blacklist atyfb

    blacklist radeonfb

    blacklist i810fb

    blacklist cirrusfb

    blacklist intelfb

    blacklist kyrofb

    blacklist i2c-matroxfb

    blacklist hgafb

    #blacklist nvidiafb

    blacklist rivafb

    blacklist savagefb

    blacklist sstfb

    blacklist neofb

    blacklist tridentfb

    blacklist tdfxfb

    blacklist virgefb

    blacklist vga16fb

    blacklist viafb

    blacklist nouveau

    # ISDN - see bugs 154799, 159068

    blacklist hisax

    blacklist hisax_fcpcipnp

    # sound drivers

    blacklist snd-pcsp

    # I/O dynamic configuration support for s390x (bz #563228)

    blacklist chsc_sch

    对于CentOS7,不同之处是,blacklist.conf的位置是在/usr/lib/modprobe.d/dist-blacklist.conf
    并且在加上blacklist nouveau之后还要加上一行options nouveau modeset=0
    之后重启电脑安装即可

  4.  

    重新建立initramfs image文件

    [root@localhost ~]# mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak

    [root@localhost ~]# dracut /boot/initramfs-$(uname -r).img $(uname -r)

  5.  

    修改/etc/inittab,使系统开机进入init 3文本模式:

    将最后一行“id:5:initdefault:”修改成“id:3:initdefault:”(不包含引号)

    注释:5代表系统启动时默认进入x-window图形界面,3代表默认进入终端模式。

 

重启

[root@localhost ~]# reboot now

3.2 安装NVIDIA驱动

  1. 输入root和password,进入根用户模式下,确保nouveau kernel driver没有被加载

    [root@localhost ~]# lsmod | grep nouveau

  2. 进入驱动程序所在目录,开始安装

    [root@localhost ~]# chmod +x NVIDIA-Linux-x86-331.20.run

    [root@localhost ~]# ./NVIDIA-Linux-x86-331.20.run

    安装过程中,根据提示选择accept,yes 或 OK,即可完成安装:

         如果提示有旧驱动,询问是否删除旧驱动,选Yes;

         如果提示缺少某某模块(modules),询问是否上网下载,选no;

         如果提示编译模块,询问是否进行编译,选ok;

         如果提示将要修改xorg.conf,询问是否允许,选Yes;

         接下来就是等待安装完成。

    安装过程中会可能会提示:

    error:unable to find the kernel source tree for the currently running kernel. please make sure you have installed the kernel source files for your kernel and that htey are properly configured; on red hat linux system, for example, be sure you have the 'kernel-source' or 'kernel-devel' RPM installed. if you know the correct kernel source files are installed ,you may specify the kernel source path with the '--kernel-source-path' command line option.

    安装kernel-devel包:yum install kernel-devel-内核版本号,(内核版本号通过uname -r查看),然后在安装显卡驱动时指定路径:./Nvidia*.sh –kernel-source-path=/usr/src/kernels/内核版本

  3.  

    修改/etc/inittab,使系统开机进入init 5图形界面模式

    将最后一行“id:3:initdefault:”修改成“id:5:initdefault:”

重启

[root@localhost ~]#reboot now

当看到Nvidia的logo后,安装成功,登陆后在系统- 首选项里可以看到NVIDIA X Server Settings菜单,可以查看基本信息及进行一些设置

     切记下载好的驱动程序不要放在有汉字的路径下

 参考网站:

http://jingyan.baidu.com/article/9f63fb91d7e6b5c8400f0e0c.html

http://blog.sina.com.cn/s/blog_5e4e6cf30102ux3t.html

http://www.2cto.com/os/201306/222165.html

http://blog.sina.com.cn/s/blog_49c0985a0102v3fa.html

原文地址:https://www.cnblogs.com/lvfeilong/p/2342rsfsfd.html