DEV Community

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

Posted on

1

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.

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay