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

Re: How to add dependencies that exist in another repository



> On Mon, 2010-11-08 at 09:14 -0800, Reza Alemi wrote:
>> 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

The bullet-points:

- sun-java6-sdk is in non-free, so this is a non-issue for you if your
package is in contrib (since no one enables contrib but not non-free).
- Your package can't be in main, because packages in main aren't
allowed to depend on any packages that aren't in main.
- The package manager won't even try to install your package or run
any of your scripts if you depend on anything that isn't *already* in
a repository that's enabled.
- It *is* possible to add repositories when you install your package.
Google does this in the *.deb files it distributes so that the package
manager can find newer versions.  If you have a reason to do this
(which you almost certainly don't), you should add some file to
/etc/apt/sources.list.d/, which you can delete when your package is
purged from the system.  Don't do anything that would make it
difficult to know whether the repository was added by your package,
another package, or the user.


Reply to: