软件安装
1.检查你的Linux系统是否可以上网,如果不能上网,配置使其能够上网
[root@test-server ~]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=128 time=203 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=128 time=207 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=128 time=203 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=128 time=204 ms
........
2.查看你的系统的发行版信息,给你的系统安装阿里云的YUM源
[root@test-server ~]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
[root@test-server ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@test-server ~]# yum makecache
3.yum安装mariadb-server数据库服务程序
[root@test-server ~]# yum install mariadb-server -y
4.iptraf是一款局域网监控工具,通过yum查看iptraf-ng命令是由哪个软件包提供,并安装上它
[root@test-server ~]# yum provides iptraf-ng
5.安装Apache服务器,完成后查看其安装的目录和文件
[root@test-server ~]# yum install httpd -y
[root@test-server ~]# rpm -ql httpd
6.卸载httpd和mariadb-server软件包
[root@test-server ~]# yum remove httpd
[root@test-server ~]# yum remove mariadb-server
7.断开Linux系统网络,使其不能连入互联网
[root@test-server ~]# nmcli connection down yu
[root@test-server ~]# ping 8.8.8.8
connect: 网络不可达
8.使用Linux系统的安装光盘镜像,搭建一个本地YUM源
[root@test-server ~]# mount /dev/cdrom /media/cdrom/
mount: /dev/sr0 写保护,将以只读方式挂载
[root@test-server Packages]# vim /etc/yum.repos.d/local.repo
[local]
name=user_local
baseurl=file:///media/cdrom
enabled=1
gpgcheck=0
9.使用本地YUM源成功安装httpd和mariadb-server软件
[root@test-server ~]# yum install httpd* --skip-broken
[root@test-server ~]# yum install mariadb-server -y
10.卸载httpd和mariadb-server软件包
[root@test-server ~]# yum remove httpd* mariadb-server*
编译安装软件
1.下载最新的python3软件包:Python-3.7.2.tar.xz
[root@test-server ~]# wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
2.编译安装python3
需要提前安装依赖包: wget sqlite-devel xz gcc automake zlib-devel openssl-devel epel-release git libffi-devel
[root@test-server ~]# yum install -y wget sqlite-devel xz gcc automake zlib-devel openssl-devel epel-release git libffi-devel
[root@test-server ~]# tar -Jxf Python-3.7.2.tar.xz -C /usr/src
[root@test-server Python-3.7.2]# ./configure --prefix=/path/to/somefile ## 指定程序存放路径
[root@test-server Python-3.7.2]# make
[root@test-server Python-3.7.2]# make install
## 配置环境变量(全局)
[root@test-server ~]# vim /etc/profile
在expot上添加一行 PATH=/path/to/somefile/bin:$PATH
[root@test-server ~]# source /etc/profile
[root@test-server ~]# echo $PATH
/path/to/somefile/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
[root@test-server ~]# python3
Python 3.7.2 (default, Oct 28 2020, 16:40:52)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print('123456')
123456
>>> ^C
KeyboardInterrupt
>>>