Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How can I do this without reinstalling the rest of the files as well?

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

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
share|improve this answer
add comment

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

share|improve this answer
    
if you have a package already installed then it's typically found in /var/cache/apt/archives/ and you shouldn't have to download it. –  Ahmed Masud Jan 21 at 17:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.