【AOSP】 【Ubuntu 18.04】 repo 実行時 ’python’ が見つからずエラー
Ubuntu 18.04 に AOSPビルド環境を新規インストールした。
$ sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig $ git config --global user.name "username" $ git config --global user.email "user@email" $ mkdir ~/bin $ PATH=~/bin:$PATH $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 39134 100 39134 0 0 114k 0 --:--:-- --:--:-- --:--:-- 113k $ chmod a+x ~/bin/repo $ repo init -u https://android.googlesource.com/platform/manifest /usr/bin/env: `python': そのようなファイルやディレクトリはありません
上記のように python が見つからないとエラーが出る。
なので、python があるか確認してみる。
$ python Command 'python' not found, but can be installed with: sudo apt install python3 sudo apt install python sudo apt install python-minimal You also have python3 installed, you can run 'python3' instead.
python3 ならインストールされているようだ。
~/bin/repo ファイルをテキストエディタで開いてみる。
#!/usr/bin/env python # -*- coding:utf-8 -*- # # Copyright (C) 2008 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Repo launcher.
1行目の #!/usr/bin/env python を以下のように変更する。
#!/usr/bin/env python3
再度 repo init してみる。
$ repo init -u https://android.googlesource.com/platform/manifest Downloading Repo source from https://gerrit.googlesource.com/git-repo remote: Counting objects: 1, done remote: Finding sources: 100% (31/31) remote: Total 31 (delta 6), reused 31 (delta 6) Unpacking objects: 100% (31/31), done. repo: Updating release signing keys to keyset ver 2.3 Downloading manifest from https://android.googlesource.com/platform/manifest Receiving objects: 100% (81056/81056), 82.22 MiB | 51.55 MiB/s, done. Resolving deltas: 100% (23829/23829), done. remote: Counting objects: 20, done remote: Finding sources: 100% (103/103) remote: Total 103 (delta 35), reused 103 (delta 35) Receiving objects: 100% (103/103), 541.48 KiB | 3.15 MiB/s, done. Resolving deltas: 100% (35/35), completed with 14 local objects.
今度は実行することができた。