編碼的世界 / 優質文選 / 感情

樹莓派centos7系統安裝配置


2022年6月06日
-   

目錄1.燒錄系統
2.配置自動連接wifi
3.擴展內存
4.更換yum源
5.docker安裝
1.燒錄系統
Centos ARM芯片的版本下載地址:http://mirror.centos.org/altarch/7/isos/armhfp/

首先,格式化內存卡,然後將下載的Centos系統解壓,寫入系統到SD卡中,最後將SD卡插入樹莓派。
2.配置自動連接wifi
首先,進入vi /etc/wpa_supplicant/wpa_supplicant.conf 文件中配置:
network={
ssid="無線網名稱"
psk="密碼"
priority=10
}

然後,連接wifi,配置好後每次啟動自動連接無線網。
nmcli d wifi connect 無線網名稱 password '密碼'

3.擴展內存
rootfs-expand


4.更換yum源
首先,將/etc/yum.repos.d/ 文件夾下的文件除了CentOS-Base.repo 都刪掉
# 1. 編輯CentOS-Base.repo
[root@centos-rpi3 ~]# vi /etc/yum.repos.d/CentOS-Base.repo
# 2. 不會用vi的朋友別亂動,可以按著d鍵不松手,即可清空整個文件
# 會的朋友直接清空它就行了
# 3. 複制下面的文字到這個文件中,使用putty的話就是在windows下複制,然後再putty中右鍵就可以粘貼
# 4. 按Esc,然後輸入引號內的內容:“:wq”注意英文符號,隨後會退出vi
# 5. 執行下面兩句代碼:
yum clean all
yum makecache

CentOS-Base.repo 文件內容
# 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

5.docker安裝
安裝
#docker安裝
sudo yum install docker -y
docker version


啟動
service docker start


查看鏡像列表
#拉取鏡像
docker pull [options] name[:tag]
#查看鏡像列表
docker images [options] [repository[:tag]]

熱門文章