关闭

ubuntu 11.10---Android环境建立之艰难笔记---1

标签: ubuntutriggersupdebianflexdatabase
7794人阅读 评论(4) 收藏 举报
分类:

         在ubuntu 10.4环境下搭建Andriod开发环境,第一步就是环境的配置,但是在安装JDK1.5后,建立开发过程所需要的开发包,也就是准备获取Android源码所需的环境时,却出现了问题。关于JDK1.5的安装在前面的博文http://blog.csdn.net/hens007/article/details/7352135中已经讲到,这里不再写。

        在终端中执行:

root@hens-desktop:sudo apt-get install git-core gnupg valgrind flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zliblg dev

但是有提示:

Reading package lists... Done
Building dependency tree      
Reading state information... Done
gnupg is already the newest version.
Note, selecting libsdl1.2-dev instead of libsdl-dev
zip is already the newest version.
E: Couldn't find package zliblg-dev

 

从这个提示可以看到,要我们用libsdl1.2-dev来代替libsdl-dev,于是把这个给换掉,变为输入:

root@hens-desktop:# sudo apt-get install git-core gnupg valgrind flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build essential zip curl libncurses5-dev libsdl1.2-dev

 

好了,到这里可以连接了,它会自动下载所需要的文件。

root@hens-desktop:# sudo apt-get install git-core gnupg valgrind flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zliblg-dev

Reading package lists... Done
Building dependency tree      
Reading state information... Done
gnupg is already the newest version.
Note, selecting libsdl1.2-dev instead of libsdl-dev
zip is already the newest version.
E: Couldn't find package zliblg-dev
root@hens-desktop:# sudo apt-get install git-core gnupg valgrind flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev libsdl1.2-dev
Reading package lists... Done
Building dependency tree      
Reading state information... Done
gnupg is already the newest version.
Note, selecting libsdl1.2-dev instead of libsdl-dev
zip is already the newest version.
The following extra packages will be installed:
  dpkg-dev fakeroot g++ g++-4.4 libaa1-dev libasound2-dev libaudio-dev libaudio2
  libaudiofile-dev libavahi-client-dev libavahi-client3 libavahi-common-dev libavahi-common3
  libc-bin libc-dev-bin libc6 libc6-dbg libc6-dev libc6-i686 libcaca-dev libdbus-1-3
  libdbus-1-dev libdigest-sha1-perl libdirectfb-dev libdirectfb-extra libdrm-dev liberror-perl
  libfreetype6 libfreetype6-dev libgl1-mesa-dev libgl1-mesa-glx libglib2.0-0 libglib2.0-dev
  libglu1-mesa libglu1-mesa-dev libice-dev libjpeg62-dev libpng12-0 libpng12-dev
  libpthread-stubs0 libpthread-stubs0-dev libpulse-dev libsdl1.2debian libsdl1.2debian-alsa
  libslang2-dev libsm-dev libstdc++6-4.4-dev libsysfs-dev libwxbase2.6-0 libwxbase2.6-dev
  libwxgtk2.6-0 libx11-dev libxau-dev libxcb1-dev libxdmcp-dev libxext-dev libxt-dev m4
  mesa-common-dev patch wx2.6-headers x11proto-core-dev x11proto-input-dev x11proto-kb-dev
  x11proto-xext-dev xtrans-dev xz-utils zlib1g-dev
Suggested packages:
  bison-doc debian-keyring debian-maintainers g++-multilib g++-4.4-multilib gcc-4.4-doc
  libstdc++6-4.4-dbg git-doc git-arch git-cvs git-svn git-email git-daemon-run git-gui gitk
  gitweb libasound2-doc nas glibc-doc libglib2.0-doc python-subunit libstdc++6-4.4-doc
  wx-common wx2.6-doc gettext libgnomeprintui2.2-0 libstdc++-dev xlibmesa-gl-dev libgl-dev
  xlibmesa-glu-dev libglu-dev diffutils-doc kcachegrind alleyoop valkyrie
The following packages will be REMOVED:
  libsdl1.2debian-pulseaudio ubuntu-desktop
The following NEW packages will be installed:
  bison build-essential curl dpkg-dev fakeroot flex g++ g++-4.4 git-core gperf libaa1-dev
  libasound2-dev libaudio-dev libaudio2 libaudiofile-dev libavahi-client-dev
  libavahi-common-dev libc6-dbg libcaca-dev libdbus-1-dev libdigest-sha1-perl libdirectfb-dev
  libdirectfb-extra libdrm-dev liberror-perl libesd0-dev libfreetype6-dev libgl1-mesa-dev
  libglib2.0-dev libglu1-mesa-dev libice-dev libjpeg62-dev libncurses5-dev libpng12-dev
  libpthread-stubs0 libpthread-stubs0-dev libpulse-dev libsdl1.2-dev libsdl1.2debian-alsa
  libslang2-dev libsm-dev libstdc++6-4.4-dev libsysfs-dev libwxbase2.6-0 libwxbase2.6-dev
  libwxgtk2.6-0 libwxgtk2.6-dev libx11-dev libxau-dev libxcb1-dev libxdmcp-dev libxext-dev
  libxt-dev m4 mesa-common-dev patch valgrind wx2.6-headers x11proto-core-dev
  x11proto-input-dev x11proto-kb-dev x11proto-xext-dev xtrans-dev xz-utils zlib1g-dev
The following packages will be upgraded:
  libavahi-client3 libavahi-common3 libc-bin libc-dev-bin libc6 libc6-dev libc6-i686
  libdbus-1-3 libfreetype6 libgl1-mesa-glx libglib2.0-0 libglu1-mesa libpng12-0 libsdl1.2debian
