0

I've been trying to set up a tor relay, but I ended up deleting the /etc/tor/torrc configuration file after messing it up too much and figuring that tor would create a new unmodified config file after failing to locate it. This didn't turn out to be the case, and reinstalling the tor package didn't restore the config file either.

So in general, what can be done to reset a software package, restoring its configuration state back to when it was first installed? This problem has plagued me before but I haven't come across the solution yet.

Thanks!

Edit: I'm running Ubuntu 18.04

  • 1
    You haven't provided your release info, but dpkg -S /etc/tor/torrc will tell you the package that it came from (tor: /etc/tor/torrc on my release) and then you could try dpkg-reconfigure tor to re-run the post-install setup script (what it does depends on what the packager had it do, but it's what I'd try) – guiverc Jun 13 '20 at 01:03
  • Oops, my bad, I haven't had much experience posting questions here and I was careless. I'm on Ubuntu 18.04. Those commands did what I wanted to do, thanks. – Morgan087 Jun 13 '20 at 17:35
  • Actually on closer examination, dpkg-reconfigure tor didn't restore the default configuration files. I deleted /etc/tor and ran the command again, but that didn't do it either... – Morgan087 Jun 13 '20 at 17:51

1 Answers1

0

When you need to remove a package you have 2 options :

dpkg -r PACKAGE

will remove the package but keep all configurations files

dpkg -P PACKAGE

will remove the package and all configurations files . if the package is already removed will remove configurations files .

more informations ( man dpkg )

EchoMike444
  • 582
  • 1
  • 3
  • 4