[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to add dependencies that exist in another repository



Reza Alemi <alemi.reza@gmail.com> writes:

> Hello all,
> I don't seem to be able to find my answer searching the net, so please
> forgive me if my question is too trivial.
>
> I am packaging a product which is dependent on sun-java6-sdk (upstream
> says it won't work with openjdk). in ubuntu, that package is in the
> partner repository which I can get user consent to add, using debconf.
>
> in shell, I would normally do an add-apt-repository for the repository
> and then an apt-get update before I can install the sun-java6-sdk
> package.
>
> my question is, can I do something like that in my own install scripts?
> can I run add-apt-repository and apt-get update while the package is
> being installed? won't it break if the package is installed with
> aptitude or dpkg an on debian instead of ubunut?  
>
> Thank you,
> Rex

No. It will not work:

1) While you install apt holds the lock so you can't just call apt-get
update.

2) The user might not be using apt. There are alternatives.

3) Your package depends on sun-java6-sdk. It won't install without
the repository being present. So your script is way to late to add it.

4) Don't just add repositories to the users config.


As for working on Ubuntu but not debian you can detect that and only
call the ubuntu tools when being installed on ubuntu.

MfG
        Goswin


Reply to: