Results 1 to 3 of 3

Thread: Ubuntu command to download the .deb file of a package along with its dependencies.

  1. #1
    Join Date
    Oct 2024
    Beans
    2

    Question Ubuntu command to download the .deb file of a package along with its dependencies.

    I am trying to download the .deb files of a package that is already installed on my Ubuntu Server.
    But I am in need of its .deb files along with all the dependencies packages that are required by that package to get installed with it as well.
    For Example: We have the following command in SLES Linux OS to download the packages for lvm2 along with its dependencies packages.
    "zypper install --download-only lvm2"
    The output was the list of packages that was obtained for lvm2 along with the dependencies packages that are required for lvm2 to function without any issues.
    So, I am looking for a similar command in Ubuntu as well to achieve the same task.

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Ubuntu command to download the .deb file of a package along with its dependencies

    Synaptic will let you create a list of all the dependencies for a package.
    File --> Generate Package Download Script

  3. #3
    Join Date
    Jul 2013
    Location
    Wisconsin
    Beans
    5,022

    Re: Ubuntu command to download the .deb file of a package along with its dependencies

    Start from a LiveUSB's "Try Ubuntu" environment, available on both Desktop and server.

    This prevents haywiring your existing system. You can use the LiveUSB on any other convenient hardware to obtain the answers.
    It lets apt start at a commonly-defined point (fresh install), preventing surprises later. "Drat, that wasn't on my list!"


    For a mere list of packages
    Code:
    sudo apt update
    apt install --simulate <package_name>         // sudo is not required for simulate

    To download the packages into /var/cache/apt/archives
    Code:
    sudo apt update
    sudo apt install --download-only <package_name>

    Alternately, you can query the working system, though sometimes the answers may be incomplete or misleading, depending upon what else might be installed.
    The list of packages and subsequently orphaned dependencies on your current system:
    Code:
    apt --simulate autoremove <package_name>     // sudo is not required for simulate

    Or you can ask apt for the first level of dependencies, and tediously iterate through each of those for subsequent levels.
    Code:
    apt depends <package_name>                // sudo not required for dependency queries

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •