Fei's profile精诚所至,金石为开。PhotosBlogListsMore Tools Help

Blog


    August 25

    How to install Nvidia driver in Ubuntu 8.04

    1. 到官方网站下载对应的驱动文件
    网站:http://www.nvidia.com
    文件:NVIDIA-Linux-x86_64-173.14.12-pkg2.run
    2. 安装驱动需要的lib
    sudo apt-get install libc6-dev
    3. 禁止系统启动默认的驱动
    sudo vim /etc/default/linux-restricted-modules-common
    在最后的双引号中添加nv nvidia_new,即把文件中的“”,改成“nv nvidia_new”
    4. 进入命令行模式
    按Ctrl+Alt+F1
    5. 停止GDM的进程
    sudo /etc/init.d/gdm stop
    6. 安装驱动
    sudo sh ./NVIDIA-Linux-x86_64-173.14.12-pkg2.run(取决于自己的位置)
    7.安装过程中

    如果提示有旧驱动,询问是否删除旧驱动,选Yes;
    如果提示缺少某某模块(modules),询问是否上网下载,选no;
    如果提示编译模块,询问是否进行编译,选ok;
    如果提示将要修改Xorg.conf,询问是否允许,选Yes;

    8. 安装完成就回到终端,重启GDM
    sudo /etc/init.d/gdm restart

    如果不想看NVIDIA的LOGO,可以修改 /etc/X11/xorg.conf
    在Section “Device”中添加Option “NoLogo” “True”9. 显示高级设置
    如果想进行显示方面的高级设置,在终端下输入:nvidia-settings命令.

    10. 卸载驱动
    sh NVIDIA-Linux-x86_64-173.14.12-pkg2.run –uninstall

    January 22

    常用软件的安装

    1. rpm包的安装

    Ubuntu中安装Alien
    sudo apt-get install alien

    转换一个rpm包为deb
    alien -d package-name.rpm

    转换一个rpm包为deb并安装生成的包
    alien -i package-name.rpm
    B. VMware的安装
    1. 登录到http://www.vmware.com下载最新版本的vmware workstation安装文件
    当前的是VMware-workstation-6.0.2-59824.i386.tar.gz
    2. 解压到本机
    $ tar -xvzf VMware-workstation-6.0.2-59824.i386.tar.gz
    解压到你想要的目录,我的是/opt/vmware-distrib
    3. 进入vmware-distrib文件夹,安装
    $ cd vmware-distrib
    $ ./vmware-install.pl

    December 13

    tar

    如果是tar.gz文件
    tar -zxvf fcitx-3.0.0.tar.gz
    如果是tar.bz2文件,利用以下命令解包:
    cd /temp
    tar jxvf fcitx-3.0.0.tar.bz2
    % sh  /home/cs9416/install_protege.bin



    December 08

    alien

    Alien is a program that converts between the rpm, dpkg, stampede slp, and slackware tgz file formats. If you want to use a package from another distribution than the one you have installed on your system, you can use alien to convert it to your preferred package format and install it.

    Despite the large version number, alien is still (and will probably always be) rather experimental software. It has been used by many people for many years, but there are still many bugs and limitations.

    Alien should not be used to replace important system packages, like sysvinit, shared libraries, or other things that are essential for the functioning of your system. Many of these packages are set up differently by Debian and Red Hat, and packages from the different distributions cannot be used interchangably. In general, if you can’t uninstall the package without breaking your system, don’t try to replace it with an alien version.

    Install alien in debian

    #apt-get install alien

    This will install all the required packages.Now you can start converting your .rpm files to .deb packages.

    Available Options for alien

    Convert the package.rpm into a package.deb

    #alien -d package-name.rpm

    Convert the package.rpm into a package.deb, and install the generated package.

    #alien -i package-name.rpm

    If you want to keeps alien from changing the version number use the following command

    #alien -k rpm-package-file.rpm

    Example

    Suppose we have a avg antivirus avg71lms-r30-a0782.i386.rpm file

    To convert .rpm to debian

    #alien -k avg71lms-r30-a0782.i386.rpm

    Now you should be having avg71lms-r30-a0782.i386.deb file

    To install .deb file

    #dpkg -i avg71lms-r30-a0782.i386.deb

    If you don’t use -k option you should see avg71lms_r30-1_i386.deb file the difference is it will add 1

    Install alien in Ubuntu

    $sudo apt-get install alien

    You can check the above section for available options

    Example

    Suppose we have a avg antivirus avg71lms-r30-a0782.i386.rpm file

    To convert .rpm to debian

    $sudo alien -k avg71lms-r30-a0782.i386.rpm

    Now you should be having avg71lms-r30-a0782.i386.deb file

    To install .deb file

    $sudo dpkg -i avg71lms-r30-a0782.i386.deb

    If you don’t use -k option you should see avg71lms_r30-1_i386.deb file the difference is it will add 1

    December 02

    set environment varialble in ubuntu 7.10

    系统环境变量:
    /etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行.
    并从/etc/profile.d目录的配置文件中搜集shell的设置.

    /etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取.

    当前用户变量:
    ~/.bash_profile:每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,
    该文件仅仅执行一次!默认情况下,他设置一些环境变量,执行用户的.bashrc文件.
    ~/.bashrc:该文件包含专用于你的bash shell的bash信息,当登录时以及每次打开新的shell时,该该文件被读取.
    ~/.bash_logout:当每次退出系统(退出bash shell)时,执行该文件.

    =======================================================================

    在ununtu linux的配置文件中一劳永逸的设置环境变量

    1.环境变量配置中,要先删除.bash_profile中的三行关于.bashrc的定义,然后把环境变量配置在.bashrc中
    2.选择要使用的java环境:update-alternatives –config java
    3.要使得刚修改的环境变量生效:source .bashrc
    4.查看环境变量:env

    Useful linux command

    ls:
    -a list all files and folders
    -l  use a long listing format
    examples:
    ls -a
    ls -l
    ln: target link_name
    -s  make symbolic links instead of hard links
    examples:
    ln -s jdk1.6.0_03 jdk
    env: see environment variable
    env
    December 01

    How to install jdk in ubuntu

    There are two version of the JDK is available:
    Linux x64 Platform - Java(TM) SE Development Kit 6 Update 3
    Linux x64 RPM in self-extracting file jdk-6u3-linux-amd64-rpm.bin 56.16 MB
    Linux x64 self-extracting file jdk-6u3-linux-amd64.bin 59.26 MB


    1. Self-extracting Binary File - This file can be used to install the JDK in a location chosen by the user. This one can be installed by anyone (not only root users), and it can easily be installed in any location. As long as you are not root user, it cannot
    displace the system version of the Java platform suppled by Linux.
    2. RPM Packages - A rpm.bin file containing RPM packages, installed with the rpm utility. Requires root access to install. RPM packages are the recommended method for installation on Linux.

    Installation of Self-Extracting Binary

    1. Download and check the download file size to ensure that you have downloaded the full, uncorrupted software bundle.
    You can download to any directory you choose; it does not have to be the directory where you want to install the JDK.

    Before you download the file, notice its byte size provided on the download page on the web site. Once the download has completed, compare that file size to the size of the downloaded file to make sure they are equal.

    2. Make sure that execute permissions are set on the self-extracting binary.
    Run this command:
    chmod +x jdk-6u3-linux-amd64.bin

    3. Change directory to the location where you would like the files to be installed.

    The next step installs the JDK into the current directory.

    4. Run the self-extracting binary.

    Execute the downloaded file, prepended by the path to it. For example, if the file is in the current directory, prepend it with "./" (necessary if "." is not in the PATH environment variable):

    ./jdk-6u3-linux-amd64.bin

    The binary code license is displayed, and you are prompted to agree to its terms.

    The JDK files are installed in a directory called jdk1.6.0_03 in the current directory. 


    Installation of RPM File

    1. Download and check the file size.

    You can download to any directory you choose.

    Before you download the file, notice its byte size provided on the download page on the web site. Once the download has completed, compare that file size to the size of the downloaded file to make sure they are equal.

    2. Become root by running the su command and entering the super-user password.

    3. Extract and install the contents of the downloaded file.

    Change directory to where the downloaded file is located and run these commands to first set the executable permissions and then run the binary to extract and run the RPM file:

    chmod a+x jdk-6<version>-linux-i586-rpm.bin

    ./jdk-6<version>-linux-i586-rpm.bin

    Note that the initial "./" is required if you do not have "." in your PATH environment variable.

    The script displays a binary license agreement, which you are asked to agree to before installation can proceed. Once you have agreed to the license, the install script creates and runs the file jdk-6<version>-linux-i586.rpm in the current directory.

    NOTE - If instead you want to only extract the RPM file but not install it, you can run the .bin file with the -x argument. You do not need to be root to do this.

    4. Delete the bin and rpm file if you want to save disk space.

    5. Exit the root shell.
    The RPM packages creates two links /usr/java/latest and /usr/java/default. 

    • The /usr/java/latest link will always point to the version of Java that Sun Microsystems considers the latest version.  Subsequent upgrades of the packages will overwrite this value if it is not the latest version.
    • By default, /usr/java/default points to /usr/java/latest. However, if administrators change /usr/java/default to  point to another version of Java, subsequent package upgrades will be provided by the administrators and cannot be overwritten.
    When the JDK is installed, links to  javac jar and javadoc are also created apart from the JRE links. These links point to the appropriate tool referenced by /usr/java/default. This allows the user to easily run the default version of these Java tools.

    A new service script, named jexec, is added to /etc/init.d. This script allows users to directly execute any standalone JAR file that has an execution permission set. This can be demonstrated using an example from the JDK:
    cd /usr/java/jdk1.6.0/demo/jfc/SwingSet2
    chmod +x SwingSet2.jar
    SwingSet2.jar
    Set environment variable in ubuntu
    modify etc/environment
    add JAVA_HOME="/opt/jdk/bin" This is the path to jdk