ubuntu 11.10---Android環境建立之艱難筆記---1

         在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”否則會出現找不到命令的提示:

這樣應該可以下載源碼了。

      後面操作待續……

 

參考部分網絡文章,因爲不清楚來源,要是作者發現是自己的原創,請務必告之,本人將立即刪除!

 

 

 

 

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章