以Ubuntu 18.04为例
#! /bin/bash
#set -x
if [ ! -d ~/Workshop ]; then
mkdir ~/Workshop
fi
cd ~/Workshop
cp /etc/apt/sources.list /etc/apt/sources.list.bak
echo deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse > /etc/apt/sources.list
echo deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse >> /etc/apt/sources.list
echo deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse >> /etc/apt/sources.list
echo deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse >> /etc/apt/sources.list
echo deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse >> /etc/apt/sources.list
echo deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse >> /etc/apt/sources.list
echo deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse >> /etc/apt/sources.list
echo deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse >> /etc/apt/sources.list
echo deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse >> /etc/apt/sources.list
echo deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse >> /etc/apt/sources.list
apt update
apt upgrade -y
apt install vim -y
apt install vim-gtk -y
apt install libcanberra-gtk-module -y
apt install git -y
apt install bridge-utils -y
apt install build-essential -y
apt install gdb-multiarch -y
apt install gcc-arm-none-eabi -y
apt install gcc-arm-linux-gnueabi -y
apt install gcc-arm-linux-gnueabihf -y
apt install g++-arm-linux-gnueabi -y
apt install g++-arm-linux-gnueabihf -y
echo "install gcc-5 g++-5"
apt install gcc-5 gcc-5-multilib g++-5 g++-5-multilib -y
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 50 --slave /usr/bin/g++ g++ /usr/bin/g++-5
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 --slave /usr/bin/g++ g++ /usr/bin/g++-7
update-alternatives --config gcc
echo "install ssh-server"
dpkg -l | grep ssh
apt install openssh-server -y
echo "install VS Code"
if [ ! -f "./VS_Code_amd64.deb" ]; then
wget -c "https://go.microsoft.com/fwlink/?LinkID=760868" -O "VS_Code_amd64.deb"
fi
dpkg -i VS_Code_amd64.deb
echo "qemu "
apt install libsdl2-dev -y
apt install libpixman-1-dev -y
echo "install qemu"
if [ ! -f "./qemu-5.1.0.tar.xz" ]; then
wget -c "https://download.qemu.org/qemu-5.1.0.tar.xz" -O "qemu-5.1.0.tar.xz"
fi
tar xJf qemu-5.1.0.tar.xz
cd qemu
./configure --prefix=/usr/local/qemu
make -j8
make install
ln -s /usr/local/qemu/bin/* /usr/local/bin/
apt install scons -y
apt install cmake -y
apt autoremove