Background:
When the android source code is obtained in a Linux environment (the virtual machine is virtualbox,
Run the following command: repo init-u git: // android.git.kernel.org/platform/manifest.git:
Fatal: unable to look up android.git.kernel.org (Port 9418) (name or service not known)
Machine and software environment:
Company intranet + proxy + virtualbox + linux
Cause:
In a word, there is a problem with the Internet, because it is not enough to set up a proxy in the network settings, we need to use some fanqiang tool to implement proxy operations.
Repeat the steps based on the preceding reasons:
1. install required software:
Sudo apt-Get install Git-core curl
2. Set the directory where the tool repo is stored and add it to the environment variable:
Mkdir ~ /Bin
Path = ~ /Bin: $ path
3. Download the repo script and change its mode to executable:
Curl http://android.git.kernel.org/repo> ~ /Bin/Repo
Chmod A + x ~ /Bin/Repo
4. Create a directory for downloading source code
Mkdir ~ /Source
Cd ~ /Source
5. Start repo operations
Repo init-u git: // android.git.kernel.org/platform/manifest.git
Generally, a repo is successful if a proxy is not required for a normal network.
However, due to the company's special network environment, fatal: Unable to look up android.git.kernel.org (port 9418) (Name or service not known) occurs during repo.
At this time, you can continue to the following steps to solve the problem:
-------------------------------------------------------------------------
1. Install corkscrew
Sudo apt-get install corkscrew
2. Create any file in any directory
Example :~ // Bin/proxy-hoge-user.sh
Add and save the following content:
1 #! /Bin/bash
2 corkscrew = 'which corkscrew'
3 $ corkscrew proxy.hoge.com
8080 $1 $2
~ /Bin/user-pwd
Where:
Proxy.hoge.com is the proxy server,
8080 is the proxy port,
~ /Bin/user-pwd is the file that stores the user name and password of the proxy.
You need to set it according to your own situation.
3. Create a new file to store the proxy user name and password
~ /Bin/user-pwd
Format:
<Username>: <password>
For example, user: pwd
4. Modify file attributes
Chmod 755 ~ // Bin/proxy-hoge-user.sh
Chmod 600 ~ /Bin/user-pwd
5. Add the environment variable git_proxy_command.
Sudo VI ~ /. Bashrc
Add the following command:
Export git_proxy_command = ~ // Bin/proxy-hoge-user.sh
Save and exit.
Source ~ /. Bashrc