14 upgraded, 65 newly installed, 2 to remove and 452 not upgraded.
Need to get 87.4MB of archives.
After this operation, 218MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/main libsdl1.2debian 1.2.14-4ubuntu1.1 [23.3kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/main libsdl1.2debian-alsa 1.2.14-4ubuntu1.1 [205kB]
Get:3 http://security.ubuntu.com/ubuntu/ lucid-security/main libc-bin 2.11.1-0ubuntu7.10 [725kB]
Get:4 http://security.ubuntu.com/ubuntu/ lucid-security/main libc6 2.11.1-0ubuntu7.10 [3,893kB]
Get:5 http://security.ubuntu.com/ubuntu/ lucid-security/main libc6-i686 2.11.1-0ubuntu7.10 [1,230kB]
Get:6 http://cn.archive.ubuntu.com/ubuntu/ lucid/main m4 1.4.13-3 [241kB]                      
Get:7 http://security.ubuntu.com/ubuntu/ lucid-security/main libc-dev-bin 2.11.1-0ubuntu7.10 [213kB]
Get:8 http://security.ubuntu.com/ubuntu/ lucid-security/main libc6-dev 2.11.1-0ubuntu7.10 [4,853kB]
Err http://security.ubuntu.com/ubuntu/ lucid-security/main libpng12-0 1.2.42-1ubuntu2.3        
  404  Not Found [IP: 91.189.92.167 80]
Err http://security.ubuntu.com/ubuntu/ lucid-security/main libpng12-dev 1.2.42-1ubuntu2.3      
  404  Not Found [IP: 91.189.92.167 80]
Get:9 http://security.ubuntu.com/ubuntu/ lucid-security/main libc6-dbg 2.11.1-0ubuntu7.10 [16.8MB]
Get:10 http://cn.archive.ubuntu.com/ubuntu/ lucid/main m4 1.4.13-3 [241kB]                     
Get:11 http://cn.archive.ubuntu.com/ubuntu/ lucid/main flex 2.5.35-9 [244kB]
Get:12 http://cn.archive.ubuntu.com/ubuntu/ lucid/main x11proto-core-dev 7.0.16-1 [92.2kB]     
Get:13 http://security.ubuntu.com/ubuntu/ lucid-security/main libc6-dbg 2.11.1-0ubuntu7.10 [16.8MB]
Get:14 http://cn.archive.ubuntu.com/ubuntu/ lucid/main libice-dev 2:1.0.6-1 [60.0kB]
Get:15 http://cn.archive.ubuntu.com/ubuntu/ lucid/main libxau-dev 1:1.0.5-1 [17.1kB]
Get:16 http://cn.archive.ubuntu.com/ubuntu/ lucid/main libxdmcp-dev 1:1.0.3-1 [21.2kB]         
Get:17 http://cn.archive.ubuntu.com/ubuntu/ lucid/main x11proto-input-dev 2.0-2 [62.5kB]       
Get:18 http://cn.archive.ubuntu.com/ubuntu/ lucid/main x11proto-kb-dev 1.0.4-1 [27.3kB]        
Get:19 http://cn.archive.ubuntu.com/ubuntu/ lucid/main xtrans-dev 1.2.5-1 [68.5kB]             
Get:20 http://cn.archive.ubuntu.com/ubuntu/ lucid/main libpthread-stubs0 0.3-2 [3,196B]        
Get:21 http://cn.archive.ubuntu.com/ubuntu/ lucid/main libpthread-stubs0-dev 0.3-2 [2,414B]    
Get:22 http://cn.archive.ubuntu.com/ubuntu/ lucid/main libxcb1-dev 1.5-2 [73.8kB]              
Get:23 http://cn.archive.ubuntu.com/ubuntu/ lucid/main libx11-dev 2:1.3.2-1ubuntu3 [3,505kB]   
Get:24 http://cn.archive.ubuntu.com/ubuntu/ lucid/main libx11-dev 2:1.3.2-1ubuntu3 [3,505kB]   
Get:25 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/main libglib2.0-0 2.24.1-0ubuntu1 [1,029kB]
Get:26 http://cn.archive.ubuntu.com/ubuntu/ lucid/main bison 1:2.4.1.dfsg-3 [468kB]            
Get:27 http://cn.archive.ubuntu.com/ubuntu/ lucid/main libstdc++6-4.4-dev 4.4.3-4ubuntu5 [1,491kB]
39% [27 libstdc++6-4.4-dev 581kB/1,491kB 38%]                               3,593B/s 4h 5min 21s

. .....................................................................................................

. .....................................................................................................

. ....................................................................................................

这个会是一个漫长的过程,成功从来都不会是举手可得的,慢慢等,机会是给时刻有准备的人!

 

很遗憾,又有问题了:

Fetched 68.2MB in 1h 0min 57s (18.6kB/s)                                                       
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.42-1ubuntu2.3_i386.deb  404  Not Found [IP: 91.189.92.167 80]
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-dev_1.2.42-1ubuntu2.3_i386.deb  404  Not Found [IP: 91.189.92.167 80]
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/f/freetype/libfreetype6_2.3.11-1ubuntu2.5_i386.deb  404  Not Found [IP: 91.189.92.166 80]
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/f/freetype/libfreetype6-dev_2.3.11-1ubuntu2.5_i386.deb  404  Not Found [IP: 91.189.92.166 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

 

执行root@hens-desktop:# apt-get update

...................................................................

Fetched 2,627kB in 28s (91.2kB/s)                                                              
W: Failed to fetch cdrom://Ubuntu 10.04 LTS _Lucid Lynx_ - Release i386 (20100429)/dists/lucid/main/binary-i386/Packages.gz  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs

W: Failed to fetch cdrom://Ubuntu 10.04 LTS _Lucid Lynx_ - Release i386 (20100429)/dists/lucid/restricted/binary-i386/Packages.gz  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs

E: Some index files failed to download, they have been ignored, or old ones used instead.


执行root@hens-desktop:/opt/Boardcon/Android/My_Android# apt-cdrom   还是不行,现在再看看信息:W: Failed to fetch cdrom://Ubuntu 10.04 LTS _Lucid Lynx_,这个是在/etc/apt/source.list中的定义,好先试试把它给屏幕掉:

#deb cdrom:[Ubuntu 10.04 LTS _Lucid Lynx_ - Release i386 (20100429)]/ lucid main restricted  //用 # 给屏幕掉
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

再执行:root@hens-desktop:# sudo apt-get install git-core gnupg valgrind flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev libsdl1.2-dev
看看能不能成功,走一步算一步,探索的东东谁也不敢保证一定成功,但是努力探索了一定离成功会近一些。刚刚吃完饭就来弄这个,搞得中午都不能好好休息,现在就利用这个时间休息了二十分钟,免得下午没精力……

root@hens-desktop:# sudo apt-get install git-core gnupg valgrind flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev libsdl1.2-dev
Reading package lists... Done
Building dependency tree      
Reading state information... Done
gnupg is already the newest version.
Note, selecting libsdl1.2-dev instead of libsdl-dev
zip is already the newest version.
The following extra packages will be installed:
  cpp-4.4 dpkg-dev fakeroot g++ g++-4.4 gcc-4.4 gcc-4.4-base libaa1-dev libasound2-dev
  libaudio-dev libaudio2 libaudiofile-dev libavahi-client-dev libavahi-client3
  libavahi-common-dev libavahi-common3 libc-bin libc-dev-bin libc6 libc6-dbg libc6-dev
  libc6-i686 libcaca-dev libdbus-1-3 libdbus-1-dev libdigest-sha1-perl libdirectfb-dev
  libdirectfb-extra libdrm-dev liberror-perl libfreetype6 libfreetype6-dev libgcc1
  libgl1-mesa-dev libgl1-mesa-glx libglib2.0-0 libglib2.0-dev libglu1-mesa libglu1-mesa-dev
  libgomp1 libice-dev libjpeg62-dev libpng12-0 libpng12-dev libpthread-stubs0
  libpthread-stubs0-dev libpulse-dev libsdl1.2debian libsdl1.2debian-alsa libslang2-dev
  libsm-dev libstdc++6 libstdc++6-4.4-dev libsysfs-dev libwxbase2.6-0 libwxbase2.6-dev
  libwxgtk2.6-0 libx11-dev libxau-dev libxcb1-dev libxdmcp-dev libxext-dev libxt-dev m4
  mesa-common-dev patch wx2.6-headers x11proto-core-dev x11proto-input-dev x11proto-kb-dev
  x11proto-xext-dev xtrans-dev xz-utils zlib1g-dev
Suggested packages:
  bison-doc gcc-4.4-locales debian-keyring debian-maintainers g++-multilib g++-4.4-multilib
  gcc-4.4-doc libstdc++6-4.4-dbg gcc-4.4-multilib libmudflap0-4.4-dev libgcc1-dbg libgomp1-dbg
  libmudflap0-dbg libcloog-ppl0 libppl-c2 libppl7 git-doc git-arch git-cvs git-svn git-email
  git-daemon-run git-gui gitk gitweb libasound2-doc nas glibc-doc libglib2.0-doc python-subunit
  libstdc++6-4.4-doc wx-common wx2.6-doc gettext libgnomeprintui2.2-0 libstdc++-dev
  xlibmesa-gl-dev libgl-dev xlibmesa-glu-dev libglu-dev diffutils-doc kcachegrind alleyoop
  valkyrie
The following packages will be REMOVED:
  libsdl1.2debian-pulseaudio ubuntu-desktop
The following NEW packages will be installed:
  bison build-essential curl dpkg-dev fakeroot flex g++ g++-4.4 git-core gperf libaa1-dev
  libasound2-dev libaudio-dev libaudio2 libaudiofile-dev libavahi-client-dev
  libavahi-common-dev libc6-dbg libcaca-dev libdbus-1-dev libdigest-sha1-perl libdirectfb-dev
  libdirectfb-extra libdrm-dev liberror-perl libesd0-dev libfreetype6-dev libgl1-mesa-dev
  libglib2.0-dev libglu1-mesa-dev libice-dev libjpeg62-dev libncurses5-dev libpng12-dev
  libpthread-stubs0 libpthread-stubs0-dev libpulse-dev libsdl1.2-dev libsdl1.2debian-alsa
  libslang2-dev libsm-dev libstdc++6-4.4-dev libsysfs-dev libwxbase2.6-0 libwxbase2.6-dev
  libwxgtk2.6-0 libwxgtk2.6-dev libx11-dev libxau-dev libxcb1-dev libxdmcp-dev libxext-dev
  libxt-dev m4 mesa-common-dev patch valgrind wx2.6-headers x11proto-core-dev
  x11proto-input-dev x11proto-kb-dev x11proto-xext-dev xtrans-dev xz-utils zlib1g-dev
The following packages will be upgraded:
  cpp-4.4 gcc-4.4 gcc-4.4-base libavahi-client3 libavahi-common3 libc-bin libc-dev-bin libc6
  libc6-dev libc6-i686 libdbus-1-3 libfreetype6 libgcc1 libgl1-mesa-glx libglib2.0-0
  libglu1-mesa libgomp1 libpng12-0 libsdl1.2debian libstdc++6
20 upgraded, 65 newly installed, 2 to remove and 456 not upgraded.
Need to get 15.3MB/94.7MB of archives.
After this operation, 218MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/main libgomp1 4.4.3-4ubuntu5.1 [24.3kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/main gcc-4.4-base 4.4.3-4ubuntu5.1 [118kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/main libgcc1 1:4.4.3-4ubuntu5.1 [55.3kB]
Get:4 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/main cpp-4.4 4.4.3-4ubuntu5.1 [3,759kB]
Get:5 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/main gcc-4.4 4.4.3-4ubuntu5.1 [2,986kB]
Get:6 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/main gcc-4.4 4.4.3-4ubuntu5.1 [2,986kB]
Get:7 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/main libstdc++6 4.4.3-4ubuntu5.1 [348kB]
Get:8 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/main libstdc++6-4.4-dev 4.4.3-4ubuntu5.1 [1,491kB]
Get:9 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/main g++-4.4 4.4.3-4ubuntu5.1 [4,950kB]
Get:10 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/main libpng12-0 1.2.42-1ubuntu2.4 [177kB]
Get:11 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/main libpng12-dev 1.2.42-1ubuntu2.4 [262kB]
Get:12 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/main libfreetype6 2.3.11-1ubuntu2.6 [420kB]
Get:13 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/main libfreetype6 2.3.11-1ubuntu2.6 [420kB]
Get:14 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/main libfreetype6-dev 2.3.11-1ubuntu2.6 [705kB]
Fetched 13.6MB in 50min 31s (4,482B/s)                                                         
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 126879 files and directories currently installed.)
Removing ubuntu-desktop ...
(Reading database ... 126877 files and directories currently installed.)
Preparing to replace libc-bin 2.11.1-0ubuntu7 (using .../libc-bin_2.11.1-0ubuntu7.10_i386.deb) ...
Unpacking replacement libc-bin ...
Processing triggers for man-db ...
Setting up libc-bin (2.11.1-0ubuntu7.10) ...

(Reading database ... 126877 files and directories currently installed.)
Preparing to replace libc6 2.11.1-0ubuntu7 (using .../libc6_2.11.1-0ubuntu7.10_i386.deb) ...
Unpacking replacement libc6 ...
Setting up libc6 (2.11.1-0ubuntu7.10) ...

Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
(Reading database ... 126877 files and directories currently installed.)
Preparing to replace libc6-i686 2.11.1-0ubuntu7 (using .../libc6-i686_2.11.1-0ubuntu7.10_i386.deb) ...
Unpacking replacement libc6-i686 ...
Preparing to replace libc-dev-bin 2.11.1-0ubuntu7 (using .../libc-dev-bin_2.11.1-0ubuntu7.10_i386.deb) ...
Unpacking replacement libc-dev-bin ...
Preparing to replace libc6-dev 2.11.1-0ubuntu7 (using .../libc6-dev_2.11.1-0ubuntu7.10_i386.deb) ...
Unpacking replacement libc6-dev ...
Preparing to replace libgomp1 4.4.3-4ubuntu5 (using .../libgomp1_4.4.3-4ubuntu5.1_i386.deb) ...
Unpacking replacement libgomp1 ...
Preparing to replace gcc-4.4-base 4.4.3-4ubuntu5 (using .../gcc-4.4-base_4.4.3-4ubuntu5.1_i386.deb) ...
Unpacking replacement gcc-4.4-base ...
Processing triggers for man-db ...
Setting up gcc-4.4-base (4.4.3-4ubuntu5.1) ...
(Reading database ... 126877 files and directories currently installed.)
Preparing to replace libgcc1 1:4.4.3-4ubuntu5 (using .../libgcc1_1%3a4.4.3-4ubuntu5.1_i386.deb) ...
Unpacking replacement libgcc1 ...
Setting up libgcc1 (1:4.4.3-4ubuntu5.1) ...

Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
(Reading database ... 126877 files and directories currently installed.)
Preparing to replace cpp-4.4 4.4.3-4ubuntu5 (using .../cpp-4.4_4.4.3-4ubuntu5.1_i386.deb) ...
Unpacking replacement cpp-4.4 ...
Preparing to replace gcc-4.4 4.4.3-4ubuntu5 (using .../gcc-4.4_4.4.3-4ubuntu5.1_i386.deb) ...
Unpacking replacement gcc-4.4 ...
Preparing to replace libstdc++6 4.4.3-4ubuntu5 (using .../libstdc++6_4.4.3-4ubuntu5.1_i386.deb) ...
Unpacking replacement libstdc++6 ...
Processing triggers for man-db ...
Setting up libstdc++6 (4.4.3-4ubuntu5.1) ...

Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
(Reading database ... 126877 files and directories currently installed.)
Preparing to replace libsdl1.2debian 1.2.14-4ubuntu1 (using .../libsdl1.2debian_1.2.14-4ubuntu1.1_i386.deb) ...
Unpacking replacement libsdl1.2debian ...
(Reading database ... 126876 files and directories currently installed.)
Removing libsdl1.2debian-pulseaudio ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Selecting previously deselected package libsdl1.2debian-alsa.
(Reading database ... 126868 files and directories currently installed.)
Unpacking libsdl1.2debian-alsa (from .../libsdl1.2debian-alsa_1.2.14-4ubuntu1.1_i386.deb) ...
Selecting previously deselected package m4.
Unpacking m4 (from .../archives/m4_1.4.13-3_i386.deb) ...
Selecting previously deselected package flex.
Unpacking flex (from .../flex_2.5.35-9_i386.deb) ...
Selecting previously deselected package x11proto-core-dev.
Unpacking x11proto-core-dev (from .../x11proto-core-dev_7.0.16-1_all.deb) ...
Selecting previously deselected package libice-dev.
Unpacking libice-dev (from .../libice-dev_2%3a1.0.6-1_i386.deb) ...
Selecting previously deselected package libxau-dev.
Unpacking libxau-dev (from .../libxau-dev_1%3a1.0.5-1_i386.deb) ...
Selecting previously deselected package libxdmcp-dev.
Unpacking libxdmcp-dev (from .../libxdmcp-dev_1%3a1.0.3-1_i386.deb) ...
Selecting previously deselected package x11proto-input-dev.
Unpacking x11proto-input-dev (from .../x11proto-input-dev_2.0-2_all.deb) ...
Selecting previously deselected package x11proto-kb-dev.
Unpacking x11proto-kb-dev (from .../x11proto-kb-dev_1.0.4-1_all.deb) ...
Selecting previously deselected package xtrans-dev.
Unpacking xtrans-dev (from .../xtrans-dev_1.2.5-1_all.deb) ...
Selecting previously deselected package libpthread-stubs0.
Unpacking libpthread-stubs0 (from .../libpthread-stubs0_0.3-2_i386.deb) ...
Selecting previously deselected package libpthread-stubs0-dev.
Unpacking libpthread-stubs0-dev (from .../libpthread-stubs0-dev_0.3-2_i386.deb) ...
Selecting previously deselected package libxcb1-dev.
Unpacking libxcb1-dev (from .../libxcb1-dev_1.5-2_i386.deb) ...
Selecting previously deselected package libx11-dev.
Unpacking libx11-dev (from .../libx11-dev_2%3a1.3.2-1ubuntu3_i386.deb) ...
Preparing to replace libglib2.0-0 2.24.0-0ubuntu4 (using .../libglib2.0-0_2.24.1-0ubuntu1_i386.deb) ...
Unpacking replacement libglib2.0-0 ...
Selecting previously deselected package bison.
Unpacking bison (from .../bison_1%3a2.4.1.dfsg-3_i386.deb) ...
Selecting previously deselected package libstdc++6-4.4-dev.
Unpacking libstdc++6-4.4-dev (from .../libstdc++6-4.4-dev_4.4.3-4ubuntu5.1_i386.deb) ...
Selecting previously deselected package g++-4.4.
Unpacking g++-4.4 (from .../g++-4.4_4.4.3-4ubuntu5.1_i386.deb) ...
Selecting previously deselected package g++.
Unpacking g++ (from .../g++_4%3a4.4.3-1ubuntu1_i386.deb) ...
Selecting previously deselected package xz-utils.
Unpacking xz-utils (from .../xz-utils_4.999.9beta+20091116-1_i386.deb) ...
Selecting previously deselected package patch.
Unpacking patch (from .../patch_2.6-2ubuntu1_i386.deb) ...
Selecting previously deselected package dpkg-dev.
Unpacking dpkg-dev (from .../dpkg-dev_1.15.5.6ubuntu4.5_all.deb) ...
Selecting previously deselected package build-essential.
Unpacking build-essential (from .../build-essential_11.4build1_i386.deb) ...
Selecting previously deselected package curl.
Unpacking curl (from .../curl_7.19.7-1ubuntu1.1_i386.deb) ...
Selecting previously deselected package fakeroot.
Unpacking fakeroot (from .../fakeroot_1.14.4-1ubuntu1_i386.deb) ...
Selecting previously deselected package liberror-perl.
Unpacking liberror-perl (from .../liberror-perl_0.17-1_all.deb) ...
Selecting previously deselected package libdigest-sha1-perl.
Unpacking libdigest-sha1-perl (from .../libdigest-sha1-perl_2.12-1build1_i386.deb) ...
Selecting previously deselected package git-core.
Unpacking git-core (from .../git-core_1%3a1.7.0.4-1ubuntu0.2_i386.deb) ...
Selecting previously deselected package gperf.
Unpacking gperf (from .../gperf_3.0.3-1build3_i386.deb) ...
Preparing to replace libpng12-0 1.2.42-1ubuntu2 (using .../libpng12-0_1.2.42-1ubuntu2.4_i386.deb) ...
Unpacking replacement libpng12-0 ...
Selecting previously deselected package zlib1g-dev.
Unpacking zlib1g-dev (from .../zlib1g-dev_1%3a1.2.3.3.dfsg-15ubuntu1_i386.deb) ...
Selecting previously deselected package libpng12-dev.
Unpacking libpng12-dev (from .../libpng12-dev_1.2.42-1ubuntu2.4_i386.deb) ...
Selecting previously deselected package libslang2-dev.
Unpacking libslang2-dev (from .../libslang2-dev_2.2.2-2ubuntu1_i386.deb) ...
Selecting previously deselected package libncurses5-dev.
Unpacking libncurses5-dev (from .../libncurses5-dev_5.7+20090803-2ubuntu3_i386.deb) ...
Selecting previously deselected package libaa1-dev.
Unpacking libaa1-dev (from .../libaa1-dev_1.4p5-38build1_i386.deb) ...
Selecting previously deselected package libasound2-dev.
Unpacking libasound2-dev (from .../libasound2-dev_1.0.22-0ubuntu7_i386.deb) ...
Selecting previously deselected package libaudio2.
Unpacking libaudio2 (from .../libaudio2_1.9.2-3_i386.deb) ...
Selecting previously deselected package libaudiofile-dev.
Unpacking libaudiofile-dev (from .../libaudiofile-dev_0.2.6-8ubuntu1_i386.deb) ...
Preparing to replace libavahi-common3 0.6.25-1ubuntu6 (using .../libavahi-common3_0.6.25-1ubuntu6.2_i386.deb) ...
Unpacking replacement libavahi-common3 ...
Preparing to replace libdbus-1-3 1.2.16-2ubuntu4 (using .../libdbus-1-3_1.2.16-2ubuntu4.3_i386.deb) ...
Unpacking replacement libdbus-1-3 ...
Preparing to replace libavahi-client3 0.6.25-1ubuntu6 (using .../libavahi-client3_0.6.25-1ubuntu6.2_i386.deb) ...
Unpacking replacement libavahi-client3 ...
Selecting previously deselected package libavahi-common-dev.
Unpacking libavahi-common-dev (from .../libavahi-common-dev_0.6.25-1ubuntu6.2_i386.deb) ...
Selecting previously deselected package libdbus-1-dev.
Unpacking libdbus-1-dev (from .../libdbus-1-dev_1.2.16-2ubuntu4.3_i386.deb) ...
Selecting previously deselected package libavahi-client-dev.
Unpacking libavahi-client-dev (from .../libavahi-client-dev_0.6.25-1ubuntu6.2_i386.deb) ...
Selecting previously deselected package libcaca-dev.
Unpacking libcaca-dev (from .../libcaca-dev_0.99.beta16-3_i386.deb) ...
Preparing to replace libfreetype6 2.3.11-1ubuntu2 (using .../libfreetype6_2.3.11-1ubuntu2.6_i386.deb) ...
Unpacking replacement libfreetype6 ...
Selecting previously deselected package libdirectfb-extra.
Unpacking libdirectfb-extra (from .../libdirectfb-extra_1.2.8-5ubuntu2_i386.deb) ...
Selecting previously deselected package libfreetype6-dev.
Unpacking libfreetype6-dev (from .../libfreetype6-dev_2.3.11-1ubuntu2.6_i386.deb) ...
Selecting previously deselected package libjpeg62-dev.
Unpacking libjpeg62-dev (from .../libjpeg62-dev_6b-15ubuntu1_i386.deb) ...
Selecting previously deselected package x11proto-xext-dev.
Unpacking x11proto-xext-dev (from .../x11proto-xext-dev_7.1.1-2_all.deb) ...
Selecting previously deselected package libxext-dev.
Unpacking libxext-dev (from .../libxext-dev_2%3a1.1.1-2_i386.deb) ...
Selecting previously deselected package libsysfs-dev.
Unpacking libsysfs-dev (from .../libsysfs-dev_2.1.0-6_i386.deb) ...
Selecting previously deselected package libdirectfb-dev.
Unpacking libdirectfb-dev (from .../libdirectfb-dev_1.2.8-5ubuntu2_i386.deb) ...
Selecting previously deselected package libdrm-dev.
Unpacking libdrm-dev (from .../libdrm-dev_2.4.18-1ubuntu3_i386.deb) ...
Replaced by files in installed package linux-libc-dev ...
Selecting previously deselected package libesd0-dev.
Unpacking libesd0-dev (from .../libesd0-dev_0.2.41-6ubuntu1_i386.deb) ...
Preparing to replace libgl1-mesa-glx 7.7.1-1ubuntu2 (using .../libgl1-mesa-glx_7.7.1-1ubuntu3_i386.deb) ...
Unpacking replacement libgl1-mesa-glx ...
Selecting previously deselected package libglib2.0-dev.
Unpacking libglib2.0-dev (from .../libglib2.0-dev_2.24.1-0ubuntu1_i386.deb) ...
Preparing to replace libglu1-mesa 7.7.1-1ubuntu2 (using .../libglu1-mesa_7.7.1-1ubuntu3_i386.deb) ...
Unpacking replacement libglu1-mesa ...
Selecting previously deselected package mesa-common-dev.
Unpacking mesa-common-dev (from .../mesa-common-dev_7.7.1-1ubuntu3_i386.deb) ...
Selecting previously deselected package libgl1-mesa-dev.
Unpacking libgl1-mesa-dev (from .../libgl1-mesa-dev_7.7.1-1ubuntu3_i386.deb) ...
Selecting previously deselected package libglu1-mesa-dev.
Unpacking libglu1-mesa-dev (from .../libglu1-mesa-dev_7.7.1-1ubuntu3_i386.deb) ...
Selecting previously deselected package libsm-dev.
Unpacking libsm-dev (from .../libsm-dev_2%3a1.1.1-1_i386.deb) ...
Selecting previously deselected package libxt-dev.
Unpacking libxt-dev (from .../libxt-dev_1%3a1.0.7-1_i386.deb) ...
Selecting previously deselected package libpulse-dev.
Unpacking libpulse-dev (from .../libpulse-dev_1%3a0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu14_i386.deb) ...
Selecting previously deselected package libaudio-dev.
Unpacking libaudio-dev (from .../libaudio-dev_1.9.2-3_i386.deb) ...
Selecting previously deselected package libsdl1.2-dev.
Unpacking libsdl1.2-dev (from .../libsdl1.2-dev_1.2.14-4ubuntu1.1_i386.deb) ...
Selecting previously deselected package libwxbase2.6-0.
Unpacking libwxbase2.6-0 (from .../libwxbase2.6-0_2.6.3.2.2-3ubuntu5.1_i386.deb) ...
Selecting previously deselected package wx2.6-headers.
Unpacking wx2.6-headers (from .../wx2.6-headers_2.6.3.2.2-3ubuntu5.1_i386.deb) ...
Selecting previously deselected package libwxbase2.6-dev.
Unpacking libwxbase2.6-dev (from .../libwxbase2.6-dev_2.6.3.2.2-3ubuntu5.1_i386.deb) ...
Selecting previously deselected package libwxgtk2.6-0.
Unpacking libwxgtk2.6-0 (from .../libwxgtk2.6-0_2.6.3.2.2-3ubuntu5.1_i386.deb) ...
Selecting previously deselected package libwxgtk2.6-dev.
Unpacking libwxgtk2.6-dev (from .../libwxgtk2.6-dev_2.6.3.2.2-3ubuntu5.1_i386.deb) ...
Selecting previously deselected package libc6-dbg.
Unpacking libc6-dbg (from .../libc6-dbg_2.11.1-0ubuntu7.10_i386.deb) ...
Selecting previously deselected package valgrind.
Unpacking valgrind (from .../valgrind_1%3a3.6.0~svn20100212-0ubuntu5_i386.deb) ...
Processing triggers for install-info ...
Processing triggers for man-db ...
Processing triggers for doc-base ...
Processing 1 changed 4 added doc-base file(s)...
Registering documents with scrollkeeper...
Setting up libc6-i686 (2.11.1-0ubuntu7.10) ...

Setting up libc-dev-bin (2.11.1-0ubuntu7.10) ...
Setting up libc6-dev (2.11.1-0ubuntu7.10) ...
Setting up libgomp1 (4.4.3-4ubuntu5.1) ...

Setting up cpp-4.4 (4.4.3-4ubuntu5.1) ...
Setting up gcc-4.4 (4.4.3-4ubuntu5.1) ...
Setting up libsdl1.2debian-alsa (1.2.14-4ubuntu1.1) ...

Setting up libsdl1.2debian (1.2.14-4ubuntu1.1) ...
Setting up m4 (1.4.13-3) ...
Setting up flex (2.5.35-9) ...

Setting up x11proto-core-dev (7.0.16-1) ...
Setting up libice-dev (2:1.0.6-1) ...
Setting up libxau-dev (1:1.0.5-1) ...
Setting up libxdmcp-dev (1:1.0.3-1) ...
Setting up x11proto-input-dev (2.0-2) ...
Setting up x11proto-kb-dev (1.0.4-1) ...
Setting up xtrans-dev (1.2.5-1) ...
Setting up libpthread-stubs0 (0.3-2) ...
Setting up libpthread-stubs0-dev (0.3-2) ...
Setting up libxcb1-dev (1.5-2) ...
Setting up libx11-dev (2:1.3.2-1ubuntu3) ...
Setting up libglib2.0-0 (2.24.1-0ubuntu1) ...

Setting up bison (1:2.4.1.dfsg-3) ...
update-alternatives: using /usr/bin/bison.yacc to provide /usr/bin/yacc (yacc) in auto mode.

Setting up xz-utils (4.999.9beta+20091116-1) ...
Setting up patch (2.6-2ubuntu1) ...
Setting up dpkg-dev (1.15.5.6ubuntu4.5) ...
Setting up curl (7.19.7-1ubuntu1.1) ...
Setting up fakeroot (1.14.4-1ubuntu1) ...
update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode.

Setting up liberror-perl (0.17-1) ...
Setting up libdigest-sha1-perl (2.12-1build1) ...
Setting up git-core (1:1.7.0.4-1ubuntu0.2) ...
Setting up gperf (3.0.3-1build3) ...
Ignoring install-info called from maintainer script
The package gperf should be rebuilt with new debhelper to get trigger support

Setting up libpng12-0 (1.2.42-1ubuntu2.4) ...

Setting up zlib1g-dev (1:1.2.3.3.dfsg-15ubuntu1) ...
Setting up libpng12-dev (1.2.42-1ubuntu2.4) ...
Setting up libslang2-dev (2.2.2-2ubuntu1) ...
Setting up libncurses5-dev (5.7+20090803-2ubuntu3) ...
Setting up libaa1-dev (1.4p5-38build1) ...
Setting up libasound2-dev (1.0.22-0ubuntu7) ...

Setting up libaudio2 (1.9.2-3) ...

Setting up libaudiofile-dev (0.2.6-8ubuntu1) ...
Setting up libavahi-common3 (0.6.25-1ubuntu6.2) ...

Setting up libdbus-1-3 (1.2.16-2ubuntu4.3) ...

Setting up libavahi-client3 (0.6.25-1ubuntu6.2) ...

Setting up libavahi-common-dev (0.6.25-1ubuntu6.2) ...
Setting up libdbus-1-dev (1.2.16-2ubuntu4.3) ...
Setting up libavahi-client-dev (0.6.25-1ubuntu6.2) ...
Setting up libcaca-dev (0.99.beta16-3) ...
Setting up libfreetype6 (2.3.11-1ubuntu2.6) ...

Setting up libdirectfb-extra (1.2.8-5ubuntu2) ...
Setting up libfreetype6-dev (2.3.11-1ubuntu2.6) ...
Setting up libjpeg62-dev (6b-15ubuntu1) ...
Setting up x11proto-xext-dev (7.1.1-2) ...
Setting up libxext-dev (2:1.1.1-2) ...
Setting up libsysfs-dev (2.1.0-6) ...
Setting up libdirectfb-dev (1.2.8-5ubuntu2) ...
Setting up libdrm-dev (2.4.18-1ubuntu3) ...
Setting up libesd0-dev (0.2.41-6ubuntu1) ...
Setting up libgl1-mesa-glx (7.7.1-1ubuntu3) ...

Setting up libglib2.0-dev (2.24.1-0ubuntu1) ...
Setting up libglu1-mesa (7.7.1-1ubuntu3) ...

Setting up mesa-common-dev (7.7.1-1ubuntu3) ...
Setting up libgl1-mesa-dev (7.7.1-1ubuntu3) ...
Setting up libglu1-mesa-dev (7.7.1-1ubuntu3) ...
Setting up libsm-dev (2:1.1.1-1) ...
Setting up libxt-dev (1:1.0.7-1) ...
Setting up libpulse-dev (1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu14) ...
Setting up libaudio-dev (1.9.2-3) ...
Setting up libsdl1.2-dev (1.2.14-4ubuntu1.1) ...
Setting up libwxbase2.6-0 (2.6.3.2.2-3ubuntu5.1) ...

Setting up wx2.6-headers (2.6.3.2.2-3ubuntu5.1) ...
Setting up libwxbase2.6-dev (2.6.3.2.2-3ubuntu5.1) ...
update-alternatives: using /usr/lib/wx/config/base-unicode-release-2.6 to provide /usr/bin/wx-config (wx-config) in auto mode.

Setting up libwxgtk2.6-0 (2.6.3.2.2-3ubuntu5.1) ...

Setting up libwxgtk2.6-dev (2.6.3.2.2-3ubuntu5.1) ...
update-alternatives: using /usr/lib/wx/config/gtk2-unicode-release-2.6 to provide /usr/bin/wx-config (wx-config) in auto mode.

Setting up libc6-dbg (2.11.1-0ubuntu7.10) ...
Setting up valgrind (1:3.6.0~svn20100212-0ubuntu5) ...
Setting up libstdc++6-4.4-dev (4.4.3-4ubuntu5.1) ...
Setting up g++-4.4 (4.4.3-4ubuntu5.1) ...
Setting up g++ (4:4.4.3-1ubuntu1) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode.

Setting up build-essential (11.4build1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

到这里似乎是更新完了,刚才屏幕掉的内容不知道会不会对以后的源码获取有影响,现在也不知道,以后遇到问题再分析解决吧。至少现在是可以更新完毕了。


但是不行,不能下载源码。可能就是下面的问题没解决好是不行的了:

W: Failed to fetch cdrom://Ubuntu 10.04 LTS _Lucid Lynx_ - Release i386 (20100429)/dists/lucid/main/binary-i386/Packages.gz  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs

W: Failed to fetch cdrom://Ubuntu 10.04 LTS _Lucid Lynx_ - Release i386 (20100429)/dists/lucid/restricted/binary-i386/Packages.gz  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs

E: Some index files failed to download, they have been ignored, or old ones used instead.

查了很多资料,可就是没有一个能行得通的,都说把它给屏幕掉,可是这样也不能获取源码包,一样的不行,头大了!

 

hens@hens-desktop:$ wgethttp://android.git.kernel.org/repo
--2012-03-30 11:48:06--  http://android.git.kernel.org/repo
Resolving android.git.kernel.org... 149.20.4.77
Connecting to android.git.kernel.org|149.20.4.77|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://android.googlesource.com/repo [following]
--2012-03-30 11:48:07--  http://android.googlesource.com/repo
Resolving android.googlesource.com... 74.125.128.82
Connecting to android.googlesource.com|74.125.128.82|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2012-03-30 11:48:07 ERROR 404: Not Found.

 

root@hens-desktop:/Android/My_Android/bin# curlhttp://android.git.kernel.org/repo > repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
122   244  122   244    0     0    462      0 --:--:-- --:--:-- --:--:--   893
这个用普通用户竟然提示没有权限,用sudo也不行,还是切换回到超级用户吧。

 

 

安装JDK1.6:

  1. $ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"  
  2. $ sudo apt-get update  
  3. $ sudo apt-get install sun-java6-jdk  

 

root@hens-desktop:/Android# sudo 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
root@hens-desktop:/Android# sudo 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

 解决方法是:

修改/etc/apt/source.list(其为只读,取消只读用$ sudo chmod go+w sources.list)

添加deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse,保存后$ sudo apt-get update

再试$ sudo apt-get install sun-java6-jdk

安装到configuring sun-java6-jre 时OK点不到,需要按下tab。

如果此时你把页面关了,则你想再进入配置页就要输入:sudo apt-get -f install 这是查询安装的所有依赖包。否则你想install或者reinstall都不行,会报:ia32-sun-java6 gsfonts-x11 Unmet dependencies这些错误。

最后用java -version测试,可以看到如何下图:

说明安装的版本没有错,就是我们需要的!

 

接下来还要安装开发过程需要的一些包:

root@hens-desktop:/Android# sudo apt-get install git-core gnupg valgrind flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip crul libncurses5-dev libsdl1.2-dev
Reading package lists... Done
Building dependency tree      
Reading state information... Done
git-core is already the newest version.
gnupg is already the newest version.
Note, selecting libsdl1.2-dev instead of libsdl-dev
zip is already the newest version.
E: Couldn't find package crul
root@hens-desktop:/Android# sudo apt-get install git-core gnupg valgrind flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev libsdl1.2-dev    用这个就可以安装。

 

 

root@hens-desktop:/Android/My_Android# repo init -u git://android.googlesource.com/platform/manifest -b android-4.0.1_r1
/root/bin/repo: line 1: syntax error near unexpected token `newline'
/root/bin/repo: line 1: `<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">'

每次都是到这里不停了,每次都是这样就失望,绝望了,就这样被吊死在一棵树上。

 

         实在不想这样不明不白的下去,但是自己又找不到原因,被逼无奈,只好试试把ubuntu 10.4改为用ubuntu 11.10,步骤如下:

$sudo apt-get install git-core gnupg valgrind flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev libsdl1.2-dev

注意其中的是1还是小写字母的l,很多情况下是因为这个原因才不能安装成功!

 

$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk

安装JDK1.6,不料又是这样:

似乎顺利的路从来都不会在我身上发生,好吧,不管怎么样总得走完这条路吧,重在过程,但是要做好吃苦的心理准备,还要耐得住气,再找找方法。

 

添加这个源:

deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse

 
执行:
sudo gedit /etc/apt/sources.lis

打开源列表,在最后一行添加

deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse

保存退出。

更新apt源

sudo apt-get update

安装sun-java6-jdk

sudo apt-get install sun-java6-jdk
 
 
到这里Do you want to continue [Y/n]?输入 y回车,这个过程应该持续十分钟左右后,出现:
 
 
按下“Tab”选中OK后回车确定
 

确定后出现:

 

 

用方向键选择“Yes”再回车,好玩吧。

 

再次回车后表示JDK1.6安装成功。

 

接下来就是Android 源码和内核的获取

官方网站:http://source.android.com/source/downloading.html有这样的说明:

Downloading the Source Tree

Installing Repo

Repo is a tool that makes it easier to work with Git in the context of Android. For more information about Repo, seeVersion Control.

To install, initialize, and configure Repo, follow these steps:

  • Make sure you have a bin/ directory in your home directory, and that it is included in your path:

    $ mkdir ~/bin
    $ PATH=~/bin:$PATH
    
  • Download the Repo script and ensure it is executable:

    $ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
    $ chmod a+x ~/bin/repo
    
  • The SHA-1 checksum for repo is 29ba4221d4fccdfa8d87931cd73466fdc24040b5

Initializing a Repo client

After installing Repo, set up your client to access the android source repository:

  • Create an empty directory to hold your working files. If you're using MacOS, this has to be on a case-sensitive filesystem. Give it any name you like:

    $ mkdir WORKING_DIRECTORY
    $ cd WORKING_DIRECTORY
    
  • Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest, which specifies where the various repositories included in the Android source will be placed within your working directory.

    $ repo init -u https://android.googlesource.com/platform/manifest
    

    To check out a branch other than "master", specify it with -b:

    $ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
    
  • When prompted, please configure Repo with your real name and email address. To use the Gerrit code-review tool, you will need an email address that is connected with aregistered Google account. Make sure this is a live address at which you can receive messages. The name that you provide here will show up in attributions for your code submissions.

A successful initialization will end with a message stating that Repo is initialized in your working directory. Your client directory should now contain a.repo directory where files such as the manifest will be kept.

Getting the files

To pull down files to your working directory from the repositories as specified in the default manifest, run

$ repo sync

The Android source files will be located in your working directory under their project names. The initial sync operation will take an hour or more to complete. For more aboutrepo sync and other Repo commands, seeVersion Control.

Using authentication

By default, access to the Android source code is anonymous. To protect the servers against excessive usage, each IP address is associated with a quota.

When sharing an IP address with other users (e.g. when accessing the source repositories from beyond a NAT firewall), the quotas can trigger even for regular usage patterns (e.g. if many users sync new clients from the same IP address within a short period).

In that case, it is possible to use authenticated access, which then uses a separate quota for each user, regardless of the IP address.

The first step is to create a password from the password generator and to save it in ~/.netrc according to the instructions on that page.

The second step is to force authenticated access, by using the following manifest URI:https://android.googlesource.com/a/platform/manifest. Notice how the/a/ directory prefix triggers mandatory authentication. You can convert an existing client to use mandatory authentication with the following command:

$ repo init -u https://android.googlesource.com/a/platform/manifest

Troubleshooting network issues

When downloading from behind a proxy (which is common in some corporate environments), it might be necessary to explicitly specify the proxy that is then used by repo:

$ export HTTP_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>
$ export HTTPS_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>

More rarely, Linux clients experience connectivity issues, getting stuck in the middle of downloads (typically during "Receiving objects"). It has been reported that tweaking the settings of the TCP/IP stack and using non-parallel commands can improve the situation. You need root access to modify the TCP setting:

$ sudo sysctl -w net.ipv4.tcp_window_scaling=0
$ repo sync -j1

Using a local mirror

When using many clients, especially in situations where bandwidth is scarce, it is better to create a local mirror of the entire server content, and to sync clients from that mirror (which requires no network access).

These instructions assume that the mirror is created in /usr/local/aosp/mirror. The first step is to create and sync the mirror itself, which uses close to 10GB of network bandwidth and a similar amount of disk space. Notice the--mirror flag, which can only be specified when creating a new client:

$ mkdir -p /usr/local/aosp/mirror
$ cd /usr/local/aosp/mirror
$ repo init -u https://android.googlesource.com/mirror/manifest --mirror
$ repo sync

Once the mirror is synced, new clients can be created from it. Note that it's important to specify an absolute path:

$ mkdir -p /usr/local/aosp/master
$ cd /usr/local/aosp/master
$ repo init -u /usr/local/aosp/mirror/platform/manifest.git
$ repo sync

Finally, to sync a client against the server, the mirror needs to be synced against the server, then the client against the mirror:

$ cd /usr/local/aosp/mirror
$ repo sync
$ cd /usr/local/aosp/master
$ repo sync

It's possible to store the mirror on a LAN server and to access it over NFS, SSH or Git. It's also possible to store it on a removable drive and to pass that drive around between users or between machines.

Verifying Git Tags

Load the following public key into your GnuPG key database. The key is used to sign annotated tags that represent releases.

$ gpg --import

Copy and paste the key(s) below, then enter EOF (Ctrl-D) to end the input and process the keys.

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

mQGiBEnnWD4RBACt9/h4v9xnnGDou13y3dvOx6/t43LPPIxeJ8eX9WB+8LLuROSV
lFhpHawsVAcFlmi7f7jdSRF+OvtZL9ShPKdLfwBJMNkU66/TZmPewS4m782ndtw7
8tR1cXb197Ob8kOfQB3A9yk2XZ4ei4ZC3i6wVdqHLRxABdncwu5hOF9KXwCgkxMD
u4PVgChaAJzTYJ1EG+UYBIUEAJmfearb0qRAN7dEoff0FeXsEaUA6U90sEoVks0Z
wNj96SA8BL+a1OoEUUfpMhiHyLuQSftxisJxTh+2QclzDviDyaTrkANjdYY7p2cq
/HMdOY7LJlHaqtXmZxXjjtw5Uc2QG8UY8aziU3IE9nTjSwCXeJnuyvoizl9/I1S5
jU5SA/9WwIps4SC84ielIXiGWEqq6i6/sk4I9q1YemZF2XVVKnmI1F4iCMtNKsR4
MGSa1gA8s4iQbsKNWPgp7M3a51JCVCu6l/8zTpA+uUGapw4tWCp4o0dpIvDPBEa9
b/aF/ygcR8mh5hgUfpF9IpXdknOsbKCvM9lSSfRciETykZc4wrRCVGhlIEFuZHJv
aWQgT3BlbiBTb3VyY2UgUHJvamVjdCA8aW5pdGlhbC1jb250cmlidXRpb25AYW5k
cm9pZC5jb20+iGAEExECACAFAknnWD4CGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX
gAAKCRDorT+BmrEOeNr+AJ42Xy6tEW7r3KzrJxnRX8mij9z8tgCdFfQYiHpYngkI
2t09Ed+9Bm4gmEO5Ag0ESedYRBAIAKVW1JcMBWvV/0Bo9WiByJ9WJ5swMN36/vAl
QN4mWRhfzDOk/Rosdb0csAO/l8Kz0gKQPOfObtyYjvI8JMC3rmi+LIvSUT9806Up
hisyEmmHv6U8gUb/xHLIanXGxwhYzjgeuAXVCsv+EvoPIHbY4L/KvP5x+oCJIDbk
C2b1TvVk9PryzmE4BPIQL/NtgR1oLWm/uWR9zRUFtBnE411aMAN3qnAHBBMZzKMX
LWBGWE0znfRrnczI5p49i2YZJAjyX1P2WzmScK49CV82dzLo71MnrF6fj+Udtb5+
OgTg7Cow+8PRaTkJEW5Y2JIZpnRUq0CYxAmHYX79EMKHDSThf/8AAwUIAJPWsB/M
pK+KMs/s3r6nJrnYLTfdZhtmQXimpoDMJg1zxmL8UfNUKiQZ6esoAWtDgpqt7Y7s
KZ8laHRARonte394hidZzM5nb6hQvpPjt2OlPRsyqVxw4c/KsjADtAuKW9/d8phb
N8bTyOJo856qg4oOEzKG9eeF7oaZTYBy33BTL0408sEBxiMior6b8LrZrAhkqDjA
vUXRwm/fFKgpsOysxC6xi553CxBUCH2omNV6Ka1LNMwzSp9ILz8jEGqmUtkBszwo
G1S8fXgE0Lq3cdDM/GJ4QXP/p6LiwNF99faDMTV3+2SAOGvytOX6KjKVzKOSsfJQ
hN0DlsIw8hqJc0WISQQYEQIACQUCSedYRAIbDAAKCRDorT+BmrEOeCUOAJ9qmR0l
EXzeoxcdoafxqf6gZlJZlACgkWF7wi2YLW3Oa+jv2QSTlrx4KLM=
=Wi5D
-----END PGP PUBLIC KEY BLOCK-----

After importing the keys, you can verify any tag with

$ git tag -v TAG_NAME

If you haven't set up ccache yet, now would be a good time to do it.

 

一. 获取repo

2.  按照说明,执行:

$ mkdir ~/bin

$ PATH=~/bin:$PATH

$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo

到这步行不通:

         似乎是连接不上,查了一下Linux系统的网卡eth0,ifconfig  eth0  192.168.0.245(要改成跟自己的主机网络是同一个网段),可以ping通主机。

再来一次:

$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo

可还是一样的提示,真不知道为什么会如此的艰难,连按照最新官网上的说明来操作都会这样,这个始终是跨不过的坎。谷大哥,叫我怎么爱你呢,抓狂!

在网上查了一大堆都不能,无意中看到可以从一个博客中下载:

这个博客的链接:http://blog.csdn.net/sanlinux/article/details/6853345

$ curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo"> ~/bin/repo

  没想到真的可以下载,看来所谓的官方有时候还是会不官方,还是民间的比较实用!

好的,跨过了这一步,下面就是修改它的属性:

$ chmod a+x ~/bin/repo

$ PATH=~/bin:$PATH

 

二. 下载android源码

上面步骤一定要执行命令:

$ PATH=~/bin:$PATH

否则执行:

$ repo init -u https://android.googlesource.com/platform/manifest

时会有下面的提示:

 

$  repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1 

这个执行完了会有要求你输入姓名和邮箱的,但是邮箱一定是谷歌的就行,不过不写也无所谓!

到这里说明前面的步骤都没问题了。

 

$ repo sync

同步时出现了问题:

 

看来又有问题了。有问题的总是可以找其他办法去解决,刚才不是用官方的有问题吗,现在不妨试试刚才那个博客的方法,先看看能不能:

mkdir Andriod
cd Andriod
repo init -u git://codeaurora.org/platform/manifest.git -b gingerbread
repo sync

没想到真的没问题,真的可以下载源码:

表示开始下载源代码了,呵呵还是经验的强吧,顶它一个!

 

在这里再次感谢这位博客:

链接:http://blog.csdn.net/sanlinux/article/details/6853345

这个过程比较长,走到这里真是不容易,路虽然是曲折和充满挫折,毕竟最终还是走过来了,值得祝贺一下,给自己一个鼓励也好!等这个完成了,就要开始下一步的工作了,获取kernel。要是在下载过程中的被中断或者不能下载,可以再次执行同步命令即可:reposync。

       这个过程会是相当漫长,但是等待的过程却是非常令人激动的,因为自己辛辛苦苦才弄起来的过程,现在终于看到准备有结果了,或者说是正在等待结果,正在等待劳动成果,这种感觉和成就感是比较令人欣慰和鼓舞的,虽然离成功还有很长的路要走,毕竟是踏出了第一步了,有了第一步才有可能有第二步,纵然是小小的一踏,期间也少不了痛苦,挣扎,失望和抓狂……先喝点水,慢慢等……!

好了,等了一天一夜,终于下载完,但是这里下载已经包括内核源代码,不用重新下载,但是在目录source中执行make时却出现:

也不知道为什么,是不是这个内核本身就被修改过的。 

         下面决定重新从官方网上下载Android的源码:

1.获取repo

1.  $ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
2.  $ chmod a+x ~/bin/repo
3.  $ PATH=~/bin:$PATH  //注意,要是没有这一步的话可能会有错误,前面过程已经说明

 

2. 下载android源码

$ repo init -u https://android.googlesource.com/platform/manifest
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1

 

到这里会有提示:repo initialized in  /*这里是存放代码的目录*/,比如repo initialized in Android/source,这个要注意:如果这个显示的存放源码的目录路径跟你实际存放源码的路径不同,则可能会出现下面红色字体标明的错误。比如显示是:repo initialized in Android/source,但是你实际要下载的源码路径是:repo initialized in Android/source2则表明会有原来的repo的文件没有去掉,要重新下载repo才能正常执行。

 

$ repo sync

如果有提示:

fatal: '../platform/abi/cpp.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
error: Cannot fetch platform/abi/cpp

则用ls  -a 在原来source目录下查看,会有一个名为“.repo/”的文件夹,把这个去掉

变为:

然后重新执行:

1.  $ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
2.  $ chmod a+x ~/bin/repo
3.  $ PATH=~/bin:$PATH  
4.  $ repo init -u https://android.googlesource.com/platform/manifest
5.  $ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1

即可。

表示正在下载,时间会长得不得了,不过现在有的是时间,慢慢就是,可以利用这个时间去做其他的事。

       要是其过程中有提示:error: Exited sync due to fetch errors就重新运行repo sync即可。

 

三. 获取kernel

  在source目录下建立子目录kernel

$ git clone https://android.googlesource.com/kernel/common.git
$ git clone https://android.googlesource.com/kernel/goldfish.git
$ git clone https://android.googlesource.com/kernel/msm.git
$ git clone https://android.googlesource.com/kernel/omap.git
$ git clone https://android.googlesource.com/kernel/samsung.git
$ git clone https://android.googlesource.com/kernel/tegra.git

我选择了

$ git clone https://android.googlesource.com/kernel/goldfish.git

执行以上的命令后,会建立子目录 goldfish和goldfish/.git , 然后在 goldfish目录下执行命令:

     git branch

     git branch –a

     git checkout –b goldfish origin/android-goldfish-2.6.29

注意:这三个命令不能写成:

     Git branch

     Git branch –a

     Git checkout –b goldfish origin/android-goldfish-2.6.29

也就是字母应该由“G”写成“g”否则会出现找不到命令的提示:

这样应该可以下载源码了。

      后面操作待续……

 

参考部分网络文章,因为不清楚来源,要是作者发现是自己的原创,请务必告之,本人将立即删除!

 

 

 

 

 

 

 

 

 

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:298733次
    • 积分:3501
    • 等级:
    • 排名:第9833名
    • 原创:30篇
    • 转载:122篇
    • 译文:0篇
    • 评论:48条
    最新评论