尝试使用指定目录的 apt-get 下载并安装

Trying to download and install with apt-get with specified directory

我正在尝试 sudo apt-get --download-only <package_name> ??target_directory??,但我想指定下载位置,以便将来我想在 sudo apt-get --no-download <package_name> ??target_directory?? 没有互联网连接的情况下安装我预下载的软件包。这里的问题是,我想将目标目录选择为“/user/desktop/blabla”,但不知道如何使用 apt-get 指定它。

如果你能帮助我,我将不胜感激:) 祝你有个愉快的一天。

您可以使用-o选项指定下载目录:

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