VMware® Workstation 17 Proan安装Debian12全过程

本文详细指导了如何在Debian12上进行网络配置,包括静态IP设置、DHCP问题处理、apt源切换到国内镜像、安装常用软件(如SSH、lsof、netstat)、配置swapon交换内存及pip源,同时解决了遇到的一些常见问题,如网络连接问题和torch安装错误。
摘要由CSDN通过智能技术生成

说明:

  • 如果是debian9,参考另一篇博文:https://editor.csdn.net/md/?articleId=133673149

准备工作

  • 下载Debian12镜像(极简版)
  • 下载wm 17pro

网络设置

  • 在安装过程中,如果出现了DHCP配置问题,直接跳过处理处理,后续按照本文档处理,设置静态ip即可
  • 按照下面的截图进行网络配置,避免网络异常的问题
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
  • 查看ip的配置情况,使用指令 ip addr
  • 查看网卡的配置项数据
    • nano /etc/network/interfaces
    • 如果没有配置gateway地址,按照上面的设置应该就是192.168.220.2,配置方法如下(此方法注意,有时候我发现不需要设置,也是能正常联网的,那就不需要设置,设置了反而会出错):
    # 具体数值按照实际情况进行配置
     9 allow-hotplug eth0
    10 auto eth0
    11 iface eth0 inet static
    12 address 192.168.220.138
    13 netmask 255.255.255.0
    14 gateway 192.168.220.2
    
    • nano /etc/resolv.conf 文件(如果不存在,则先touch /etc/resolv.conf 文件)
      • 设置如下: nameserver 192.168.220.2
    • 重启一下网卡: /etc/init.d/networking restart 即可,可以ping一下www.baidu.com 或者主机的ip是否能够ping通,如果能够ping通,则说明网络正常了
    • 通过ip addr 可以查看当前的网卡的具体信息,看到ip是192.168.220.138 即表示正常了

配置apt的源

  • 这个是debian12,则国内的源地址是:
  • nano /etc/apt/sources.list # 用于设置apt的源
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware

deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
  • 设置完成后,执行 apt update 进行更新

安装常用软件

  • ssh服务:apt-get install openssh-server
  • lsof 服务: apt install lsof
  • netstat 服务: apt install net-tools

设置swapon的交换内存空间

  • 参考:

配置pip的源的方法

  • pip install pymysql -i https://mirrors.aliyun.com/pypi/simple/
  • 设置永久的pip源地址:
    • 参考网站:https://blog.csdn.net/qq_33182424/article/details/107072904

遇到的问题

  • 1.在设置DHCP的时候错误了
    • 错误截图: 在这里插入图片描述
    • 在安装的时候出现上面的问题,先跳过执行
    • 按照上面的网络进行配置即可,看到DHCP就会自动的分配一个ip
    • 上面没有写清楚,参考https://cloud.tencent.com/developer/article/1726738 配置如下:
      • auto eth0 iface eth0 inet dhcp 实际没有效果
    • 按照网页设置,是可以设置好静态的ip的,但是还是无法ping通’www.baidu.com’网页
  • 2.connect: network is unreachable
  • 3.swapon,mkswap 命令找不到
    • 增加了清华源的所有的数据再使用apt-get update试试重新安装
    1. pip install torch error: externally-managed-environment?
    • 解决方案:sudo mv /usr/lib/python3.11/EXTERNALLY-MANAGED /usr/lib/python3.11/EXTERNALLY-MANAGED.old 即可
  • 9
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值