How to compile a software locally and install it offline?

Asked by Rahul Krishna

Hi,
I have this problem that my Internet speed is bit slow, so downloading a heavy software in the system via synaptic takes very large time(and patience).

What i want to do is to download the source code tar-ball from some other system(with faster Internet speed) and compile+install it off-line.

I read all the stuff given in wiki about compiling softwares. I installed build-essential etc required for compiling purposes. But then i cannot proceed even ./configure ! i cannot figure out a way to manage all the dependencies. I know what they are, but not sure where to download them from, and what to do after it is downloaded in tar-ball(I mean should i compile them and then install it in off-line system? how to do it?) second. since the number of dependencies that a software package needs is pretty much high(6-7 at-least) what should i do to easily download them, and not panic!

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Solved by:
mycae
Solved:
Last query:
Last reply:
Revision history for this message
mycae (mycae) said :
#1

Yes you can do this, however often the tarball is larger than the build, as it will often include things you don't need, such as features for other operating systems, extra copies of libraries that are not needed when dependency management is used, et etc.

To compile it all takes a long time -- this is something that gentoo is prmarily designed to do..

You can recompile each package with this procedure:
http://www.moosechips.com/2008/09/ubuntu-rebuild-a-source-package/

It would take a lot of your time to do this,.

A better option would be to simply install what you need without using the "suggests" dependencies, or maybe even not using the "recommends" dependencies. Note that doing this means you may get significantly reduced (or even broken!) functionality. You can use the "aptitude" program to handle this.

http://ubuntuforums.org/showthread.php?t=214164

Revision history for this message
Rahul Krishna (rahulkrishna) said :
#2

Thanks for your responce mycae! it was much helpful.

I read that forum thread and moosechips blog. they were interesting and maybe i should try aptitude. I am gathering more knowledge about that.

but i was thinking of another thing.

1. Synaptic installs software on the system.
    > how it does that? as i think: It first looks at the availability of package in the repository, then it looks at the dependencies required to be downloaded, downloads dependencies first, downloads package, and installs it

my question is,

1. since synaptic gets the package from the repository can't we download that, and install it on some other system offline?
2. how to proceed about that?

Revision history for this message
Best mycae (mycae) said :
#3

Synaptic, aptitude and apt-get all do a very similar set of tasks.

They look at the following remote file (Example here is 64 bit maverick)
http://archive.ubuntu.com/ubuntu/dists/maverick/main/binary-amd64/Packages.gz

then go through that list to see which packages require what other packages, as each package has an entry that looks like this (note the "Depends") line

Package: acct
Priority: optional
Section: admin
Installed-Size: 372
Maintainer: Ubuntu Developers <email address hidden>
Original-Maintainer: Mathieu Trudel <email address hidden>
Architecture: amd64
Version: 6.5.4-2ubuntu1
Depends: dpkg (>= 1.15.4) | install-info, libc6 (>= 2.4)
Filename: pool/main/a/acct/acct_6.5.4-2ubuntu1_amd64.deb
Size: 118064
MD5sum: 9a5cfe08530980c1bd5490d9d52f14e9
SHA1: 709f8df96a6964dc654680b699c9c212adf0a733
SHA256: b00693b4b042c772209084b32ced9822f83f19834ee432faf2e79d350b84a51b
Description: The GNU Accounting utilities for process and login accounting
 GNU Accounting Utilities is a set of utilities which reports and summarizes
 data about user connect times and process execution statistics.

When you want to download a particular package, you have to install not only the package, but every depends.

The package is then downloaded from the same remote site, eg:
http://archive.ubuntu.com/ubuntu/pool/main/a/acct/acct_6.4~pre1-4ubuntu1_amd64.deb

All the dependencies, as well as their dependencies and so on are also downloaded, then installed.

If you have multiple machines, you can set up a server to cache each package that is downloaded, such that the package only needs to be downloaded once.

https://help.ubuntu.com/community/Apt-Cacher-Server

Revision history for this message
Rahul Krishna (rahulkrishna) said :
#4

Thanks mycae, that solved my question.