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
?
1 Answer
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 :)
-
Does copying to
/var/cache/apt/archives/
means that they are recognized? Jun 19, 2014 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.– nastysJun 19, 2014 at 11:31