您的位置:首页 > 移动开发 > Android开发

Ubuntu 12.04 server 搭建Android开发环境记录

2013-10-05 00:32 453 查看
本文章是自己搭建Android开发环境遇到的一些问题,自己给自己留个记录,很多都是参考网络上给的解决办法。本人的用的ubuntu 12.04的server版本,支持root登录,所以第一步的root搞起,sudo passwd root



1、ubuntu 12.04 server 安装后找不到eth0

修改:

root@miyh:~# vim /etc/network/interfaces

添加

auto lo

iface lo inet loopback

auto eth0

iface eth0 inet dhcp


2、Sorry, command-not-found has crashed! Please file a bug report at:

https://bugs.launchpad.net/command-not-found/+filebug

Please include the following information with the report:

command-not-found version: 0.2.44

root@miyh:~# git 发现提示上述错误

修改


root@miyh:~# apt-get install language-pack-en-base

root@miyh:~#vim .bashrc

添加:

export LANGUAGE=en_US.UTF-8

export LANG=en_US.UTF-8

export LC_ALL=en_US.UTF-8

重启shell终端,输入git,你会发现提示变了

root@miyh:~# git

The program 'git' is currently not installed. You can install it by typing:

apt-get install git


3、git获取

root@miyh:~# apt-get install git

安装的过程中,可以看到有这样的提示

Suggested packages:

git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn git-email git-gui gitk gitweb


root@miyh:~# apt-get install git-doc

可以支持git + Table的操作

4、apt-get install sun-java6-jdk

Reading package lists... Done

Building dependency tree

Reading state information... Done

Package sun-java6-jdk is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source

E: Package sun-java6-jdk has no installation candidate



原文:http://www.douban.com/note/240118681/

1. Download the JDK 1.6 binary release from Sun JDK download site(www.oracle.com/technetwork/java/javase/downloads/index.html).

2. Unzip the binary somewhere in your system, for example:

sudo mkdir -p /opt/java/64/

sudo cp jdk-6u35-linux-x64.bin /opt/java/64

sudo su -

cd /opt/java/64

chmod +x jdk-6u35-linux-x64.bin

./jdk-6u35-linux-x64.bin

exit

3. Add the new Java to your shell environment’s $PATH :

echo 'export PATH=/opt/java/64/jdk1.6.0_35/bin:$PATH' >> ~/.bashrc

4. Relaunch your terminal and test, java -version:

java version "1.6.0_35"

Java(TM) SE Runtime Environment (build 1.6.0_35-b10)

Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01, mixed mode)


5、Ubuntu
12.04 安装设置gcc4.4


apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib gcc-4.4-multilib

update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 100


update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 50

update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 100

update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 50

update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.4 100

update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.6 50

6、scripts/kconfig/lxdialog/msgbox.o: In function `dialog_msgbox': error

root@miyh:/usr/bin# apt-get install libncurses5-dev


7、ImportError: No module named M2Crypto

root@miyh:/usr/bin# apt-get install python-dev

root@miyh:/usr/bin# apt-get install libncurses5-dev


8、dos2unix:Command not found

root@miyh:/usr/bin# apt-get install dos2unix

9、collect2: ld terminated with signal 9 [Killed]

make: *** [out/target/product/generic/obj/SHARED_LIBRARIES


修改ubuntu swap分区大小

root@miyh:~# mkdir swap

root@miyh:~# cd swap/

root@miyh:~/swap# pwd

/root/swap


root@miyh:~/swap#dd if=/dev/zero of=swapfile bs=1M count=2k

2048+0 records in

2048+0 records out

2147483648 bytes (2.1 GB) copied, 16.3087 s, 132 MB/s


创建2G的swap,创建分区的大小就= bs * count(我机器配置的1G内存)

root@miyh:~/swap# mkswap swapfile

Setting up swapspace version 1, size = 2097148 KiB

no label, UUID=5fe50bd2-d575-40d6-a297-f827bbf9901e

转换成 Swap 文件

如果想一直使用这个swap分区,需要修改

root@miyh:~/swap# vim /etc/fstab

/root/swap/swapfile swap swap defaults 0 0

10、lzop: error while loading shared libraries: liblzo2.so.2: cannot open shared object file: No such file or directory

root@miyh:/usr/lib/i386-linux-gnu# apt-get install liblzo2-dev

root@miyh:/usr/local/li/usr/lib/x86_64-linux-gnu/liblzo2.so.2b# find / -name liblzo2.so.2

/usr/lib/x86_64-linux-gnu/liblzo2.so.2

root@miyh:/usr/local/lib# ln -s /usr/lib/x86_64-linux-gnu/liblzo2.so.2 /usr/lib/liblzo2.so.2

11、lzop: error while loading shared libraries: liblzo2.so.2: wrong ELF class: ELFCLASS64

root@miyh:/usr/lib# apt-get install liblzo2-dev:i386

root@miyh:/usr/local/li/usr/lib/x86_64-linux-gnu/liblzo2.so.2b# find / -name liblzo2.so.2

/usr/lib/i386-linux-gnu/liblzo2.so.2

/usr/lib/x86_64-linux-gnu/liblzo2.so.2


root@miyh:/usr/lib# ln -s /usr/lib/i386-linux-gnu/liblzo2.so.2 /usr/lib/liblzo2.so.2
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: