• 盒子代购配置、付费咨询可随缘联系Q:173753438

debian10通过SSH和VNC重装为centos7

运维 vps333 2周前 (09-03) 203次浏览 0个评论

由于centos7停止维护,部分主机商停止提供,又或者不想要主机商预制的系统,由于centos7特殊性无法自动网络重装这里写一下手动重装的方法。
下载网络启动包

mkdir /boot/centos7/
cd /boot/centos7/
wget https://mirrors.huaweicloud.com/centos/7/os/x86_64/isolinux/vmlinuz
wget https://mirrors.huaweicloud.com/centos/7/os/x86_64/isolinux/initrd.img

修改timeout=5555 增加启动项时间

nano /etc/default/grub

编辑文件 注意文件内的IP地址需要填写正确

nano /etc/grub.d/40_custom
menuentry "Install centos7" {
   set root=(hd0,1)
   linux /boot/centos7/vmlinuz headless ip=192.168.123.119 netmask=255.255.255.0 gateway=192.168.123.1 dns=8.8.8.8 ksdevice=eth0 method=https://mirrors.huaweicloud.com/centos/7/os/x86_64/ lang=en_US keymap=us
   initrd /boot/centos7/initrd.img
}

更新grub 输入reboot 去VNC 安装吧

update-grub
reboot

另外再放个国外源地址 img.cs.montana.edu
启动后缺少源

curl -o /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-7-reg.repo
yum clean all & yum makecache

查看当前源

yum repolist

备份源

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

其他阿里云和腾讯云 如需wget 把curl -o 改成wget -O 注意O是大写的curl命令中是小写的

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo

VPS生生生 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:debian10通过SSH和VNC重装为centos7
喜欢 (0)

您必须 登录 才能发表评论!