FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 02-13-2009, 11:18 PM
Paul Yeatman
 
Default test for package dependencies without installing

Hi, I'm wondering if there is a command I can run on a debian package that would test for whether all dependencies of that package are already installed on the system without actually installing the package if so. This mailing list thread http://lists.debian.org/debian-user/2006/09/msg00292.html is on the exact topic and many suggestions are thrown out but none of which I can prove true.

So, let's say I want to install texlive-base_2007.dfsg.1-2_all.deb.

$ dpkg -I texlive-base_2007.dfsg.1-2_all.deb | grep Depend
Depends: texlive-doc-base (>= 2007), texlive-base-bin (>= 2007-13), texlive-common (>= 2007)

I don't have any of these dependency packages installed

$ sudo dpkg -i texlive-base_2007.dfsg.1-2_all.deb
(Reading database ... 138033 files and directories currently installed.)
Preparing to replace texlive-base 2007.dfsg.1-2 (using texlive-base_2007.dfsg.1-2_all.deb) ...
Unpacking replacement texlive-base ...
dpkg: dependency problems prevent configuration of texlive-base:
texlive-base depends on texlive-doc-base (>= 2007); however:
Package texlive-doc-base is not installed.
texlive-base depends on texlive-base-bin (>= 2007-13); however:
Package texlive-base-bin is not installed.
texlive-base depends on texlive-common (>= 2007); however:
Package texlive-common is not installed.
dpkg: error processing texlive-base (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
texlive-base

Is there a script-friendly way to determine this before attempting to install? dpkg man page suggests that "--no-act, --dry-run, --simulate" should do this yet

$ sudo dpkg -i --no-act texlive-base_2007.dfsg.1-2_all.deb (Reading database ... 138033 files and directories currently installed.)
Preparing to replace texlive-base 2007.dfsg.1-2 (using texlive-base_2007.dfsg.1-2_all.deb) ...
$ echo $?
0

tells me nothing about lacking dependencies. The point of this is for the purpose of an install script that includes such a package. If there are dependency issues, I want to point that out right at the beginning of the install. If there are not, I want to proceed but want to perform the package install later in the game.

Thanks!


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-14-2009, 05:23 AM
Jimmy Johnson
 
Default test for package dependencies without installing

Paul Yeatman wrote:
> Hi, I'm wondering if there is a command I can run on a debian package
that would test for whether all dependencies of that package are already
installed on the system without actually installing the package if so.
This mailing list thread
http://lists.debian.org/debian-user/2006/09/msg00292.html is on the
exact topic and many suggestions are thrown out but none of which I can
prove true.

>
> So, let's say I want to install texlive-base_2007.dfsg.1-2_all.deb.
>
> $ dpkg -I texlive-base_2007.dfsg.1-2_all.deb | grep Depend
> Depends: texlive-doc-base (>= 2007), texlive-base-bin (>= 2007-13),
texlive-common (>= 2007)

>
> I don't have any of these dependency packages installed
>
> $ sudo dpkg -i texlive-base_2007.dfsg.1-2_all.deb (Reading database
... 138033 files and directories currently installed.)
> Preparing to replace texlive-base 2007.dfsg.1-2 (using
texlive-base_2007.dfsg.1-2_all.deb) ...

> Unpacking replacement texlive-base ...
> dpkg: dependency problems prevent configuration of texlive-base:
> texlive-base depends on texlive-doc-base (>= 2007); however:
> Package texlive-doc-base is not installed.
> texlive-base depends on texlive-base-bin (>= 2007-13); however:
> Package texlive-base-bin is not installed.
> texlive-base depends on texlive-common (>= 2007); however:
> Package texlive-common is not installed.
> dpkg: error processing texlive-base (--install):
> dependency problems - leaving unconfigured
> Errors were encountered while processing:
> texlive-base
>
> Is there a script-friendly way to determine this before attempting to
install? dpkg man page suggests that "--no-act, --dry-run, --simulate"
should do this yet
> $ sudo dpkg -i --no-act texlive-base_2007.dfsg.1-2_all.deb (Reading
database ... 138033 files and directories currently installed.)
> Preparing to replace texlive-base 2007.dfsg.1-2 (using
texlive-base_2007.dfsg.1-2_all.deb) ...

> $ echo $?
> 0
>
> tells me nothing about lacking dependencies. The point of this is
for the purpose of an install script that includes such a package. If
there are dependency issues, I want to point that out right at the
beginning of the install. If there are not, I want to proceed but want
to perform the package install later in the game.

>
> Thanks!



Sounds like you may want to use # apt-get -u install, here's an example:

# apt-get -u install lilo
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
cron debconf exim libident libopenldap-runtime libopenldap1 libpcre2
logrotate mailx

The following packages will be REMOVED:
debconf-tiny
The following NEW packages will be installed:
cron debconf exim libident libopenldap-runtime libopenldap1 libpcre2
logrotate mailx

The following packages will be upgraded
lilo
1 packages upgraded, 9 newly installed, 1 to remove and 31 not upgraded.
Need to get 225kB/1179kB of archives. After unpacking 2659kB will be used.
Do you want to continue? [Y/n]
--
Jimmy Johnson

Bakersfield, CA. U.S.A.
Registered Linux User #380263
K.I.S.S. (Keep it simple stupid)



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-14-2009, 06:36 AM
Chris Burkhardt
 
Default test for package dependencies without installing

Paul Yeatman wrote:
> Hi, I'm wondering if there is a command I can run on a debian package that would test for whether all dependencies of that package are already installed on the system without actually installing the package if so. This mailing list thread http://lists.debian.org/debian-user/2006/09/msg00292.html is on the exact topic and many suggestions are thrown out but none of which I can prove true.
>
> So, let's say I want to install texlive-base_2007.dfsg.1-2_all.deb.
>
> $ dpkg -I texlive-base_2007.dfsg.1-2_all.deb | grep Depend
> Depends: texlive-doc-base (>= 2007), texlive-base-bin (>= 2007-13), texlive-common (>= 2007)
>
> I don't have any of these dependency packages installed
>
> $ sudo dpkg -i texlive-base_2007.dfsg.1-2_all.deb
> (Reading database ... 138033 files and directories currently installed.)
> Preparing to replace texlive-base 2007.dfsg.1-2 (using texlive-base_2007.dfsg.1-2_all.deb) ...
> Unpacking replacement texlive-base ...
> dpkg: dependency problems prevent configuration of texlive-base:
> texlive-base depends on texlive-doc-base (>= 2007); however:
> Package texlive-doc-base is not installed.
> texlive-base depends on texlive-base-bin (>= 2007-13); however:
> Package texlive-base-bin is not installed.
> texlive-base depends on texlive-common (>= 2007); however:
> Package texlive-common is not installed.
> dpkg: error processing texlive-base (--install):
> dependency problems - leaving unconfigured
> Errors were encountered while processing:
> texlive-base
>
> Is there a script-friendly way to determine this before attempting to install? dpkg man page suggests that "--no-act, --dry-run, --simulate" should do this yet
>
> $ sudo dpkg -i --no-act texlive-base_2007.dfsg.1-2_all.deb (Reading database ... 138033 files and directories currently installed.)
> Preparing to replace texlive-base 2007.dfsg.1-2 (using texlive-base_2007.dfsg.1-2_all.deb) ...
> $ echo $?
> 0
>
> tells me nothing about lacking dependencies.

There is a note in the man page about putting the --no-act flag before the action:

$ sudo dpkg --no-act -i texlive-base_2007.dfsg.1-2_all.deb

Does that make it behave as expected?

- Chris B


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-15-2009, 09:38 PM
"Michael M. Moore"
 
Default test for package dependencies without installing

On Fri, Feb 13, 2009 at 4:18 PM, Paul Yeatman <pyeatman@ucsd.edu> wrote:
> Hi, I'm wondering if there is a command I can run on a debian package that would test for whether all dependencies of that package are already installed on the system without actually installing the package if so. This mailing list thread http://lists.debian.org/debian-user/2006/09/msg00292.html is on the exact topic and many suggestions are thrown out but none of which I can prove true.

You can simply look at the package detail in aptitude's ncurses
interface and see at a glance which dependencies you already have
installed (also, which recommends and suggests).

Michael M.


--
"Rightful liberty is unobstructed action according to our will within
limits drawn around us by the equal rights of others. I do not add
'within the limits of the law' because law is often but the tyrant's
will, and always so when it violates the rights of the individual."
--Thomas Jefferson


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-16-2009, 07:33 PM
Paul Yeatman
 
Default test for package dependencies without installing

->>In response to your message<<-
--received from Jimmy Johnson--
>
> Paul Yeatman wrote:
> > Hi, I'm wondering if there is a command I can run on a debian package
> that would test for whether all dependencies of that package are already
> installed on the system without actually installing the package if so.
> This mailing list thread
> http://lists.debian.org/debian-user/2006/09/msg00292.html is on the
> exact topic and many suggestions are thrown out but none of which I can
> prove true.
> >
<...snip...>
> >
> > Is there a script-friendly way to determine this before attempting to
> install? dpkg man page suggests that "--no-act, --dry-run, --simulate"
> should do this yet
> > $ sudo dpkg -i --no-act texlive-base_2007.dfsg.1-2_all.deb (Reading
> database ... 138033 files and directories currently installed.)
> > Preparing to replace texlive-base 2007.dfsg.1-2 (using
> texlive-base_2007.dfsg.1-2_all.deb) ...
> > $ echo $?
> > 0
> >
> > tells me nothing about lacking dependencies. The point of this is
> for the purpose of an install script that includes such a package. If
> there are dependency issues, I want to point that out right at the
> beginning of the install. If there are not, I want to proceed but want
> to perform the package install later in the game.
> >
> > Thanks!
>
>
>
> Sounds like you may want to use # apt-get -u install, here's an example:
>
> # apt-get -u install lilo
> Reading Package Lists... Done
> Building Dependency Tree... Done
> The following extra packages will be installed:
> cron debconf exim libident libopenldap-runtime libopenldap1 libpcre2
> logrotate mailx
> The following packages will be REMOVED:
> debconf-tiny
> The following NEW packages will be installed:
> cron debconf exim libident libopenldap-runtime libopenldap1 libpcre2
> logrotate mailx
> The following packages will be upgraded
> lilo
> 1 packages upgraded, 9 newly installed, 1 to remove and 31 not upgraded.
> Need to get 225kB/1179kB of archives. After unpacking 2659kB will be used.
> Do you want to continue? [Y/n]

Thanks for the suggestion. It's not as script-friendly as I'd like but
the real problem is that this is using the package manager. I want to
perform the test on an arbitrary debian package file that may or may
not be found on the mirrors.

Thanks!
Paul


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-16-2009, 07:35 PM
Paul Yeatman
 
Default test for package dependencies without installing

->>In response to your message<<-
--received from Chris Burkhardt--
>
> Paul Yeatman wrote:
> > Hi, I'm wondering if there is a command I can run on a debian package that would test for whether all dependencies of that package are already installed on the system without actually installing the package if so. This mailing list thread http://lists.debian.org/debian-user/2006/09/msg00292.html is on the exact topic and many suggestions are thrown out but none of which I can prove true.
> >
<...snip...>
> >
> > Is there a script-friendly way to determine this before attempting to install? dpkg man page suggests that "--no-act, --dry-run, --simulate" should do this yet
> >
> > $ sudo dpkg -i --no-act texlive-base_2007.dfsg.1-2_all.deb (Reading database ... 138033 files and directories currently installed.)
> > Preparing to replace texlive-base 2007.dfsg.1-2 (using texlive-base_2007.dfsg.1-2_all.deb) ...
> > $ echo $?
> > 0
> >
> > tells me nothing about lacking dependencies.
>
> There is a note in the man page about putting the --no-act flag before the action:
>
> $ sudo dpkg --no-act -i texlive-base_2007.dfsg.1-2_all.deb
>
> Does that make it behave as expected?

I wish but sadly no:

$ sudo dpkg --no-act -i texlive-base_2007.dfsg.1-2_all.deb
Selecting previously deselected package texlive-base.
(Reading database ... 150341 files and directories currently installed.)
Unpacking texlive-base (from texlive-base_2007.dfsg.1-2_all.deb) ...
pyeatman@pyeatman:~$

...but I didn't catch that so thanks for pointing out!

Paul


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-16-2009, 07:39 PM
Paul Yeatman
 
Default test for package dependencies without installing

->>In response to your message<<-
--received from Michael M. Moore--
>
> On Fri, Feb 13, 2009 at 4:18 PM, Paul Yeatman <pyeatman@ucsd.edu> wrote:
> > Hi, I'm wondering if there is a command I can run on a debian
> > package that would test for whether all dependencies of that package
> > are already installed on the system without actually installing the
> > package if so. This mailing list thread
> > http://lists.debian.org/debian-user/2006/09/msg00292.html is on the
> > exact topic and many suggestions are thrown out but none of which I can
> > prove true.


>
> You can simply look at the package detail in aptitude's ncurses
> interface and see at a glance which dependencies you already have
> installed (also, which recommends and suggests).
>
> Michael M.

Thanks for the suggestion. If you are speaking of the interface when
aptitude is run with no arguments, it's unfortunately not
script-friendly yet the real problem is that this is using the package
manager. I want to perform the test on an arbitrary debian package
file that may or may not be found on the mirrors.

Thanks!
Paul


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-16-2009, 07:57 PM
Chris Burkhardt
 
Default test for package dependencies without installing

Paul Yeatman wrote:
[...]
>> There is a note in the man page about putting the --no-act flag before the action:
>>
>> $ sudo dpkg --no-act -i texlive-base_2007.dfsg.1-2_all.deb
>>
>> Does that make it behave as expected?
>
> I wish but sadly no:
>
> $ sudo dpkg --no-act -i texlive-base_2007.dfsg.1-2_all.deb
> Selecting previously deselected package texlive-base.
> (Reading database ... 150341 files and directories currently installed.)
> Unpacking texlive-base (from texlive-base_2007.dfsg.1-2_all.deb) ...
> pyeatman@pyeatman:~$
>
> ...but I didn't catch that so thanks for pointing out!

Hmm. Take a look at this bug (especially message #19):
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=128560>

I guess a workaround for your script is to parse the 'Depends:' line from
dpkg -I and test if each of those packages are installed.

- Chris B


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-16-2009, 08:01 PM
Paul Yeatman
 
Default test for package dependencies without installing

Paul Yeatman writes:
> > $ sudo dpkg -i --no-act texlive-base_2007.dfsg.1-2_all.deb (Reading database ... 138033 files and directories currently installed.)
> > Preparing to replace texlive-base 2007.dfsg.1-2 (using texlive-base_2007.dfsg.1-2_all.deb) ...
> > $ echo $?
> > 0
> >
> > tells me nothing about lacking dependencies.

Apparently, this has been observed and noted for a long time (at least
since 2002) as these 3 merged bugs show.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=55364
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=134475
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=168499

Paul


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-16-2009, 08:08 PM
Paul Yeatman
 
Default test for package dependencies without installing

->>In response to your message<<-
--received from Chris Burkhardt--
>
> Paul Yeatman wrote:
> [...]
> >> There is a note in the man page about putting the --no-act flag before the action:
> >>
> >> $ sudo dpkg --no-act -i texlive-base_2007.dfsg.1-2_all.deb
> >>
> >> Does that make it behave as expected?
> >
> > I wish but sadly no:
> >
> > $ sudo dpkg --no-act -i texlive-base_2007.dfsg.1-2_all.deb
> > Selecting previously deselected package texlive-base.
> > (Reading database ... 150341 files and directories currently installed.)
> > Unpacking texlive-base (from texlive-base_2007.dfsg.1-2_all.deb) ...
> > pyeatman@pyeatman:~$
> >
> > ...but I didn't catch that so thanks for pointing out!
>
> Hmm. Take a look at this bug (especially message #19):
> <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=128560>
>
> I guess a workaround for your script is to parse the 'Depends:' line from
> dpkg -I and test if each of those packages are installed.
>
> - Chris B

Yes, I had considered this idea myself but, given that apt-get,
aptitude, dpkg, etc. already perform this action, I wanted to tap into
this and not reinvent the wheel. This doesn't seem possible at the
time, however.

Thanks again for the feedback and for pointing out the bug!
Paul


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 07:30 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org