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

Re: 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)



Reply to: