Linux 在centos(vps)的特定目录中还原已删除的文件

Linux 在centos(vps)的特定目录中还原已删除的文件,linux,centos,rpm,yum,Linux,Centos,Rpm,Yum,我意外删除了/etc/yum.repos.d目录中的所有文件 yum repolist all Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile repolist: 0 yum install svn Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile There are no enabled repos.

我意外删除了/etc/yum.repos.d目录中的所有文件

yum repolist all
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
repolist: 0

yum install svn
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
There are no enabled repos.
  Run "yum repolist all" to see the repos you have.
  To enable Red Hat Subscription Management repositories:
     subscription-manager repos --enable <repo>
  To enable custom repositories:
     yum-config-manager --enable <repo>
yum或up2date列出所有
加载的插件:FastTestMirror
从缓存的主机文件加载镜像速度
报告列表:0
yum安装svn
加载的插件:FastTestMirror
从缓存的主机文件加载镜像速度
没有启用的回购协议。
运行“yum repolist all”查看您拥有的repo。
要启用Red Hat订阅管理存储库,请执行以下操作:
订阅管理器repos--启用
要启用自定义存储库,请执行以下操作:
yum配置管理器--启用

如何还原特定目录下的文件?

您无法神奇地还原所有文件,我们无法知道您拥有哪些存储库


你能做的最好的事情就是看看一台类似的机器(也是redhat)和文件。如果是相同的操作系统和版本,您可以只复制文件。这样,您至少可以重新启用默认存储库,可能还有epel。

您有快照吗?如果没有找到类似的机器(相同的发行版)并复制文件。谢谢@RomeoNinov,我会试试