You are not logged in.

#1 2020-06-20 11:11:59

Andy3153
Member
Registered: 2018-12-24
Posts: 89

Help with restoring a program to its original state

Is there any method, program, pacman operation, anything, to reinstall a program and remove all of its modified configurations and restore the original ones? I need to restore a couple of programs to their original state since I modified their configs a lot and if I try to remove them then reinstall the program, it won't work. Any help?

Offline

#2 2020-06-20 11:32:10

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,376

Re: Help with restoring a program to its original state

If they were system wide configuration files that are part of a pacman package you will get .pacnew/.pacsave files on reinstallation/removal, you can use pacman -Qkk to identify modified files and subsequently remove/reinstall them. But I doubt this is what you're asking.

Please be specific, what program, which configuration files, if you've adjusted them, what prevents you from deleting/moving away your adjustments? If it's configuration in your home directory you can usually just remove these and they will be regenerated on start. But identifying these requires knowledge of what the program is and is doing.

Last edited by V1del (2020-06-20 11:33:48)

Online

#3 2020-06-20 11:44:38

Andy3153
Member
Registered: 2018-12-24
Posts: 89

Re: Help with restoring a program to its original state

Well, I asked this in a more general way since I have encountered this problem before as well and I wanted to see if there's any general solution like (probably) apt-get purge on Debian-based systems, but MariaDB and nginx determined me to ask this time. I found out by myself that for MariaDB I only have to remove the /var/lib/mysql folder, but nginx doesn't really work anymore after removing /etc/nginx and /usr/share/nginx. I can't even start it anymore using systemctl.

Offline

#4 2020-06-20 11:59:38

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,376

Re: Help with restoring a program to its original state

They will be properly reinstated if you reinstall the nginx package. The closes to a apt purge is a

pacman -Rnc

in the case of nginx this will remove the package and things depending on it, leaving no configuration files behind (but even if you don't specify the -n it will leave .pacsave files that do not conflict with reinstated default configs)

Online

#5 2020-06-20 13:11:27

Andy3153
Member
Registered: 2018-12-24
Posts: 89

Re: Help with restoring a program to its original state

Well it did the same thing. It still wasn't starting
But, I looked at the status of it and I found out that it doesn't find the file /etc/nginx/mime.types, and I quite literally ran touch /etc/nginx/mime.types and it works now. So... problem solved? I'm not so sure

Offline

#6 2020-06-20 13:14:58

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,518
Website

Re: Help with restoring a program to its original state

So you manually deleted file managed by pacman and belonging to packages that you had installed ... then those packages stopped working.  Why is this a suprise?  You should not have used `touch' to create an empty mime.types,  you should have reinstalled any packages you broke when you deleted tracked files.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2020-06-20 13:33:19

Andy3153
Member
Registered: 2018-12-24
Posts: 89

Re: Help with restoring a program to its original state

I just said I tried reinstalling and it didn't bring back all the files, so that's why I did that

EDIT: To bring back the file, I installed nginx on my computer and I got the file back

Last edited by Andy3153 (2020-06-20 13:38:58)

Offline

#8 2020-06-20 13:39:56

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: Help with restoring a program to its original state

pacman -Qo /etc/nginx/mime.types

Figure out what you should have reinstalled.

Offline

#9 2020-06-20 14:12:38

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,518
Website

Re: Help with restoring a program to its original state

And more generally `sudo pacman -Qkq` to see other likely broken packages if you've been removing tracked files.

Last edited by Trilby (2020-06-20 14:13:01)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB