ubuntu 14.04源更新以及安装软件

前端之家收集整理的这篇文章主要介绍了ubuntu 14.04源更新以及安装软件前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Ubuntu14.04 搜狐更新源及安装软件


sudo vim /etc/apt/source.list

# 将软件源改为 sohu 的
deb http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse

2. 更新并升级已有软件,并安装一些基础依赖库

sudo apt-get update

sudo apt-get upgrade
sudo apt-get install vim git build-essential unzip libv4l-dev libx264-dev

apt-get install libasound2-dev

sudo apt-get install libqt4-* libqml*

qt下载地址http://download.qt.io/archive/


apt-get install libasound2-dev


配置jdk以及ndk

ubuntu下JDK配置本质上和win是一样的:

1、去官网下载JDK、NDK

2、解压后得到名字为jdk = 1.8.0_131的文件夹,ndk = android-ndk-r14b。

3、配置jdk和ndk环境变量:

在启动终端并输入

  1. gedit/etc/profile

在末尾添加一下配置,保存并退出

  1. #setjdkenvironment
  2. exportJAVA_HOME=/home/jeck/jdk/jdk1.8.0_131
  3. exportCLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$CLASSPATH
  4. exportPATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH

  5. export ANDROID_NDK= /home/jeck/ndk/android-ndk-r14b
  6. PATH=$ANDROID_NDK:$PATH

终端输入一下命令使配置生效

source/etc/profile

4、查看配置是否成功。在终端输入

java-version

如果显示版本是1.7.0.21则配置成功,如下显示

javaversion"1.8.0_131"
  • Java(TM)SERuntimeEnvironment(build1.8.0_131-b11)
  • JavaHotSpot(TM)ServerVM(build23.21-b01,mixedmode)

  • ndk测试,在终端输入,如下显示配置成功:
    1. Copyright (C) 2006 Free Software Foundation,Inc.
    2. This is free software; see the source for copying conditions.
    3. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
    4. PARTICULAR PURPOSE.
    5. This program built for x86_64-pc-linux-gnu

    如果显示仍是openJDK,执行步骤5,再测试

    5、配置默认JDK,ubuntu下默认JDK是openJDK。。终端输入

    sudoupdate-alternatives--install/usr/lib/javajava/usr/lib/jvm/jdk1.7.0_17/bin/java300
  • sudoupdate-alternatives--install/usr/lib/javacjavac/usr/lib/jvm/jdk1.7.0_17/bin/javac300
  • 执行下面命令,配置需要默认的JDK

    sudoupdate-alternatives--configjava

    会列出jdk版本,其中被“*”标注的为默认JDK。如果要维持当前默认JDK,直接按回车键即可;否则输入相应JDK的编号将其设置为默认版本。

    猜你在找的Ubuntu相关文章