赞
踩
https://ubuntu.com/download/raspberry-pi
Ubuntu Server 20.04.1 LTS
选择树莓派4 的 64bit
版本
https://cdimage.ubuntu.com/releases/20.04.1/release/ubuntu-20.04.1-preinstalled-server-arm64+raspi.img.xz
从 https://www.raspberrypi.org/software/ 下载烧录软件 imager_1.5 。操作系统也可以在这个工具上面下载。
# 查看树莓派4的ip地址 arp -a | findstr dc-a6-32 # 192.168.31.229 dc-a6-32-e1-6b-7f 动态 # 或者从路由器上面查看树莓派的ip地址 # 用终端连接查到的ip,并且修改ubuntu的密码,初始化账号密码都是ubuntu # 修改密码后,用新密码重新连接终端 # 查看系统信息 ubuntu@ubuntu:~$ uname -a Linux ubuntu 5.4.0-1015-raspi #15-Ubuntu SMP Fri Jul 10 05:34:24 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux ubuntu@ubuntu:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.1 LTS Release: 20.04 Codename: focal ubuntu@ubuntu:~$ cat /proc/cpuinfo processor : 0 BogoMIPS : 108.00 Features : fp asimd evtstrm crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd08 CPU revision : 3 processor : 1 BogoMIPS : 108.00 Features : fp asimd evtstrm crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd08 CPU revision : 3 processor : 2 BogoMIPS : 108.00 Features : fp asimd evtstrm crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd08 CPU revision : 3 processor : 3 BogoMIPS : 108.00 Features : fp asimd evtstrm crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd08 CPU revision : 3 Hardware : BCM2835 Revision : d03114 Serial : 100000007deba538 Model : Raspberry Pi 4 Model B Rev 1.4 ubuntu@ubuntu:~$ lscpu Architecture: aarch64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 1 Core(s) per socket: 4 Socket(s): 1 Vendor ID: ARM Model: 3 Model name: Cortex-A72 Stepping: r0p3 CPU max MHz: 1500.0000 CPU min MHz: 600.0000 BogoMIPS: 108.00 Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Spec store bypass: Vulnerable Vulnerability Spectre v1: Mitigation; __user pointer sanitization Vulnerability Spectre v2: Vulnerable Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Not affected Flags: fp asimd evtstrm crc32 cpuid ubuntu@ubuntu:~$
# 更新 更新源地址 # 阿里地址:https://mirrors.aliyun.com/ubuntu-ports # 中国科技大学地址:http://mirrors.ustc.edu.cn/ubuntu-ports # sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup # sudo vim /etc/apt/sources.list # 将里面的http://ports.ubuntu.com/ubuntu-ports 全部替换成 https://mirrors.aliyun.com/ubuntu-ports 或者 http://mirrors.ustc.edu.cn/ubuntu-ports # 安装必要软件 sudo apt install -y cmake network-manager wireless-tools net-tools aptitude libtool libtool-bin zlib1g-dev libncurses5-dev # 更新已安装的软件包 sudo apt -y upgrade # 安装gcc开发工具 sudo apt install -y build-essential manpages-dev sudo apt install -y software-properties-common sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt install gcc-7 g++-7 gcc-8 g++-8 gcc-9 g++-9 gcc-10 g++-10 # 设置c++编译器不同版本的优先级,70,80,90,100 为优先级,数字最大者被启用 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 --slave /usr/bin/g++ g++ /usr/bin/g++-8 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 --slave /usr/bin/g++ g++ /usr/bin/g++-7 # 手动切换编译器版本 sudo update-alternatives --config gcc
# 安装jdk1.8
sudo apt install openjdk-8-jdk
# 配置环境变量
sudo vim /etc/profile
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-arm64
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/jre/lib/ext
export PATH=.:$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
# 查看状态 nmcli d # 查看可用wifi sudo nmcli dev wifi # 设置wifi账号,密码(注意大小写及权限) sudo nmcli dev wifi connect "wifi名" password "密码" ############################################ # 设置开机自动连接无线网络 sudo nmcli con mod "wifi名" connection.autoconnect yes ############################################ # 查看状态 nmcli d # 查看无线网卡ip地址 ip addr show wlan0 # 配置静态ip地址 #配置无线网卡静态ip nmcli con mod SSID ipv4.addresses 192.168.0.105/24 nmcli con mod SSID ipv4.gateway 192.168.0.1 nmcli con mod SSID ipv4.method manual nmcli con mod SSID ipv4.dns "8.8.8.8" nmcli con up SSID # 查看无线网卡ip地址 ip addr show wlan0
# 安装ubuntu桌面Gnome类型 sudo apt install -y ubuntu-desktop ## 安装ubuntu桌面Xface类型 ## 参考 https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#5-install-a-desktop #sudo apt install xubuntu-desktop #sudo apt install lubuntu-desktop # 安装远程桌面服务 sudo apt install -y xrdp # 将远程桌面服务xrdp添加到ssl-cert组 sudo adduser xrdp ssl-cert # 重启xrdp服务 sudo systemctl restart xrdp # 在防火墙中添加远程访问限制 sudo ufw allow from 192.168.31.0/24 to any port 3389 ## 允许任何ip地址访问 #sudo ufw allow 3389 # 使用mstsc远程连接
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。