Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Default package config files

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
mm3100
Posts: 336
Joined: 2020-10-21 21:39
Has thanked: 8 times
Been thanked: 13 times

Default package config files

#1 Post by mm3100 »

Hello there,
After checking for changes in my configuration files I wondered what would be best way to get back default configuration. After looking it up, one way is to reinstall package

Code: Select all

apt -o Dpkg::Options::=--force-confnew reinstall [package]
But have been wondering is there a way to only reinstall missing or configuration files instead of whole thing?

Also as to check for difference in configuration files I have used both dpkg -V and debsums -a. Is there a reason to use one over another tool, as they accomplish the same thing?

seeker5528
Posts: 61
Joined: 2021-09-18 00:37
Been thanked: 2 times

Re: Default package config files

#2 Post by seeker5528 »

If I thought there were missing files I would probably just reinstall the whole package.

I was curious about the configuration file part though, so I did a quick search and found something about using 'dpkg --fsys-tarfile' and piping to tar, so with that information I was able to do this:

Code: Select all

apt-file search qemu.conf
apt-file search libvirt.conf
To find which packages include the files I was looking for, then:

Code: Select all

dpkg --fsys-tarfile /var/cache/apt/archives/libvirt-clients_7.6.0-1_amd64.deb | tar --extract ./etc/libvirt/libvirt.conf
dpkg --fsys-tarfile /var/cache/apt/archives/libvirt-daemon-system_7.6.0-1_amd64.deb | tar --extract ./etc/libvirt/qemu.conf
to extract to the current directory. Note that there is a dot in the file path inside the archive.

seeker5528
Posts: 61
Joined: 2021-09-18 00:37
Been thanked: 2 times

Re: Default package config files

#3 Post by seeker5528 »

Or to really get just the file without the path.

Code: Select all

dpkg --fsys-tarfile /var/cache/apt/archives/libvirt-daemon-system_7.6.0-1_amd64.deb | tar -O --extract ./etc/libvirt/qemu.conf > qemu.conf

Post Reply