Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

share|improve this question

2 Answers 2

up vote 7 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
It should also be noted that apt-get download downloads to the current working directory . – Poul Sørensen Jan 18 at 16:14

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.


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 '14 at 17:00

Your Answer


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.