Find the answer to your Linux question:
Results 1 to 9 of 9
Hi All, Is there a way to download packages to a particular directory (ie so I can just download 100 packages using apt-get to my home directory?). Furthermore, is there ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru jmadero's Avatar
    Join Date
    Jul 2007
    Location
    California
    Posts
    1,998

    Download Packages to Directory via apt-get?


    Hi All,

    Is there a way to download packages to a particular directory (ie so I can just download 100 packages using apt-get to my home directory?). Furthermore, is there a way for me to download the packages and all dependencies? Thanks in advance
    Bodhi 1.3 & Bodhi 1.4 using E17
    Dell Studio 17, Intel Graphics card, 4 gigs of RAM, E17

    "The beauty in life can only be found by moving past the materialism which defines human nature and into the higher realm of thought and knowledge"

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,754
    Google?

    Code:
    man apt-get
    ?

    Code:
    apt-get download
    ?

    Code:
    apt-cache depends <PKGNAME> | grep Depends | awk {' print $2 '} | xargs apt-get download
    ?

  3. #3
    Banned
    Join Date
    Nov 2011
    Location
    India
    Posts
    29
    Quote Originally Posted by HROAdmin26 View Post
    Google?

    Code:
    man apt-get
    ?

    Code:
    apt-get download
    ?

    Code:
    apt-cache depends <PKGNAME> | grep Depends | awk {' print $2 '} | xargs apt-get download
    ?


    Use following 'apt-get -d package-name'

    This will download all packages in /var/cache/apt/archives and if u want change this directory look into apt.conf and change Dir::Cache path

    --
    Manoj

  4. #4
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,754
    Use following 'apt-get -d package-name'
    Don't think that command will work. But this will:

    Code:
    apt-get -d install <PACKAGE>
    Let's get this out of the way: Depending on the version of apt installed, your options will vary. All of the examples posted will work *depending* on your version of apt. That is why "man apt-get" is the first thing to review.

  5. #5
    Linux Guru jmadero's Avatar
    Join Date
    Jul 2007
    Location
    California
    Posts
    1,998
    Thanks to both of you. I usually do extensive googling but I was at work and decided I may get faster results just posting a question (I know, lazy). I knew about download option but I specifically wanted it downloading to /home/user/.software and didn't see any options for that, but thanks for the advice
    Bodhi 1.3 & Bodhi 1.4 using E17
    Dell Studio 17, Intel Graphics card, 4 gigs of RAM, E17

    "The beauty in life can only be found by moving past the materialism which defines human nature and into the higher realm of thought and knowledge"

  6. #6
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,754
    So let's clarify again...

    If you Google and/or read the manual:

    The "apt-get download" (if your apt supports it) will download to the current working directory (but it only does a single package without dependencies, hence the apt-cache command.) The apt-get -d switch will download to whatever "cache" directory is specified in apt.conf, so it can be changed.

    Code:
    man apt.conf
    
    Dir::Cache contains locations pertaining to local cache information, such as the two package caches srcpkgcache and pkgcache as well as the location to place
           downloaded archives, Dir::Cache::archives. Generation of caches can be turned off by setting their names to be blank. This will slow down startup but save disk
           space. It is probably preferred to turn off the pkgcache rather than the srcpkgcache. Like Dir::State the default directory is contained in Dir::Cache

  7. #7
    Linux User TaZMAniac's Avatar
    Join Date
    Jan 2009
    Posts
    269
    Go to the repo's and download aptoncd.
    It downloads the packages you want or need and then you can burn them to a Cd.
    Alternatively, you can throw it on a USB drive.

    I used to use this program years ago to update systems on dial up.

  8. #8
    Linux Guru jmadero's Avatar
    Join Date
    Jul 2007
    Location
    California
    Posts
    1,998
    so I'm real close. The only issue is that it doesn't work for installed packages. I'm suing sudo apt-get -d install <PKGNAME>, seems to do the trick but it's not working for packages already installed. Basically I want to get all the packages required to run E17 from my Bhodi boot and then use those files in a custom iso I'm making. How do I download the packages that are already installed on the system? I'm getting a "already newest version". I read the man page and didn't see anything that's like "force download" or anything similar. Thank you
    Bodhi 1.3 & Bodhi 1.4 using E17
    Dell Studio 17, Intel Graphics card, 4 gigs of RAM, E17

    "The beauty in life can only be found by moving past the materialism which defines human nature and into the higher realm of thought and knowledge"

  9. #9
    Linux User sgosnell's Avatar
    Join Date
    Oct 2010
    Location
    Baja Oklahoma
    Posts
    464
    Code:
    dpkg --get-selections > ~/my-packages
    This puts a list of all your installed packages and their status into a file named my-packages in your home directory. You can run
    Code:
    sudo dpkg --set-selections < my-packages && sudo apt-get dselect-upgrade
    to install all those packages on another system.

Posting Permissions

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