I know that when it ешь to the RedHat distribution (correct я if гm mistaken), I хан использовал:
yumdownloader package_name #simply downloads a copy of the package without installing it
yum install package_name #installs the specific package that has to be downloaded in prior
is there an exact equivalent in ubuntu (that does both operations separately) or does the following command do both (download + install):
apt-get install package_name
thank you for yoгre help, it is much appreciated and I do apologize if this question is supposed to be asked elsewhere, I just thought this is the right нравится.
Используйте download
функция apt-get
.
От man apt-get
:
download
download will download the given binary package into the current directory.
, Например:
apt-get download chromium-browser
загрузит deb
файл браузера хрома в текущий каталог. Обратите внимание, что это не загрузит ни одной из зависимостей пакета поэтому, при попытке установить .deb
:
sudo dpkg -i path/to/downloaded/deb/file`
Вы получите ошибки зависимости.
apt-get install packageName
делает обоих (download+install) задания. Загруженные пакеты будут в /var/cache/apt/archives
папка
Просто добавьте -d
(или --download
) опция любому apt-get
команда. Этот подход является простым и эффективным.
Например:
$ sudo apt-get dist-upgrade -d
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
linux-headers-3.19.0-39 linux-headers-3.19.0-39-generic linux-image-3.19.0-39-generic linux-image-extra-3.19.0-39-generic
linux-signed-image-3.19.0-39-generic
The following packages will be upgraded:
keepassx linux-headers-generic linux-libc-dev linux-signed-generic linux-signed-image-generic
5 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 67,0 MB of archives.
After this operation, 289 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://nl.archive.ubuntu.com/ubuntu/ vivid-updates/main linux-image-3.19.0-39-generic amd64 3.19.0-39.44 [16,9 MB]
[...]
Fetched 67,0 MB in 4s (13,5 MB/s)
Download complete and in download only mode
В более позднее время, когда Вы в режиме офлайн, можно работать sudo apt-get dist-upgrade
завершать установку. (Отметьте Потребность получить 0 МБ B/67,0 архивов.)
$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
linux-headers-3.19.0-39 linux-headers-3.19.0-39-generic linux-image-3.19.0-39-generic linux-image-extra-3.19.0-39-generic
linux-signed-image-3.19.0-39-generic
The following packages will be upgraded:
keepassx linux-headers-generic linux-libc-dev linux-signed-generic linux-signed-image-generic
5 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/67,0 MB of archives.
After this operation, 289 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Это также работает с install
или другие команды:
$ sudo apt-get install -d libpcap-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libpcap0.8-dev
The following NEW packages will be installed:
libpcap-dev libpcap0.8-dev
0 upgraded, 2 newly installed, 0 to remove and 5 not upgraded.
Need to get 214 kB of archives.
After this operation, 749 kB of additional disk space will be used.
Do you want to continue? [J/n]
Get:1 http://nl.archive.ubuntu.com/ubuntu/ vivid/main libpcap0.8-dev amd64 1.6.2-2 [210 kB]
Get:2 http://nl.archive.ubuntu.com/ubuntu/ vivid/main libpcap-dev all 1.6.2-2 [3448 B]
Fetched 214 kB in 0s (1776 kB/s)
Download complete and in download only mode
Очистить кэш (сохраненный в /var/cache/apt/archives
):
sudo apt-get clean