安卓手机改造服务器——基本环境配置(CentOS7 arm32)
安装好CentOS系统之后,我们需要对环境进行一些基本的配置,让Linux更好用
写在前面#
注意:本文章是针对arm32
的CentOS7
进行配置的,其他系统或不同架构不要尝试。
配置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
安装
wget
的rpm
包下载:点击下载
推荐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
作者:sw-code
出处:https://www.cnblogs.com/sw-code/p/14994444.html
版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。
未经作者同意,请勿转载;若经同意转载,请在文章明显位置注明作者和出处。
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· PostgreSQL 和 SQL Server 在统计信息维护中的关键差异
· C++代码改造为UTF-8编码问题的总结
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· 清华大学推出第四讲使用 DeepSeek + DeepResearch 让科研像聊天一样简单!
· 实操Deepseek接入个人知识库
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库