VM虚拟机里 安装 CentOS5.5 VMTools 与GCC编译器.docx_第1页
VM虚拟机里 安装 CentOS5.5 VMTools 与GCC编译器.docx_第2页
VM虚拟机里 安装 CentOS5.5 VMTools 与GCC编译器.docx_第3页
VM虚拟机里 安装 CentOS5.5 VMTools 与GCC编译器.docx_第4页
VM虚拟机里 安装 CentOS5.5 VMTools 与GCC编译器.docx_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

首先声明,笔者只是在操作过程中查找资料,然后整理,方便后来的人参考。仅此而已。第一步 安装VMTools目的:让虚拟机Linux操作系统操作起来更舒服。1.在VM菜单中选择:VMInstalls VMwaretools2. VMware会自动加载一个虚拟光盘,然后打开后里面会有两个文件,其中的vmware-tools-distrib.tar.gz,这就是VMware Tools的Linux安装包。在终端下进入这个文件夹,用“cp /vmware-tools-distrib.tar.gz /tmp”命令即可。 3.接下来应该解压缩vmware-tools-distrib.tar.gz文件。首先进入自己的tmp目录,用“cd /tmp”命令,然后用“tar xzf vmware-tools-distrib.tar.gz”命令将其解压缩,把它释放到同名目录下(即vmware-tools-distrib目录)。 PS:你也可以在图形界面下用鼠标操作步骤2和3,会更直观些。3. 自己用户名的帐号默认下是没有权限安装VMtools的,要用“su root”切换到root帐号。4. 然后用“cd vmware-tools-distrib”进入解压后的目录,用“ls”命令显示其下的内容,从中可以看到vmware-install.pl是VMware Tools的安装程序。 5.最后用“./vmware-install.pl”命令来运行该安装程序,然后根据屏幕提示一路回车。到此整个安装过程算是完成了。 6.最后在终端中会显示please choose one of the following display size,然后是一排选项,从640*480到2364*1773 共十几个分辨率的选项,键入你要的分辨率前的数字,然后回车就可以。安装步骤如下所示:(如果碰到yes就按【enter】,如果遇到no就输入yes,直到安装完成,重启计算机,VMTools生效。)rootrd01 # mount /cdrom # 有时可能加载不了,这时就要先将系统关闭,再手动指定 ISO 映像,看下图rootrd01 # cd /cdromrootrd01 # ls -arootrd01 # cp VMwareTools-5.5.1-19175.tar.gz /tmprootrd01 # cd /tmprootrd01 # tar zxpf VMwareTools-5.5.1-19175.tar.gzrootrd01 # cd vmware-tools-distribrootrd01 vmware-tools-distrib# ./vmware-install.pl如果出现recomanded NO 的话,就输入yes.Creating a new installer database using the tar3 format.Installing the content of the package. # 安装过程的画面,全部使用默认值,一直按 Enter 就对了In which directory do you want to install the binary files?/usr/binWhat is the directory that contains the init directories (rc0.d/ to rc6.d/)?/etc/rc.dWhat is the directory that contains the init scripts?/etc/rc.d/init.dIn which directory do you want to install the daemon files?/usr/sbinIn which directory do you want to install the library files?/usr/lib/vmware-toolsThe path /usr/lib/vmware-tools does not exist currently. This program is goingto create it, including needed parent directories. Is this what you want?yes In which directory do you want to install the documentation files?/usr/share/doc/vmware-toolsThe path /usr/share/doc/vmware-tools does not exist currently. This program isgoing to create it, including needed parent directories. Is this what you want?yesThe installation of VMware Tools 5.5.1 build-19175 for Linux completedsuccessfully. You can decide to remove this software from your system at anytime by invoking the following command: /usr/bin/vmware-uninstall-tools.pl.Before running VMware Tools for the first time, you need to configure it byinvoking the following command: /usr/bin/vmware-config-tools.pl. Do you wantthis program to invoke the command for you now? yesStopping VMware Tools services in the virtual machine:Guest operating system daemon: 确定 Trying to find a suitable vmhgfs module for your running kernel.The module bld-2.6.9-5.EL-i686-RHEL4 loads perfectly in the running kernel.pcnet32 30153 0Unloading pcnet32 moduleTrying to find a suitable vmxnet module for your running kernel.The module bld-2.6.9-5.EL-i686-RHEL4 loads perfectly in the running kernel.Detected X.org version 6.8.关闭控制台鼠标服务: 确定 启动控制台鼠标服务: 确定 Please choose one of the following display sizes (1 - 13):# 显示分辨率,这里是以 1024x768 为例# VMware Tools 安装的时候,会自动修改 X server 的配置文件1 640x4802【设置】出现如下对话框:点击VMSetting-Option-Share Folders-add-选取共享文件夹路经 -【Next】-【Finsh】rootlocalhost cd /mnt/hgfs/sharerootlocalhost ls#现在就可以看到WINDOWS下的SHARE那个文件夹下的文件了。这样就可以很方便的访问WINDOWS下的文件了。第三步 安装GCC编译器目的:让你的Linux操作系统活动起来,完成C开发。CentOs是linux系统的一种,只要该操作系统安装了gcc软件包,就可以在linux操作系统中进行C语言程序设计。CentOS安装光盘中带有gcc的安装包。 笔者的操作系统是XP,通过虚拟机安装了CentOS 5.5。CentOS默认安装之后,是没有安装gcc开发包的,需要手动安装,步骤如下:1 打开VMWare界面,选择菜单VM-Settings,在对话框中选择CDROM,设置参数为Use ISO image,选择CentOS镜像安装文件;2 启动虚拟机中的CentOS系统,用root登录(建议用ROOT权限登陆,可以省略好些权限问题),在桌面上用鼠标右键新建一终端窗口;3 在终端中输入 cd /media/CentOS_5.2_Final/CentOS 回车4 在终端中继续分别输入如下命令 rpm -ivh cpp-4.1.2-48.el5.i386.rpm回车 rpm -ivh kernel-headers-2.6.18-194.el5.i386.rpm回车 rpm -ivh glibc-headers-2.5-49.i386.rpm 回车 rpm -ivh glibc-devel-2.5-24.i386.rpm 回车 rpm -ivh libgomp-4.4.0-6.el5.i386.rpm 回车 rpm -ivh gcc-4.1.2-48.el5.i386.rpm 回车这样gcc就安装好了,可以用如下命令测试一下gcc - v 测试一下,例如笔者就显示出gcc 版本 4.1.2 20080704 (Red Hat 4.1.2-48)第四步 升级GCC(如果有需求的话)1.下载gcc-4.6.1安装包gcc各版本浏览地址:/gnu/gcc/gcc-4.6.1浏览地址:/gnu/gcc/gcc-4.6.1/gcc-4.6.1下载地址:/gnu/gcc/gcc-4.6.1/gcc-4.6.1.tar.bz22.将gcc-4.6.1.tar.bz2放到/opt文件夹下解压L #cd / opt#tar xjvf gcc-4.6.1.tar.bz23.创建安装目录 opt#mkdir /usr/local/gcc-4.6.1/4.进入安装目录 opt#cd /usr/local/gcc-4.6.1/5.配置安装文件 gcc-4.6.1#/opt/gcc-4.6.1/configure -prefix=/usr/local/gcc-4.6.1(执行源目录 /opt/gcc-4.6.1/中的configure命令,配置将gcc安装到目标目录/usr/local/gcc-4.6.1/下,这里prefix选项代表要将该库安装在哪里,我是装在/usr/local/gcc-4.6.1目录下,后面的安装都会用到这个选项)如果执行这步的时候出现了如下错误:- gcc-4.6.1# /opt/gcc-4.6.1/configure -prefix=/usr/local/gcc-4.6.1/checking build system type i686-pc-linux-gnuchecking host system type i686-pc-linux-gnuchecking target system type i686-pc-linux-gnuchecking for a BSD-compatible install /usr/bin/install -cchecking whether ln works yeschecking whether ln -s works yeschecking for a sed that does not truncate output /bin/sedchecking for gawk gawkchecking for gcc nochecking for cc nochecking for cl.exe noconfigure: error: in /usr/local/gcc-4.6.1:configure: error: no acceptable C compiler found in $PATHSee config.log for more details.-上面错误说明$PATH里没有找到C的编译器如果系统有gcc编译器,那就设置下环境变量比如:export PATH=$PATH:/usr/local/bin如果没有找到那么先安装gcc低版本的rpm包插入linux软件盘(一般在第一张或第二张),挂载光盘,按下面顺序依次安装: opt#rpm -ivh opt#rpm -ivh opt#rpm -ivh opt#rpm -ivh opt#rpm -ivh opt#rpm -ivh gcc-4.1.2-48.el5.i386.rpm重复步骤5,又有新错误了,下面是部分错误代码 !如果没有错误,直接跳到步骤7 !-configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.Try the -with-gmp, -with-mpfr and/or -with-mpc options to specifytheir locations.-错误说明要安装gcc需要GMP、MPFR、MPC这三个库,可从/pub/gcc/infrastructure/下载相应的压缩包。由于MPFR依赖GMP,而MPC依赖GMP和MPFR,所以要先安装GMP,其次MPFR,最后才是MPC。这里三个库我用的版本分别是gmp4.3.2,mpfr2.4.2和mpc0.8.1,都放在 /opt文件夹下。.安装 opt# tar jxvf opt# mkdir /usr/local/ opt# cd /usr/local/gmp-4.3.2cd /usr/local/ gmp-4.3.2#/opt/gmp-4.3.2/configure -prefix=/usr/local/gmp-4.3.2/opt/gmp-5.0.4/configure -prefix=/usr/local/ gmp-4.3.2# make (编译) gmp-4.3.2# make install (执行安装)最好make check 检查一下。以上后两步可以输入 make&make install,以下同理。安装 opt# tar jxvf opt# mkdir /usr/local/ opt# cd /usr/local/mpfr-2.4.2cd /usr/local/ mpfr-2.4.2#/opt/mpfr-2.4.2/configure -prefix=/usr/local/mpfr-2.4.2 -with-gmp=/usr/local/gmp-4.3.2/opt/mpfr-3.1.0/configure -prefix=/usr/local/mpfr-3.1.0 -with-gmp=/usr/local/gmp-5.0.4(注意配置的时候要把依赖关系选项加进去) mpfr-2.4.2# mpfr-2.4.2# make install安装 opt# tar jxvf opt# mkdir /usr/local/ opt# cd /usr/local/mpc-0.8.1cd /usr/local/ mpc-0.8.1#/opt/mpc-0.8.1/configure -prefix=/usr/local/mpc-0.8.1 -with-gmp=/usr/local/gmp-4.3.2 -with-mpfr=/usr/local/mpfr-2.4.2/opt/mpc-0.8.2/configure -prefix=/usr/local/mpc-0.8.2 -with-gmp=/usr/local/gmp-5.0.4 -with-mpfr=/usr/local/ mpc-0.8.1# mpc-0.8.1# make install再次安装GCC 配置安装选项 mpc-0.8.1# cd /usr/local/ gcc-4.6.1#/opt/gcc-4.6.1/configure -prefix=/usr/local/gcc-4.6.1 -enable-threads=posix -disable-checking -disable-multilib -enable-languages=c,c+ -with-gmp=/usr/local/gmp-4.3.2 -with-mpfr=/usr/local/mpfr-2.4.2 -with-mpc=/usr/local/mpc-0.8.1 gcc-4.6.1#/opt/gcc-4.6.1/configure -prefix=/usr/local/gcc-4.6.1 -enable-threads=posix -disable-checking -disable-multilib -enable-languages=c,c+ -with-gmp=/usr/local/gmp-5.0.4 -with-mpfr=/usr/local/mpfr-3.1.0 -with-mpc=/usr/local/mpc-0.8.26.编译安装文件 gcc-4.6.1#make大概需要1个小时左右,喝杯coffee,慢慢等待吧!一个小时后第二个错误出现了:打开/usr/local/gcc-4.6.1/i686-pc-linux-gnu/libgcc/config.logctrl+f查找error 发现如下错误/-/usr/local/gcc-4.6.1/./gcc/cc1: error while loading shared libraries: libmp

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论