How to solve the problem of [fatal: Unable to look up android.git.kernel.org (port 9418) (Name or service not kn

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.