# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.ustc.edu.cn/centos-altarch/$releasever/os/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-Arm32
#released updates
[updates]
name=CentOS-$releasever - Updates
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.ustc.edu.cn/centos-altarch/$releasever/updates/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-Arm32
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.ustc.edu.cn/centos-altarch/$releasever/extras/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-Arm32
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://mirrors.ustc.edu.cn/centos-altarch/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-Arm32
sudo vi /etc/yum.repos.d/epel.repo
[epel]
name=Epel rebuild for armhfp
baseurl=https://armv7.dev.centos.org/repodir/epel-pass-1/
enabled=1
gpgcheck=0
重新缓存
yum makecache
yum update -y
yum upgrade -y
安装wget
yum install -y wget
安装gcc
yum install -y gcc
5、安装python3并配置pip
安装python3
下载python
#下载
wget https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tgz
#解压
tar -zxvf Python-3.8.3.tgz
先安装make
yum install make -y
安装zlib,由于直接安装失败,我是通过源码安装的
yum -y install zlib -y
cd /var
mkdir www
cd www
mkdir setup
cd setup
wget http://www.im.com.cn/source/armhf/zlib-1.2.11.tar.gz
tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make && make install
安装openssl
yum install -y openssl
编择python3
mkdir /usr/local/python3 #创建编译安装目录
cd Python-3.8.3
./configure --prefix=/opt/python-3.7.1 --with-openssl=/opt/openssl-1.0.2q
make && make install
cd /var/www/setup
wget https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools.29.tar.gz
wget http://www.inhhh.com/download/wireless_tools.29.tar.gz
tar -zxvf wireless_tools.29.tar.gz
cd /var/www/setup/wireless_tools.29
make
make install
reboot
#关闭power_save
sudo iw wlan0 set power_save off
查看 power_save
iw waln0 get power_save
Don’t forget to add /usr/local/lib/ to /etc/ld.so.conf, and run ldconfig as root 意思就是编辑 /etc/ld.so.conf, 文件,加上一行
vi /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib/
使生效
sudo ldconfig
测试命令
iwlist
iwconfig
七,重装git 2.25.1
wget https://github.com/git/git/archive/v2.25.1.zip
git --version
yum remove git -y
unzip v2.25.1.zip
cd git-2.25.1
make prefix=/usr/local all
make prefix=/usr/local install
cd /var/www/setup
mkdir WiringPi
cd WiringPi
#克隆库
git clone https://github.com/WiringPi/WiringPi.git
#进入文件夹
cd WiringPi
#编译安装
./build
gpio -v
九、安装opencv
安装pkg-config
cd /var/www/setup
wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz
tar -zxvf pkg-config-0.29.2.tar.gz
cd pkg-config-0.29.2
./configure --prefix=/usr/local/pkg-config --with-internal-glib
make
make install
Raspberry Pi OS with desktop and recommended software 实际下载路径是 https://downloads.raspberrypi.org/raspios_full_armhf/images/raspios_full_armhf-2021-03-25/2021-03-04-raspios-buster-armhf-full.zip
2. 解压系统 解压后是一个8.4G的img文 件。
3.写入TF卡 使用常用软件 Win32DiskImager.exe 即可
4. 修改系统设置
树莓派禁止休眠、屏幕常亮 打开lightdm.conf sudo vi /etc/lightdm/lightdm.conf xserver-command=X