一.python安装与配置
1.将软件包拖入虚拟机
2.进行解压
tar -zxvf Python-3.12.4.tgz
3.进行安装编译--在解压后的目录中找到confi
[root@localhost Python-3.12.4]#cd Python-3.12.4
[root@localhost Python-3.12.4]#./configure prefix=/usr/local/python3124 //配置编译文件 prefiex--前置 =/usr/local--位置 python3.12.4文件名
make:***没有指明目标并且找不到makefile。停止 解决措施
解决办法:缺少gcc依赖包因此需要下载gcc依赖包
[root@localhost Python-3.12.4]#yum -y install gcc
[root@localhost Python-3.12.4]#make
4.
[root@localhost Python-3.12.4]# make && make install
在/usr/local/python3.12 找到python3.12可执行文件
[root@localhost ~]# cd /usr/local/python3124/
[root@localhost python3124]# ls
bin include lib share
5.
[root@localhost python3124]# cd bin
[root@localhost bin]# ls
2to3 2to3-3.12 idle3 idle3.12 pydoc3 pydoc3.12 python3 python3.12 python3.12-config python3-config
[root@localhost bin]# ./py
pydoc3 pydoc3.12 python3 python3.12 python3.12-config python3-config
6.执行python3.12
[root@localhost bin]# ./python3.1
Python 3.12.4 (main, Jul 10 2024, 10:00:46) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
7.修改配置文件
[root@localhost bin]# vim /etc/profile
在最后一行export PATH=/usr/local/python3124/:$PATH
[root@localhost bin]# soure /etc/profile
二.网络配置
1.查看网卡信息
[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.216.42 netmask 255.255.255.0 broadcast 192.168.216.255
inet6 fe80::6487:64e7:954f:f84f prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:fa:8a:d9 txqueuelen 1000 (Ethernet)
RX packets 28747 bytes 29654823 (28.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15183 bytes 2819143 (2.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 580 bytes 50456 (49.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 580 bytes 50456 (49.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
2.添加网卡
3.如何禁用或重新激活网卡,以及修改IP地址
[root@localhost ~]# ifconfig ens36 192.168.200.2 netmask 255.255.255.0 //修改网卡ens36的IP地址
[root@localhost ~]# ifconfig
ens36: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.200.2 netmask 255.255.255.0 broadcast 192.168.200.255
[root@localhost ~]# ifconfig ens36 down //临时停用IP地址
[root@localhost ~]# ifconfig ens36 up
若停止则无法访问到:
4.hostname
临时修改hostname
[root@localhost ~]# hostname aa
[root@localhost ~]# hostname
aa
永久性修改hostname
方式1:
[root@localhost ~]# vim /etc/hostname
[root@localhost ~]# cat /etc/hostname
方式2:
[root@localhost ~]# hostnamectl set-hostname mm
)查看本主机IP
[root@hostname ~]# hostname -i