• 首页
  • 关于我
  • 微言微语
  • 归档速览
  • 左邻右里
  • 生活/记录
  • 摄影/资源
  • 网络/技巧
  • 客片/工作
  • 搜索
  • 夜间模式
    ©2010-2025  Hi,Jeray大叔 Theme by OneBlog
    搜索
    标签
    # 小茗 # 游玩 # Mily # 写真 # 游戏 # 人像 # 摄影 # 平江路 # 旅游 # 效率工具
  • 首页>
  • 网络技巧>
  • 正文
  • PVE下安装Debian12后的一些优化修改(小白日记)

    2024年12月06日 1.3 k 阅读 2 评论 5202 字

    前言
    因为需要在家中跑一些服务,需要安装Linux系统,外加宝塔面板。
    近期看了下Debian系统推荐的多,下载Debian12进行安装,宝塔面板成功安装,卡在了运行环境上,怎么都不行,后来度娘了些资料,这里做个整理更新。

    教程
    提示-bash: curl: command not found解决办法
    原版安装Debian12后需要安装sudo、curl等,才可以安装1Panel或宝塔面板。

    先安装sudo:

    apt-get install sudo
    

    再安装curl:

    sudo apt install curl
    

    宝塔的运行环境安装不了,主要卡在源的问题,所以我们要把更新源替换到国内源:

    1.备份原来的软件源列表:

    sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
    

    2.打开软件源列表文件:

    nano /etc/apt/sources.list
    

    将里面的内容清空,或者前面加#注释掉

    3.将以下内容复制到文件中,这里以清华大学镜像为例:

    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://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
    deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
    

    4.更新软件包列表:

    sudo apt update
    sudo apt-get upgrade
    

    其他源地址:

    腾讯源

    deb https://mirrors.tencent.com/debian/ bookworm main non-free non-free-firmware contrib
    deb-src https://mirrors.tencent.com/debian/ bookworm main non-free non-free-firmware contrib
    deb https://mirrors.tencent.com/debian-security/ bookworm-security main
    deb-src https://mirrors.tencent.com/debian-security/ bookworm-security main
    deb https://mirrors.tencent.com/debian/ bookworm-updates main non-free non-free-firmware contrib
    deb-src https://mirrors.tencent.com/debian/ bookworm-updates main non-free non-free-firmware contrib
    deb https://mirrors.tencent.com/debian/ bookworm-backports main non-free non-free-firmware contrib
    deb-src https://mirrors.tencent.com/debian/ bookworm-backports main non-free non-free-firmware contrib
    

    阿里源

    deb https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
    deb-src https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
    deb https://mirrors.aliyun.com/debian-security/ bookworm-security main
    deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main
    deb https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
    deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
    deb https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
    deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
    

    网易源

    deb https://mirrors.163.com/debian/ bookworm main non-free non-free-firmware contrib
    deb-src https://mirrors.163.com/debian/ bookworm main non-free non-free-firmware contrib
    deb https://mirrors.163.com/debian-security/ bookworm-security main
    deb-src https://mirrors.163.com/debian-security/ bookworm-security main
    deb https://mirrors.163.com/debian/ bookworm-updates main non-free non-free-firmware contrib
    deb-src https://mirrors.163.com/debian/ bookworm-updates main non-free non-free-firmware contrib
    deb https://mirrors.163.com/debian/ bookworm-backports main non-free non-free-firmware contrib
    deb-src https://mirrors.163.com/debian/ bookworm-backports main non-free non-free-firmware contrib
    

    中科大源

    deb https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
    deb-src https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
    deb https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
    deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
    deb https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
    deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
    deb https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
    deb-src https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
    

    小白的一些命令提示:

    切换root用户

    su - root
    

    返回根目录

    cd
    

    Debian系统设置静态IP地址、网关

    nano /etc/network/interfaces
    

    修改以下信息

    iface eth0 inet static   #static表示使用固定IP地址上网,dhcp表示使用动态ip
    address 192.168.123.100    #设置静态ip地址
    netmask 255.255.255.0   #子网掩码
    gateway 192.168.123.3    #网关
    

    配置Debian环境中的 DNS 服务器

    nameserver 114.114.114.114   #设置首选dns
    nameserver 8.8.8.8   #设置备用dns
    

    IP地址、网关、DNS配置完成。 重启网络使配置生效

    sudo service networking restart
    

    检查新配置是否工作

    ping baidu.com
    
    本文著作权归作者 [ Jeray大叔 ] 享有,未经作者书面授权,禁止转载,封面图片来源于 [ 互联网 ] ,本文仅供个人学习、研究和欣赏使用。如有异议,请联系博主及时处理。
    取消回复

    发表留言
    回复

    读者留言2

    1. xixi Lv.1
      2024-12-14 16:39 回复

      同样的小白一枚

      1. Jeray大叔 博主
        2024-12-23 15:30 回复
        @xixi

        小白也挺好的,每次进步一点,解决掉一些问题总是很开心

    加载更多评论
    加载中...
    — 已加载全部评论 —
    首页关于我微言微语归档速览左邻右里生活/记录摄影/资源网络/技巧客片/工作
    Copyright©2010-2025  All Rights Reserved.  Load:0.019 s
    苏ICP备08012166号-5
    Theme by OneBlog V3.6.3
    夜间模式

    开源不易,请尊重作者版权,保留基本的版权信息。