安卓手機改造服務器——基本環境配置(CentOS7 arm32)


安裝好CentOS系統之后,我們需要對環境進行一些基本的配置,讓Linux更好用


寫在前面

注意:本文章是針對arm32CentOS7進行配置的,其他系統或不同架構不要嘗試。

配置yum鏡像源

1、首先讓我們切換到root

su root

2、進入配置文件所在目錄

cd /etc/yum.repos.d/

3、以防萬一先備份,其實沒必要

mv CentOS-Base.repo CentOS-Base.repo.bak

4、使用vi命令編輯CentOS-Base.repo文件

vi 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、設置緩存,並更新鏡像配置

yum makecache

yum -y update

安裝 wget 命令

1、yum安裝

yum -y install wget

2、rpm安裝

wgetrpm包下載:點擊下載

推薦Package鏡像地址:http://mirrors.nju.edu.cn/centos-altarch/7/os/armhfp/Packages/

可以將rpm包放到掛載的目錄,在系統中用mv移動工作目錄

mv /mnt/linux-share/wget-1.14-18.el7_6.1.armv7hl.rpm /home/sw-code/ # 注意自己的

安裝rpm

rpm ivh wget-1.14-18.el7_6.1.armv7hl.rpm

安裝 lsof 命令

1、安裝

yum -y install lsof

2、使用lsof查看端口占用情況

lsof -i tcp:80

可能用到的命令

1、top顯示當前系統正在執行的進程的相關信息,包括進程ID、內存占用率、CPU占用率等

top

2、查看分區和磁盤

lsblk

3、查看空間使用情況

df -h

4、查看內存大小

free -h


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM