centos7+qt5开发环境配置

来源:互联网 发布:西安航空学院网络教育 编辑:程序博客网 时间:2024/05/19 17:02

1. 博客背景

最近自学Qt,顺便学习下Centos7,故打算在虚拟机中搭建环境。

2. 搭建步骤

2.1下载Centos镜像:     http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-Everything-1611.iso2.2 通过vmware12安装Centos7虚拟机2.3 搭建完虚拟机后,启动发现是进的是shell模式,因为本人是为了学习qt,故需要使用桌面。  2.3.1 配置网络    # cd /etc/sysconfig/network-scripts    # vim ifcfg-ens33   TYPE=Ethernet   BOOTPROTO=none #开机协议,最常见的三个参数如下:static(静态IP) none(不指定,设置固定ip的情况,这个也行,但是如果要设定多网口绑定bond的时候,必须设成none)   DEFROUTE=yes   IPV4_FAILURE_FATAL=no   IPV6INIT=yes   IPV6_AUTOCONF=yes   IPV6_DEFROUTE=yes   IPV6_FAILURE_FATAL=no   IPV6_ADDR_GEN_MODE=stable-privacy   NAME=ens33      UUID=738db9d4-ff21-4447-bb2f-c287b2793d8a   DEVICE=ens33 #设备名,不要自己乱改,和文件ifcfg-ethX里的ethX要一致   ONBOOT=yes #启动或者重启网络时,是否启动该设备,yes是启动,no是不启动   DNS1=192.168.0.1          #NDS   IPADDR=192.168.0.100      #IP地址   PREFIX=24   GATEWAY=192.168.0.1      #网关   IPV6_PEERDNS=yes   IPV6_PEERROUTES=yes   IPV6_PRIVACY=no   # service network restart   # ifconfig IP  #检查网络设置是否生效 2.3.2 安装vim文本编辑器   # yum install vim 2.3.3 安装桌面环境   # yum groupinstall "GNOME Desktop" "Graphical Administration Tools"   # ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target   # reboot2.3.4 安装搜狗输入法(参考原文:http://www.cnblogs.com/Yiutto/p/6204085.html 且原文提供了第二种方法,实际操作两种效果都没有用)  2.4.1 添加源  Fedora 19/20/21/rawhide 使用以下命令添加源:    # yum install dnf-plugins-core     # dnf copr enable mosquito/myrepo     # yum localinstall      http://download1.rpmfusion.org/free/fedora/rpmfusion-     free-release-$(rpm -E %fedora).noarch.rpm       http://download1.rpmfusion.org/nonfree/fedora/rpmfusi     on-nonfree-release-$(rpm -E %fedora).noarch.rpm  RHEL/CentOS 6/7 不包含 dnf 软件包,使用以下命令添加源:  # yum-config-manager --add-repo=https://copr.fedoraproject.org/coprs/mosquito/myrepo/repo/epel-$(rpm -E %?rhel)/mosquito-myrepo-epel-$(rpm -E %?rhel).repo  # yum install epel-release   # yum localinstall   http://li.nux.ro/download/nux/dextop/el$(rpm -E %rhel)/x86_64/nux-dextop-release-0-2.el$(rpm -E %rhel).nux.noarch.rpm   http://download1.rpmfusion.org/nonfree/el/updates/$(rpm -E %rhel)/x86_64/rpmfusion-nonfree-release-$(rpm -E %rhel)-1.noarch.rpm   http://download1.rpmfusion.org/free/el/updates/$(rpm -E %rhel)/x86_64/rpmfusion-free-release-$(rpm -E %rhel)-1.noarch.rpm  注意:rhel/centos 6/7 需要添加 epel 、 rpmfusion 、Nux Dextop 源。  最终采用了系统自带的输入源  (参考文献:http://www.cnblogs.com/zhangXingSheng/p/6575890.html)  2.3.5 centos7安装出现license information(license not accepted)解决办法:  若出现license information(license not accepted),即说明需要同意许可信息,输入1-回车-2-回车-c-回车-c回车,即可解决。2.4 安装qt5及qtcrator   2.4.1 安装qt5  软件管理里面直接安装QtCrator以及qt5相关工具即可。
原创粉丝点击