1

Ideally, I would like to specify architecture and Ubuntu version and download all dependencies for that package, then take them to another computer.

I know about apt-get download.... and that would work fine if the architectures and versions matched. I do see an architecture modifier, but not a version modifier.

Any help, or pointing me toward how to accomplish this with aptitude or another package tool would be appreciated.

even if I could take one .deb to the target computer and list all concrete dependencies... that would really solve the problem.

3pi14
  • 11

2 Answers2

0

Try using dpkg-offline. Install bzr, then:

bzr branch lp:dpkg-offline

there's a tutorial and a readme file included in there.

Assuming you want to install git on an Ubuntu 14.04 amd64 system, even if your system is e.g. 12.04 i386, you can:

  • download the ubuntu-14.04-desktop-amd64.iso image
  • Run dpkg-offline ubuntu-14.04-desktop-amd64.iso git
  • You'll obtain a tar.gz which you can transport to the target system, it will contain the seed package (git) and all its dependencies. It also includes a helper script to add a local repository, so you can use apt-get to install your packages.

Disclaimer: I wrote dpkg-offline.

roadmr
  • 34,222
  • 9
  • 81
  • 93
  • You should consider adding this answer to http://askubuntu.com/questions/974/how-can-i-install-software-or-packages-without-internet-offline. – muru Sep 09 '14 at 21:48
0

Maybe you want to create a local repository?

For that you should download all packages from the public repository and save them in our local Ubuntu server hard drive.

If so this is the procedure:

First install the main applications:

sudo su
apt-get update
apt-get install apt-mirror apache2

Now create a directory on your harddisk to save all packages:

sudo su
mkdir /localrepo

Now, open the file /etc/apt/mirror.list and make the changes as shown below:

sudo su
nano /etc/apt/mirror.list

############# config ##################
#
set base_path    /localrepo
#
# set mirror_path  $base_path/mirror
# set skel_path    $base_path/skel
# set var_path     $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch  <running host architecture>
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads     20
set _tilde 0
#
############# end config ##############

deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse

clean http://archive.ubuntu.com/ubuntu

Control + O, save file. Control + X, close nano

In the above configuration file, you can add the Ubuntu source lists depending upon the 32bit and 64bit architectures and distribution you use.

Once you saved the configuration file, populate your repository using the following command:

sudo su
apt-mirror

You need to run this command every week to get new softwares/updates.

To configure in client side. Just open your client systems file /etc/apt/sources.list and add your local repository path:

sudo su
nano /etc/apt/sources.list 

##########################
deb http://10.120.1.2/ubuntu trusty universe
deb http://10.120.1.2/ubuntu trusty main restricted
deb http://10.120.1.2/ubuntu trusty-updates main restricted
##########################

Here 10.120.1.2 is your Ubuntu server IP address

Control + O, save file. Control + X, close nano

The clients need not to be connected to the Internet to download packages.

The clients will get all packages from your Ubuntu local repository.

Source: https://wiki.debian.org/HowToSetupADebianRepository

kyodake
  • 15,401