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

时间:2019-11-28 05:31:12

标签: 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.
  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>

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

1 个答案:

答案 0 :(得分:2)

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

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