I currently possess 2 machines with the same version of Ubuntu as the title says, one is for the downloading the Packages and one for installing.

After the download has finished I'm transferring the .deb packages to the other machine and trying to install it.

I've successfully downloaded the package with the following command:

sudo apt-get install --download-only vim

the output from that command is a .deb file that can be installed using

dpkg -i <package name>

But when trying to install with dpkg its throwing an error of dependencies.

How its possible if I'm using the apt-get install --download-only?

I've already tried a lot of ways using

Use --download-only:

sudo apt-get install --download-only pppoe This will download pppoe and any dependencies you need, and place them in /var/cache/apt/archives. That way a subsequent apt-get install pppoe will be able to complete without any extra downloads.

Another way:

Getting .deb package dependencies for an offline Ubuntu computer through Windows

  • Are you install to the same machine, where you did the apt-get? Commented Mar 22, 2020 at 15:13
  • No different machine but same version of ubuntu 18.04.1 sorry forgot to add, i'll edit the question
    – Dor Shamay
    Commented Mar 22, 2020 at 15:14
  • vim depends, examples packages.ubuntu.com/bionic-updates/vim Commented Mar 22, 2020 at 18:26

1 Answer 1


You would have to apt-get --download-only in a computer that has the exact same packages, because those dependencies will apply. It could work in other cases too though, if they are similar enough.

To be sure you need to run apt-get in the target computer:

$ sudo apt-get install --print-uris package_name

That will list the packages that would be downloaded, if you had internet there. You move the list to the other computer, download the files, and then move them to /var/cache/apt/archives in the target computer.

Then you can run the apt-get command:

$ sudo apt-get install package_name

To get the list of files so that you can use it right away, in the target computer you can do:

$ sudo apt-get install --print-uris package_name | | grep MD5Sum | cut -d"'" -f2 > download.txt

You then copy the file download.txt to the the computer with internet and you download the packages:

$ wget -i download.txt

And then move all those _deb_s you just downloaded to /var/cache/apt/archives in the target computer and you are ready to run the apt-get install command.

  • I've tried both ways of the articles that I've added and its still looking for dependencies, the systems are the same version and the same packages installed 100%.
    – Dor Shamay
    Commented Mar 22, 2020 at 15:46
  • Ok, then show the error message and somebody might be able to help you. The steps above always work, even with different versions, are you sure you followed them? They can look similar to other solutions. Maybe your error message sheds some light. Also add the list of packages you copied from one computer to the other. Commented Mar 22, 2020 at 15:49
  • Currently I'm using this example just to install vim to test things out, I've copied the .deb files that came out from the install --print uris to /var/cache/apt/archives and after I'm trying to install using apt-get install and error comes up: Could not resolve hosts (probably because there's no internet)
    – Dor Shamay
    Commented Mar 22, 2020 at 15:56
  • Here's the error: sudo apt-get install -y vim Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: ctags vim-doc vim-scripts The following NEW packages will be installed: vim 0 upgraded, 1 newly installed, 0 to remove and 573 not upgraded. Need to get 1,152 kB of archives. After this operation, 2,852 kB of additional disk space will be used. Ign:1 http://il.archive.ubuntu.com/ubuntu bionic-updates/main amd64 vim amd64 2:8.0.1453-1ubuntu1.1
    – Dor Shamay
    Commented Mar 22, 2020 at 16:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .