前言
因为需要在家中跑一些服务,需要安装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
同样的小白一枚
小白也挺好的,每次进步一点,解决掉一些问题总是很开心