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 add previously downloaded .deb files to apt using command line so that they will not be downloaded again when I use sudo apt-get install?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Copy it to /var/cache/apt/archives with the following command:

sudo cp filename.deb /var/cache/apt/archives/

You may have to rename the deb files according to the cache, so start to download it with apt-get, get the name of the cached file from /var/cache/apt/archives/ then rename your file and copy it there overwriting the incomplete download and start apt-get again.

Of course you don't need this if you are copying from an old cache :)

share|improve this answer
    
Does copying to /var/cache/apt/archives/ means that they are recognized? –  user69453 Jun 19 at 11:15
    
@user69453 Yes, it is where apt-get stores its cache, so if you copy your deb file with the correct filename it should install it instead of downloading it again. –  nastys Jun 19 at 11:31

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.