Created Thu Sep, 03 2020 at 08:50PM
Original thread: https://askubuntu.com/questions/66533/how-can-i-restore-configuration-files
$ dpkg -S unity-greeter.conf
unity-greeter: /etc/lightdm/unity-greeter.conf
As you can see, the name of the package is unity-greeter
.
If you deleted a directory, like /etc/pam.d
, you can list every package that added to it by using the directory path:
$ dpkg -S /etc/pam.d
login, sudo, libpam-runtime, cups-daemon, openssh-server, cron, policykit-1, at, samba-common, ppp, accountsservice, dovecot-core, passwd: /etc/pam.d
<package-name>
with the name of the package:sudo apt install --reinstall -o Dpkg::Options::="--force-confask,confnew,confmiss" <package-name>
And for restoring the directory:
sudo apt install --reinstall -o Dpkg::Options::="--force-confask,confnew,confmiss" $(dpkg -S /etc/some/directory | sed 's/,//g; s/:.*//')
Configuration file `/etc/lightdm/unity-greeter.conf', does not exist on system.
Installing new config file as you requested.
apt-cache pkgnames pulse |xargs -n 1 apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall