DEV Community

Cover image for I accidentally wiped off files from /etc/yum.repos.d in my Centos 7.
vanquisher
vanquisher

Posted on

I accidentally wiped off files from /etc/yum.repos.d in my Centos 7.

In this post, I will explain how I restored .repo files which I accidentally wiped off.

Some basics,

What is yum ?

Yum is the package manager in Centos, Fedora and Rhel. It actually goes through the .repo file in /etc/yum.repos.d . Yum downloads and install the packages.

What is present in /etc/yum.repos.d directory?

It contains yum configuration files with .repo extension. These .repo files contains the URL to the servers where to fetch the packages. Not only remote(HTTP,FTP..) but also can contain local(ie., local packages in your disk) repositories.

Okay, that's the basics.

How I restored those .repo files ?

I copied those files over ssh from similar system running.

It's a simple command.

sudo su -
scp /etc/yum.repos.d/* user1@192.168.43.92:/etc/yum.repos.d 
Enter fullscreen mode Exit fullscreen mode

Syntax

scp source_username@source_ip:filename destination_username@destination_ip:filename
Enter fullscreen mode Exit fullscreen mode

Pre-requsite: Both the systems must be connected over SSH before copying.

Top comments (0)