日历

« 2008-05-17  
    123
45678910
11121314151617
18192021222324
25262728293031

我的好友

统计信息

  • 访问量: 315
  • 日志数: 11
  • 图片数: 5
  • 文件数: 1
  • 建立时间: 2008-03-04
  • 更新时间: 2008-05-12

RSS订阅

LUPA让我认识了开源,而开源精神更加冲击着我的内心世界,它伴随着我的成长,我愿与它同在,深信它会使我们更加的强壮,使我们未来的路走的会更好、更远。开源这伟大的想法并非我们80后的人所提出的,但是,它需要我们去更好的发扬光大,让我们携手并进吧。

我的最新日志

  • 实例说明:F7系统下安装VMware虚拟机,解决安装过程中的错误提示

    2008-5-12

          虽然, linux系统可以使用wine来安装一些windows系统的程序,很大程度的方便了用户使用windows下的应用程序,但是,通过wine安装的应用程序,还是存在着一些缺点,兼容性并不是很好,如运行后,程序会提示出错及应用程序的一些功能无法实现等等问题,所以,为了方便的切换到windows系统,在Linux系统下安装虚拟机,模拟一个虚拟环境,用来安装windows系统。
    操作1:下载VMware-workstation-5.5.1-19175.tar.gz
    下载地址:
    http://download.chinaunix.net/download.php?id=22070&ResourceID=11140
    步骤2:解压
    [root@localhost VMware_for_linux]#tar zxvf VMware-workstation-5.5.1-19175.tar.gz
    步骤3:执行安装程序
    [root@localhost VMware_for_linux]#cd vmware-distrib
    [root@localhost vmware-distrib]# ./vmware-install.pl
    安装过程中,均为默认设置并回车,当出现以下提示信息:
    What is the location of the directory of C header files that match your running
    kernel? [/usr/src/linux/include]

    The path "/usr/src/linux/include" is not an existing directory
    .
    此时,无法继续安装下去。
    解决办法:
    步骤1:下载: vmware-any-any-update109.tar.gz
    下载地址:
    http://ftp.cvut.cz/vmware/vmware-any-any-update109.tar.gz
    步骤2: [root@localhost VMware_for_linux]# tar zxvf vmware-any-any-update109.tar.gz
    步骤3:[root@localhost VMware_for_linux]# cd vmware-any-any-update109
    步骤4: [root@localhost vmware-any-any-update109]# ./runme.pl
    一直按回车:
    What is the location of the directory of C header files that match your running
    kernel? [/lib/modules/2.6.21-1.3194.fc7/build/include]   #此时,会自动识别C头文件,直接回车即可.

    以下操作均按回车即可
    .
    .
    .
    .
    .

    Starting VMware services:
       Virtual machine monitor                                 [确定]
       Virtual ethernet                                        [确定]
       Bridged networking on /dev/vmnet0                       [确定]
       Host-only networking on /dev/vmnet1 (background)        [确定]
       Host-only networking on /dev/vmnet8 (background)        [确定]
       NAT service on /dev/vmnet8                              [确定]

    The configuration of VMware Workstation 5.5.1 build-19175 for Linux for this
    running kernel completed successfully.

    You can now run VMware Workstation by invoking the following command:
    "/usr/bin/vmware".

    Enjoy,

    --the VMware team


    [root@localhost vmware-any-any-update109]#
    步骤5:启动虚拟机vmware
    方法1:在终端下输入命令:vmware
    [root@localhost vmware-any-any-update109]# vmware
    方法2:单击“应用程序”->“其他”->“vmware workstation”菜单项,即可启动虚拟机,如图1所示:

    图1
    启动后的画面如图2所示:

    图2

  • 实例说明:利用工具方便、快捷的生成RPM与DEB包

    2008-5-11

    操作1:工具包的下载
    下载地址:
    http://asic-linux.com.mx/~izto/checkinstall/files/rpm/checkinstall-1.6.1-1.i386.rpm
    操作2:安装工具包
    [root@localhost home]#rpm –ivh checkinstall-1.6.1-1.i386.rpm
    操作3:源码文件内容
    [root@localhost hello]# ls
    aclocal.m4      configure       descrīption-pak  Makefile.am    pics
    autom4te.cache  configure.in    hello.c          Makefile.in
    autoscan.log    configure.scan  hello.h          missing
    config.h.in     depcomp         install-sh       mkinstalldirs

    操作4:配置源码文件
    [root@localhost hello]# ./configure
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking for gcc... gcc
    checking for C compiler default output... a.out
    checking whether the C compiler works... yes
    checking whether we are cross compiling... no
    checking for suffix of executables...
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ANSI C... none needed
    checking for style of include used by make... GNU
    checking dependency style of gcc... gcc3
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating config.h
    config.status: executing depfiles commands

    操作5:编译源码
    [root@localhost hello]# make
    make  all-am
    make[1]: Entering directory `/home/hello'
    source='hello.c' ōbject='hello.o' libtool=no \
    depfile='.deps/hello.Po' tmpdepfile='.deps/hello.TPo' \
    depmode=gcc3 /bin/sh ./depcomp \
    gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c `test -f 'hello.c' || echo './'`hello.c
    gcc  -g -O2   -o hello  hello.o
    make[1]: Leaving directory `/home/hello'

    操作6:生成RPM包或DEB包
    [root@localhost hello]# checkinstall        #此处也可以输入命令checkinstall -R直接生成RPM

    checkinstall 1.6.1, Copyright 2002 Felipe Eduardo Sanchez Diaz Duran
               This software is released under the GNU GPL.

    The checkinstallrc file was not found at:
    /usr/local/lib/checkinstall/checkinstallrc

    Assuming default values.

    The package documentation directory ./doc-pak does not exist.
    Should I create a default set of package docs?  [y]: y     

    准备软件包的文档……OK

    *** No known documentation files were found. The new package
    *** won't include a documentation directory.

    Please choose the packaging method you want to use.
    Slackware [S], RPM [R] 还是 Debian [D]?R        #R表示生成RPM包,D表示生成DEB包


    **************************************
    **** RPM package creation selected ***
    **************************************

    This package will be built according to these values:

    1 -  Summary: [ hello-1.0-3.tar.gz ]
    2 -  Name:    [ hello ]
    3 -  Version: [ 1.0 ]
    4 -  Release: [ 1 ]
    5 -  License: [ GPL ]
    6 -  Group:   [ Applications/System ]
    7 -  Architecture: [ i386 ]
    8 -  Source location: [ hello ]
    9 -  Alternate source location: [  ]
    10 - Requires: [  ]
    11 - Provides: [ hello ]

    输入一个数字来改变它们,或按回车键继续:1        

    #此为输入要修改的行号,如1表示设置summary内容
    Enter new summary:
    >> hello for linux提    #输入设置或修改的内容

    This package will be built according to these values:

    1 -  Summary: [ hello for linux ]
    2 -  Name:    [ hello ]
    3 -  Version: [ 1.0 ]
    4 -  Release: [ 1 ]
    5 -  License: [ GPL ]
    6 -  Group:   [ Applications/System ]
    7 -  Architecture: [ i386 ]
    8 -  Source location: [ hello ]
    9 -  Alternate source location: [  ]
    10 - Requires: [  ]
    11 - Provides: [ hello ]

    输入一个数字来改变它们,或按回车键继续:4
    Enter new release number:
    >> 3

    This package will be built according to these values:

    1 -  Summary: [ hello for linux ]
    2 -  Name:    [ hello ]
    3 -  Version: [ 1.0 ]
    4 -  Release: [ 3 ]
    5 -  License: [ GPL ]
    6 -  Group:   [ Applications/System ]
    7 -  Architecture: [ i386 ]
    8 -  Source location: [ hello ]
    9 -  Alternate source location: [  ]
    10 - Requires: [  ]
    11 - Provides: [ hello ]

    输入一个数字来改变它们,或按回车键继续:

    Installing with make install...

    ========================= Installation results ===========================
    make[1]: Entering directory `/home/hello'
    /bin/sh ./mkinstalldirs /usr/local/bin
      /usr/bin/install -c hello /usr/local/bin/hello
    make[1]: Nothing to be done for `install-data-am'.
    make[1]: Leaving directory `/home/hello'

    ======================== Installation successful ==========================
    cp:是否覆盖‘//var/tmp/LolgSDErNJnkWFcigqHAF/newfiles’? y

    把文件拷贝到临时目录……OK

    Striping ELF 二进制文件……OK

    压缩 man 手册页……OK

    创建文件列表……rm:是否删除一般文件‘/var/tmp/LolgSDErNJnkWFcigqHAF/newfiles’? y
    OK
    mv:是否覆盖‘/var/tmp/LolgSDErNJnkWFcigqHAF/newfiles.tmp’? y

    创建 RPM 包……OK

    NOTE: The package will not be installed

    删除临时文件……OK

    删除 doc-pak 目录……OK

    生成备份包……OK

    删除临时目录……OK


    **********************************************************************

    Done. The new package has been saved to

    /usr/src/redhat/RPMS/i386/hello-1.0-3.i386.rpm
    You can install it in your system anytime using:

          rpm -i hello-1.0-3.i386.rpm
    #此时就生成了rpm包了
    **********************************************************************

  • 实例说明:源码包生成RPM格式

    2008-4-16

    平台:Redhat 9.0系统
    制作RPM包之前,先介绍一下/usr/src/redhat/下的几个目录:
    BUILD目录:编译时存放临时文件
    SOURCES目录:存放.tar.gz源码包
    SPECS目录:存放spec文件
    RPMS目录:存放打包好的rpm文件
    SRPMS目录:存放src.rpm文件。

    实例说明:
    步骤1:利用http://bbs.lupaworld.com/thread-35011-1-1.html的方法,生成源码。
    [root@localhost hello]# ls
    源码程序:
    aclocal.m4      config.h     config.status  configure.scan  hello.c  install-sh   Makefile.in    stamp-h1
    autom4te.cache  config.h.in  configure      depcomp         hello.h  Makefile     missing
    autoscan.log    config.log   configure.in   hello           hello.o  Makefile.am  mkinstalldirs


    步骤2:把源码打包成.tar.gz格式。
    [root@localhost hello]#cd ..
    [root@localhost home]# tar cvf hello-1.0-3.tar.gz ./

    步骤3:把源码包拷贝到/usr/src/redhat/SOURCES/
    [root@localhost home]# cp hello-1.0-3.tar.gz /usr/src/redhat/SOURCES/

    步骤4:进入到/usr/src/redhat/SPECS/目录下,编写文件”软件名-版本号-释出号.spec”
    [root@localhost home]# cd /usr/src/redhat/SPECS/
    [root@localhost SPECS]# vim hello-1.0-3.spec

    内容:
    Summary:Hello for linux    #简介rpm软件
    Name:hello                                #软件名称
    Version:1.0                                #版本号
    Release:3                                        #释放号
    Copyright:GPL                                #
    Group:Application/System               
    Source:hello-1.0-3.tar.gz                        #源码包,如hello-1.0-3.i386.rpm        
    Packager:zhull                                        #作者
    Autoprov:yes
    %descrīption                                        #对软件描述
    This package is a widget system form RPM building
    %changelog
                                                                                    
    *Wed Apr 16 2008 Bowdar
    - build for the first time
    %prep                                             
    #$RPM_SOURCE_DIR其实目录为/usr/src/redhat/SOURCES
    #tar命令对#hello-1.0-3.tar.gz解压实现上解压到/usr/src/redhat/SOURCES
    tar -zxvf $RPM_SOURCE_DIR/hello-1.0-3.tar.gz
    %build                                                                                        #编译
    cd $RPM_BUILD_DIR/hello               
    ./configure --prefix=/usr/local/hello
                                    
    Make
    /***********************************************************************/
    /*由于源码包中本来就有makefile文件了,所以此处不用./configure也没有关系,由于make
    不用也是同样的道理。*/
    /***************************************************************************/

    %install                  
    #将代码安装到指定的目录中
    cd $RPM_BUILD_DIR/hello   #此处注意,hello为hello-1.0-3.tar.gz解压后的目录,此目录很重要
    make install
    install -m 755 hello /usr/local/bin   #把hello安装到/usr/local/bin目录下
    %clean          #清除临时目录
    rm -rf $RPM_BUILD_DIR/hello         #清除BUILD中的临时目录
    %files
    %defattr (-,root,root)                                                  #设置权限
    /usr/local/bin
                                                                                    #指定安装路径


    以上蓝颜色内容可以省略,因为,源码包已经配置及编译过了

    步骤5:编译并打包成RPM格式。
    [root@localhost SPECS]# rpmbuild -ba hello-1.0-3.spec

    显示内容:
    Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.7275
    + umask 022
    + cd /usr/src/redhat/BUILD
    + LANG=C
    + export LANG
    + tar -zxvf /usr/src/redhat/SOURCES/hello-1.0-3.tar.gz
    ./hello/
    ./hello/hello.c
    ./hello/hello.h
    ./hello/autoscan.log
    ./hello/configure.scan
    ./hello/aclocal.m4
    ./hello/configure.in
    ./hello/autom4te.cache/
    ./hello/autom4te.cache/requests
    ./hello/autom4te.cache/output.0
    ./hello/autom4te.cache/traces.0
    ./hello/configure
    ./hello/config.h.in
    ./hello/install-sh
    ./hello/Makefile.am
    ./hello/mkinstalldirs
    ./hello/missing
    ./hello/depcomp
    ./hello/Makefile.in
    ./hello/config.log
    ./hello/hello.o
    ./hello/config.status
    ./hello/hello
    ./hello/Makefile
    ./hello/config.h
    ./hello/stamp-h1
    ./hello/.deps/
    ./hello/.deps/hello.Po
    + exit 0
    Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.20836
    + umask 022
    + cd /usr/src/redhat/BUILD
    + LANG=C
    + export LANG
    + cd /usr/src/redhat/BUILD/hello
    + ./configure --prefix=/usr/local/hello
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking for gcc... gcc
    checking for C compiler default output... a.out
    checking whether the C compiler works... yes
    checking whether we are cross compiling... no
    checking for suffix of executables...
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ANSI C... none needed
    checking for style of include used by make... GNU
    checking dependency style of gcc... gcc3
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating config.h
    config.status: config.h is unchanged
    config.status: executing depfiles commands
    + make
    make  all-am
    make[1]: Entering directory `/usr/src/redhat/BUILD/hello'
    make[1]: Leaving directory `/usr/src/redhat/BUILD/hello'
    + exit 0
    Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.25120
    + umask 022
    + cd /usr/src/redhat/BUILD
    + LANG=C
    + export LANG
    + cd /usr/src/redhat/BUILD/hello
    + make install
    make[1]: Entering directory `/usr/src/redhat/BUILD/hello'
    /bin/sh ./mkinstalldirs /usr/local/hello/bin
      /usr/bin/install -c hello /usr/local/hello/bin/hello
    make[1]: Nothing to be done for `install-data-am'.
    make[1]: Leaving directory `/usr/src/redhat/BUILD/hello'
    + install -m 755 hello /usr/local/bin
    + /usr/lib/rpm/redhat/brp-compress
    + /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
    + /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
    + /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
    Processing files: hello-1.0-3
    Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
    Requires: /bin/bash libc.so.6 libc.so.6(GLIBC_2.0)
    Checking for unpackaged file(s): /usr/lib/rpm/check-files %{buildroot}
    Wrote: /usr/src/redhat/SRPMS/hello-1.0-3.src.rpm
    Wrote: /usr/src/redhat/RPMS/i386/hello-1.0-3.i386.rpm

    Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.28008
    + umask 022
    + cd /usr/src/redhat/BUILD
    + rm -rf /usr/src/redhat/BUILD/hello
    + exit 0

    以上显示信息可以得到:
    在/usr/src/redhat/SRPMS/目录下生成hello-1.0-3.src.rpm
    在/usr/src/redhat/RPMS/i386目录下生成了hello-1.0-3.rpm


    步骤6:在没有安装之前执行hello命令
    [root@localhost SPECS]#hello

    显示:
    Hello world!

    也就是说,不用对hello-1.0-3.i386.rpm包安装也可以运行了。Hello二进制文件在/usr/local/bin目录下,当rpmbuild时,就会生成的。现在我们用以下命令把hello二进制文件删除。
    [root@localhost SPECS]#rm /usr/local/bin/hello

    步骤7:然后,进入/ usr/src/redhat/RPMS/i386/目录。
    [root@localhost SPECS]# cd /usr/src/redhat/RPMS/i386/

    步骤8:安装rpm包。
    [root@localhost i386]# rpm -ivh hello-1.0-3.i386.rpm
    显示如下:
    Preparing...                ########################################### [100%]
       1:hello                  ########################################### [100%]

    [root@localhost i386]#hello

    显示如下:
    Hello,world!

    说明这个安装包制作正确了。

    步骤9:列出与hello有关的信息。
    [root@localhost i386]# rpm -qi hello
    显示内容:
    Name        : hello                        Relocations: (not relocateable)
    Version     : 1.0                               Vendor: (none)
    Release     : 3                             Build Date: 2008年04月16日 星期三 21时37分33秒
    Install Date: 2008年04月16日 星期三 21时38分36秒      Build Host: localhost.localdomain
    Group       : Application/System            Source RPM: hello-1.0-3.src.rpm
    Size        : 15841                            License: GPL
    Signature   : (none)
    Packager    : zhull
    Summary     : Hello for linux
    Descrīption :
    This package is a widget system form RPM building



    步骤10:查看hello可执行程序的路径。
    [root@localhost i386]# rpm -ql hello
    显示内容:
    /usr/local/bin
    /usr/local/bin/hello



    步骤11:卸载hello
    [root@localhost i386]# rpm -e hello


    注:假如重新rpmbuild打包rpm时,可能会提示以下错误:
    getOutputFrom(): 断开的管道

    本人的解决办法是要么多执行rpmbuild几次,要么重启系统后再rpmbuild,不知道哪位达人还有其他高招,请大家出出主意。
  • 基于多文件的makefile文件制作:autotools工具

    2008-4-14

    为什么要用autotools来制作makefile文件?
          众所周知,我们在编写一个简单的程序时,只要GCC编译器编译即可得到可执行文件,但是,做为一个工程项目,它包含的文件去远远不止单一的代码文件,大家可以试想一下,有一个上百个文件的代码构成的项目,如果其中只有一个或少数几个文件进行了修改,假如用gcc编译器编译,就不得不把这所有的文件重新编译一遍,因为编译器并不知道哪些文件是最近更新的,而只知道需要包含这些文件才能把源代码编译成可执行文件。由于上述原因会导致实现项目的工作效率很低。
          编译过程是分为编译、汇编、链接不同阶段的,其中编译阶段仅检查语法错误以及函数与变量的声明是否正确,在链接阶段则主要完成是函数链接和全局变量的链接。因此,那些没有改动的源代码根本不需要重新编译,而只要把它们重新链接进去就可以了。所以,Make工程管理器也就应运而生了。
          Make工程管理器:它能够根据文件时间自动发现更新过的文件而减少编译的工作量,同时,它通过读入Makefile文件的内容来执行大量编译工作,用户只需要编写一次编译语句就可以了,即编写一个makefile文件,它大大提高了实际项目的工作效率。
    但是,编写makefile文件需要懂它的一些编写规则,如结构、变量、规则等。手工编写makefile确实不是一件轻松的事,尤其对一个较大的项目而言。那么,有没有一种轻松的方法生成makefile而同时又能让用户享受make的优越性呢。
         答案是autotools系列工具。
    Autotools的使用
         现在linux上的软件开发一般都用autotools来制作Makefile。
    Autotools的使用流程:
    autoscan-->aclocal-->autoconf-->autoheader-->automake
    具体实例操作,点击以下链接下载:

    http://www.lupaworld.com/batch.download.php?aid=10435
  • 忘记root密码,无法登入linux系统,该怎么办

    2008-3-18

    当你不小心忘记了密码或者不知为何密码被修改,无法进入linux系统时,你该怎么办?
    以下提供一种解决方法:(以RH9.0为例)
    步骤1:系统启动后,在出现grub画面时,如图1所示,从图中可看出只有一个系统(RH linux),假如是双系统,如一个是windows系统,一个是linux系统,应当用上下方向键把光标移至linux系统处,然后按e键,会出现如图2所示:



    图1

    图2
    步骤2:在图2中,将光标移至内核文件那行,即(kernel /vmlinuz-2.4.20-8 ro root LABEL=/)处,然后在按e键,出现如图3所示:

    图3
    步骤3:在图3中,修改看到的那一条语句,添加single,修改后结果如图4所示,并按回车。

    图4
    步骤4:回车返回到上图2的界面环境,再按b键进行引导,会进入如图5的字符界面。

    图5
    步骤5:在如图5中可以看到,当前的提示符为:sh-2.05b#
    在此提示符下,输入passwd,会要求读者输入2次密码,结果如图6所示:

    图6

    步骤6:密码修改成功后,输入reboot重新启动,就可以用修改后的密码登入系统了。

    说明:图4中修改处,无需手动修改回来,当reboot重启后,它自动还原的。

  • 硬盘安装方式安装linux系统(此处以FC6为例)

    2008-3-17

    以下是在windows系统环境下,利用硬盘进行安装FC6.0系统。
    提示:
    (1)在windows系统下,创建一个未格式化的分区,大小为6个G左右。
    (2)需要下载FC6光盘镜像文件,可以是CD光盘(一般为5张)或是DVD(一般为1张32位或是64位)光盘,存放在用FAT32格式化分区盘的根目录下,推荐读者选择系统的最后一个盘用来存放镜像文件。此处以F盘为系统的最后一个盘
    (3)将第一张ISO文件的isolinux解压到某一分区根目录下,假定解压到F盘。
    (4)下载Grub For Dos 0.2.4,并解压到C盘根目录下,从解压文件夹中拷贝出grldr和menu.lst到C盘根目录下。
    下载地址:http://www.linuxidc.com/Linux/2007-10/8641.htm

    (5)修改boot.ini文件内容,在最后一行添加这么一行:c:\grldr=“GRUB For Dos”,保存并退出。
    (6)重新启动系统,会出现两个选项,选择“启动GRUB”选项,按回车。
    (7)出现一个选择界面,选择“commandline”选项或按c键,进入“grub>”提示符下。
    (8)依次执行以下命令:(手动引导)
            1、kernel  (hd0,6)/isolinux/vmlinuz
            2、initrd  (hd0,6)/isolinux/initrd.img
            3、boot

    说明:grub下的c盘为(hd0,0),而d盘为(hd0,4),e盘为(hd0,5),f盘为(hd0,6),后面的盘在前一个基础上+1,而isolinux文件夹存放在F盘中。

    (9)如果以上3条命令成功的话,会出现引导消息,依次弹出选择“语言”、
    “keyboard Type”、“Installation Method”、“Select Partition”界面,需要读者选择。
    注:“Installation Method”界面要求选择安装模式,选择“Hard drive”;
    “Select Partition”界面要求指定要进行分区的盘,此处选择sda7,
    它表示腾出来的未格式化的空闲分区,因为F盘用sda6表示,所以空
    闲分区为sda7。
    (10)、接下来的操作与光盘安装FC6一样。

    注:需要注意的是,在“选择分区方案”时,一定要选择给空闲分区进行
    分区,否则,原先的windows系统将可能会覆盖。
  • yum的相关操作(包含源的添加、YUM的配置文件、出错的解决及一些常用命令)

    2008-3-12

    (1)添加livna源
    操作步骤:
    步骤1:下载livna-release-7.rpm
    [root@localhost home]# wget http://rpm.livna.org/livna-release-7.rpm
    步骤2:安装livna-release-7.rpm
    [root@localhost home]# rpm -ivh livna-release-7.rpm

    (2)添加freshrpms源(支持apt和yum)
    步骤1:下载freshrpms源
    到http://www.freshrpms.net 页面点击click here下载freshrpms-release-1.1-1.fc.noarch.rmp,
    步骤2:安装freshrpms源
    [root@localhost home]# rpm -ivh freshrpms-release-1.1-1.fc.noarch.rpm

    (3)yum配置文件
    yum的设置文件为/etc/yum.conf,如果网络不通畅,可以在/etc/yum.conf文件中修改timeout参数,将timeout时间设置得稍微长一点。
    yum中可以通过修改文件来屏蔽软件源:
    修改/etc/yum.repos.d/XXX.repo,把其中的enable=1改为enable=0
    指定或去掉软件源的mirror:
    编辑/etc/yum.repos.d/XXX.repo, 注释掉mirrorlist那几行,并把baseurl那行设置成指向你喜欢的镜像服务器,这样可以获得更快的速度。

    (4)自动选择最快的源
    [root@localhost home]# yum install yum-fastestmirror -y
    fastestmirror配置文件:(一般不用动)
    /etc/yum/pluginconf.d/fastestmirror.conf
    你的yum镜像的速度测试记录文件:
    /var/cache/yum/timedhosts.txt

    (5)使用图形界面的yum
    如果觉得命令行的yum不方便,那么可以使用图形化的yumex,这个看起来更方便,因为可以自由地选择软件仓库:
    yum install yumex
    然后在系统工具中就可以看到yum extender了。
    实际上系统自带的“添加/删除程序“也可以实现图形化的软件安装,但有些yumex的功能它没有。

    (6)当YUM时,注:如出现:Existing lock /var/run/yum.pid: another copy is running. Aborting.错误,要运行: rm -f /var/run/yum.pid 将该文件删除!

    (7)yum Existing lock 错误的解决办法
    如果系统启动的时候, yum 出现Existing lock /var/run/yum.pid: another copy is running as pid 3380. Aborting. 可以用下面的办法解决:
    可以直接输入/etc/init.d/yum-updatesd stop
    也可以 rm -f /var/run/yum.pid
    主要原因就是yum在自动更新 只要关掉它就可以了


    yum的常用命令:
    1.列出所有可更新的软件清单
    命令:yum check-update
    2.安装所有更新软件
    命令:yum update
    3.仅安装指定的软件
    命令:yum install
    4.仅更新指定的软件
    命令:yum update
    5.列出所有可安裝的软件清单
    命令:yum list
    用YUM安装删除软件
    装了系统添加删除软件是常事,yum同样可以胜任这一任务,只要软件是rpm安装的。
    安装的命令是,yum install xxx,yum会查询数据库,有无这一软件包,如果有,则检查其依赖冲突关系,如果没有依赖冲突,那么最好,下载安装;如果有,则会给出提示,询问是否要同时安装依赖,或删除冲突的包,你可以自己作出判断。
    删除的命令是,yum remove xxx,同安装一样,yum也会查询数据库,给出解决依赖关系的提示。

    1.用YUM安装软件包
    命令:yum install
    2.用YUM删除软件包
    命令:yum remove
    用YUM查询软件信息
    我 们常会碰到这样的情况,想要安装一个软件,只知道它和某方面有关,但又不能确切知道它的名字。这时yum的查询功能就起作用了。你可以用 yum search keyword这样的命令来进行搜索,比如我们要则安装一个Instant Messenger,但又不知到底有哪些,这时不妨用 yum search messenger这样的指令进行搜索,yum会搜索所有可用rpm的描述,列出所有描述中和messeger有关的rpm包,于 是我们可能得到gaim,kopete等等,并从中选择。
    有时我们还会碰到安装了一个包,但又不知道其用途,我们可以用yum info packagename这个指令来获取信息。

    1.使用YUM查找软件包
    命令:yum search
    2.列出所有可安装的软件包
    命令:yum list
    3.列出所有可更新的软件包
    命令:yum list updates
    4.列出所有已安装的软件包
    命令:yum list installed
    5.列出所有已安装但不在 Yum Repository 內的软件包
    命令:yum list extras
    6.列出所指定的软件包
    命令:yum list
    7.使用YUM获取软件包信息
    命令:yum info
    8.列出所有软件包的信息
    命令:yum info
    9.列出所有可更新的软件包信息
    命令:yum info updates
    10.列出所有已安裝的软件包信息
    命令:yum info installed
    11.列出所有已安裝但不在 Yum Repository 內的软件包信息
    命令:yum info extras
    12.列出软件包提供哪些文件
    命令:yum provides
    清除YUM缓存
    yum 会把下载的软件包和header存储在cache中,而不会自动删除。如果我们觉得它们占用了磁盘空间,可以使用yum clean指令进行清除,更精确 的用法是yum clean headers清除header,yum clean packages清除下载的rpm包,yum clean all一 股脑儿端

    1.清除缓存目录(/var/cache/yum)下的软件包
    命令:yum clean packages
    2.清除缓存目录(/var/cache/yum)下的 headers
    命令:yum clean headers
    3.清除缓存目录(/var/cache/yum)下旧的 headers
    命令:yum clean oldheaders
    4.清除缓存目录(/var/cache/yum)下的软件包及旧的headers
    命令:yum clean, yum clean all (= yum clean packages; yum clean oldheaders)
  • F7系统挂载windows的盘符(双系统)

    2008-3-12

    步骤1:创建挂载点
    [root@localhost /]# mkdir /mnt/windowsC
    [root@localhost /]# mkdir /mnt/windowsD
    [root@localhost /]# mkdir /mnt/windowsE
    [root@localhost /]# mkdir /mnt/windowsF

    步骤2:编辑fstab
    [root@localhost /]# gedit /etc/fstab
    在最后添加以下内容:
    /dev/sda1 /mnt/windowsC vfat iocharset=utf8,umask=0 0 0
    /dev/sda5 /mnt/windowsD ntfs iocharset=utf8,umask=0 0 0
    /dev/sda6 /mnt/windowsE ntfs iocharset=utf8,umask=0 0 0
    /dev/sda7 /mnt/windowsF vfat iocharset=utf8,umask=0 0 0
    其中,vfat为文件格式,文件格式设置根据自己windows盘符格式而定,也可以是ntfs。utf8表示支持中文。
    步骤3:全部挂载
    [root@localhost /]# mount -a

    这样即可把windows下的盘符挂载到F7系统上了。
  • Linux系统共享windows下的文件夹:(只适用于虚拟机方式,而且是VMware6.0版本)

    2008-3-10

    步骤1:安装vmware tools
    启动linux系统后,点击虚拟机菜单栏“VM”菜单“Install VMware Tools”菜单项,如图1所示。

    图1


    图2

    在图2中,点击“Install”按钮,会弹出如图3所示

    图3


    把VMwareTools-6.0.0-45731.tar.gz压缩文件拷贝到/tmp目录下,解压并安装。
    操作步骤如下:
    [root@localhost root]# cp /mnt/cdrom/VMwareTools-6.0.0-45731.tar.gz /tmp

    [root@localhost root]# cd tmp

    [root@localhost tmp]# tar -zxvf VMwareTools-6.0.0-45731.tar.gz

    [root@localhost tmp]# cd vmware-tools-distrib/

    [root@localhost vmware-tools-distrib]# ./vmware-install.pl

    接下来,会提示用户创建一些文件,用户只需按回车键直至最后安装完成即可。

    步骤2:在windows下创建一文件夹,把要共享的文件存放此文件夹中,假如此文件夹名为share,并存放在桌面上。
    步骤3:在虚拟机上设置共享属性,启动虚拟机,点击 选项,会弹出如图4所示


    图4
    点击options选项卡,出现如图5所示

    图5
    点击 左边的“shared folders”选项,右边会出现如下图6所示


    图6
    选中Always enabled选项,点击 “Add”按钮,进入“欢迎”向导对话框。

    图7
    点击Next,出现如图8所示


    图8
    在Name处:share;Host floder处:点击 指定桌面上share文件夹的路径。
    点击 ,会出现如图9

    图9
    点击 "Finish",出现如图10所示:


    图10
    点击"OK" 按钮即可实现共享。

    步骤4:使用共享文件夹
    (1)查看共享文件夹中的内容,命令如下:
            [root@localhost root]# ls /mnt/hgfs/share/
    (2)复制共享文件夹中的文件到linux的目录下,假如,共享文件夹中有一文件为11.txt,把它复制到/home目录下。命令如下:
            [root@localhost root]# cp /mnt/hgfs/share/11.txt /

    注:文件夹的共享功能,必需安装了hgfs服务,否则,不能实现文件夹的共享。
  • 红旗6.0安装文档

    2008-3-10

    硬件需求:
    (1)内存:256M或以上
    (2)硬盘:5G或以上
    软件需求:
    (1)虚拟机6.0
    (2)红旗linux6.0桌面版镜像文件RedFlag-dt6-sys.iso

    获得红旗linux桌面版6.0镜像文件的地址:
    http://www.redflag-linux.com/xiazai/xiazai.php?id=1418   (红旗主页)

    http://www.easeboot.com/mirrors/iso1/RedFlag-dt6-sys.iso

    3、具体安装过程
    步骤1:创建一新虚拟环境。
    启动虚拟机6.0软件,点击菜单“File”->“New”->“Virtual Machien...”新建虚拟机,设置配置类型为“Typical”,客户机操作系统为“linux”,版本为”Red Hat Linux”,虚拟机名与安装的位置由用户根据具体情况设置,网络设置根据实际情况设置,默认也可以,磁盘大小为“5G”,内存设置为“256M”,在安装过程中会提示内存不够大的警告信息,但不影响安装系统。

    步骤2:引导安装程序。
    把镜像文件放入虚拟CD-ROM中,点击 按钮启动虚拟机,并初始化安装程序,会弹出如下图1所示:

    图1 引导安装程序界面
    在图1中,只需按回车键即可引导安装程序,几秒钟后,弹出如图2所示:

    图2设置语言
    在图2中,把光标移至“Chinese(Simplifled)(简体中文)”选项处,然后点击“Next”按钮,并弹出如图3所示:

    图3许可协议书
    在图3中,点击“接受”选项,然后点击“下一步”按钮,弹出如图4所示:
    步骤3:设置磁盘分区。

    图4 选择磁盘分区方式
    在图4中,注意初学者建议使用“自动分区”,然后点击“下一步”即可,此处选择“用Disk Druid手工分区”选项,可以根据自己的需要进行分区设置,点击“下一步”按钮,弹出如图5所示

    图5 是否初始化驱动器
    在图5中,会询问用户是否初始化驱动器,点击“是”按钮即可。弹出如图6所示。
    注意:当用户安装双系统的时候,此处需要特别注意选择,应选择事先准备好的空闲磁盘进行初始化,否则,一不小心就会把原先的windows系统给初始化了,这样用户的windows系统将不复存在。

    图6 硬盘驱动界面
    在图6中,选中“空闲”处,然后点击“新建”按钮,会弹出如图7所示。在图7 中,“文件系统类型”处选择“SWAP”,表示交换空间,设置大小为“512M”,一般设置为用户内存的2倍左右,最后点击“确定”按钮,返回到图6界面;同样选中“空闲”处,点击“新建”,弹出如图8所示。在图8中,挂载点设置为“/boot”,文件文件系统类型为“ext3”,空间大小设置为“1000M”,最后点击“确定”按钮,又返回到图6界面,用同样的方法,设置挂载点/及大小设置为3500M,如图9所示,点击“下一步”按钮,弹出如图10所示。

    图7 设置SWAP及空间大小

    图8 设置挂载点/boot及空间大小

    图9 设置/根挂载点及空间大小
    注意:/根目录挂载点空间大小至少为3000M,否则,提示无法安装。

    图10
    在图10中,点击“是”按钮,弹出如图11所示:
    步骤4:进行安装系统之前的配置。

    图11
    在图11中,默认设置,点击“下一步”按钮,弹出如图12所示:

    图12网络设置配置界面
    在图12中,默认设置,网络配置一般在安装完成后进行配置,点击“下一步”按钮,弹出如图13所示:

    图13输入root口令界面
    在图13中,输入root账户的密码,此密码需要用户记牢,最后点击“下一步”按钮,弹出如图14所示:

    图14 安装配置完成界面
    在图14中,点击“下一步”,弹出如图15所示:
    步骤5:开始安装操作系统。

    图15 安装进度界面
    图15正在安装系统中,安装系统的时间长短与用户的硬件配置有关,安装完成后弹出如图16所示:

    图16 重新引导系统界面
    步骤6:安装完成后,重新引导系统并进行登入系统。
    在图16表示系统安装完成,点击“重新引导”按钮即可,弹出如图17所示,并按回车进行启动系统,如图18所示,启动系统完成后,会弹出如图19所示的登入界面,输入root用户及密码并回车,弹出如图20所示的初始化系统服务界面,而后便会进入红旗linux6.0的桌面环境,如图21所示。

    图17系统启动菜单界面

    图18 系统启动中……

    图19 登入界面

    图20 欢迎界面

    图21 桌面环境

我的最新文件

Open Toolbar