系统相关
首页 > 系统相关> > Ubuntu20.04 AOSP编译环境配置

Ubuntu20.04 AOSP编译环境配置

作者:互联网

Ubuntu20.04 AOSP编译环境配置

1.安装和配置步骤:

先更换为阿里源,见步骤6
​
之后终端执行
​
sudo apt-get update
​
sudo apt-get upgrade

2.安装 git

sudo apt-get install git
​
git config --global user.name "用户名" 
git config --global user.email "邮箱" 
​

3.安装OpenJDK

3.1 安装jdk:
       18.04默认集成了jdk1.8的源,可直接执行以下安装;
       sudo apt-get install openjdk-8-jdk   //jdk1.8
       sudo apt-get install openjdk-11-jdk  //jdk 11
3.2 sudo update-alternatives --config java //查看java版本,选择对应版本
   sudo update-alternatives --config javac //查看javac版本,选择对应版本

4.搭建环境

终端执行:
sudo apt-get install libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev g++-multilib
sudo apt-get install -y git flex bison gperf build-essential libncurses5-dev:i386
sudo apt-get install tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
sudo apt-get install dpkg-dev libsdl1.2-dev libssl-dev
sudo apt-get install git-core gnupg flex bison gperf build-essential
sudo apt-get install zip curl zlib1g-dev gcc-multilib g++-multilib
sudo apt-get install libc6-dev-i386
sudo apt-get install lib32ncurses5-dev x11proto-core-dev libx11-dev
sudo apt-get install libgl1-mesa-dev libxml2-utils xsltproc unzip m4
sudo apt-get install lib32z-dev
sudo apt-get install libncurses5
sudo apt-get install libpng-dev  
sudo apt-get install libssl-dev 
sudo apt-get install libswitch-perl
sudo apt install python-crypto 
​
最后在 .bashrc 文件中添加:
export LC_ALL=C

5.切换默认python为python2

Ubuntu 20.04默认使用的是python3 编译时需要用到python2,配置软链接使用python2 
  1.安装python2
  sudo apt install python2
 
  2.安装完成后我们可以使用如下命令来检查目前可用的 Python 版本:
  ls /usr/bin/python*
​
  3.设置默认方式(替代版本)
  sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1

6.Ubuntu切换为阿里源

使用vim或者gedit编辑/etc/apt/sources.list

Ubuntu 18.04

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
​
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
​
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
​
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
​
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
​

Ubuntu 20.04

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
​
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
​
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
​
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
​
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
​

标签:Ubuntu20.04,编译,restricted,sudo,apt,AOSP,aliyun,ubuntu,multiverse
来源: https://www.cnblogs.com/mazhuang1213/p/15715695.html