Thursday, January 6, 2022

[SOLVED] Trying to download and install with apt-get with specified directory

Issue

I am trying to do sudo apt-get --download-only <package_name> ??target_directory?? but i want to specify the download location so that, in future i want to install my pre-downloaded package without internet connection with sudo apt-get --no-download <package_name> ??target_directory??. The problem here is, I want to choose the target directories as '/user/desktop/blabla' but don't know how to specify it with apt-get.

If you can help me, I will be grateful :) Have a nice day.


Solution

You can specify the download directory by using the -o option:

apt-get install -d -o=dir::cache=/user/desktop/blabla <package-name>


Answered By - explorer_anton