一、修改镜像源
sudo gedit /etc/apt/sources.list
修改替换内容如下 推荐使用中科大服务,速度较快。
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
使修改生效
sudo apt-get update
二、配置openjdk8
1.安装jdk8
sudo apt-get install openjdk-8-jdk
sudo apt-get install openjdk-8-jre
2.安装编译Android源码依赖
sudo apt-get install libswitch-perl
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 libesd0-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 ccache
#错误1 gcc-11不支持 需要切换会 gcc-9
/usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
三、修改cpu为高性能模式
安装 cpufrequtils:
sudo apt-get install cpufrequtils
查看当前cpu的状态:
cpufreq-info
把cpu调整到性能模式:
sudo cpufreq-set -g performance
查看当前电脑CPU工作模式
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
如果没有启用高性能模式一般为:powersave
多核心的需要将所有的核全部调整到性能模式需要ROOT权限
echo "performance" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor