Georg Schölly Asked: 2011-04-27 10:45:09 +0800 CST2011-04-27 10:45:09 +0800 CST 2011-04-27 10:45:09 +0800 CST How to restore a single file from a package? 772 How can I do this without reinstalling the rest of the files as well? package-management 2 Answers Voted Best Answer enzotib 2011-04-27T10:57:43+08:002011-04-27T10:57:43+08:00 Download the package, for example transmission-daemon, with sudo apt-get --download-only install transmission-daemon unpack the package with mkdir ~/dummy dpkg-deb -x /var/cache/apt/archives/transmission-daemon_*.deb ~/dummy restore the file, for example /etc/init.d/transmission-daemon sudo cp ~/dummy/etc/init.d/transmission-daemon /etc/init.d remove the dir rm -rf ~/dummy camypaj 2012-06-21T06:46:45+08:002012-06-21T06:46:45+08:00 I know this is a bit old, but here's my improvement: $ sudo apt-get download <package-name> instead of $ sudo apt-get --download-only install <package-name> I had a situation where the package was already installed (hence, the proposed solution didn't work), and I wanted to restore just one config file, in order to fix the problem. Cheers
Download the package, for example
transmission-daemon
, withunpack the package with
restore the file, for example
/etc/init.d/transmission-daemon
remove the dir
I know this is a bit old, but here's my improvement:
instead of
I had a situation where the package was already installed (hence, the proposed solution didn't work), and I wanted to restore just one config file, in order to fix the problem.
Cheers