Open westlifezs opened 8 years ago
The dpkg
tool, in my experience, will not install any dependencies. You'll have to use apt-get
for this.
Jordan,
Thank you very much for your response. Is it possible to install manually created deb package through apt-get install with all dependencies installed?
I manually created this package and therefore it will not be found within any of the external repo, right?
in this post http://askubuntu.com/questions/620056/install-a-package-moved-to-var-cache-apt-archives-manually
it says" If the package isn't in one of your repositories, apt-get will not know to install it even if the .deb file happens to be in /var/cache/apt/archives. " is this statement right? If so is there a way for me to get around this limitation?
We are trying to fully automate the deployment, therefore even one additional command like "sudo apt-get install -f" is not desirable.
Thanks and look forward to hearing from you,
also we are not allowed to modify "/etc/apt/sources.list" during the deployment process. is there still a way to install the target package along with its dependencies in one run?
thank you very much!
We use gdebi
for this, it pulls in dependencies similar to apt-get
. Unfortunately this isn't an issue with a package, it's an issue w/ the tools.
Just pass on the metadata to apt-get…
apt-get install $(dpkg-deb -f foobar*.deb Depends | tr -d ,)
I also rely on gdebi usually. Note that gdebi
will pull an X Server (which you probably do not want on servers), but the gdebi-core
package will come with the CLI tools only. Speaking ubuntu here.
The command line I used to build my package is:
/usr/local/bin/fpm -s dir -t deb -n security-monkey -v 0.41 --iteration 1 -d "python-psycopg2 > 0" -d "postgresql > 0" -d "postgresql-contrib > 0" -d "libpq-dev > 0" -d "supervisor > 0" -d "libffi-dev > 0" --after-install /var/lib/jenkins/jobs/security_monkey_build/workspace/packaging/post_install.sh /var/lib/jenkins/jobs/security_monkey_build/workspace/build
I got a deb package "security-monkey_0.41-1_amd64.deb" after I run the command line above. I moved the package to another box to install it by through "sudo dpkg -i security-monkey_0.41-1_amd64.deb".
However, I hit the following issue saying:
Selecting previously unselected package security-monkey. (Reading database ... 173170 files and directories currently installed.) Preparing to unpack security-monkey_0.41-1_amd64.deb ... Unpacking security-monkey (0.41-1) ... dpkg: dependency problems prevent configuration of security-monkey: security-monkey depends on python-psycopg2 (>> 0); however: Package python-psycopg2 is not installed. security-monkey depends on postgresql (>> 0); however: Package postgresql is not installed. security-monkey depends on postgresql-contrib (>> 0); however: Package postgresql-contrib is not installed. security-monkey depends on libpq-dev (>> 0); however: Package libpq-dev is not installed. security-monkey depends on supervisor (>> 0); however: Package supervisor is not installed. security-monkey depends on libffi-dev (>> 0); however: Package libffi-dev is not installed.
dpkg: error processing package security-monkey (--install): dependency problems - leaving unconfigured Errors were encountered while processing: security-monkey
I can definitely install these dependencies manually by running the follow cmds:
sudo apt-get update sudo apt-get -y install -f
But I am expecting the dependencies can be installed automatically and therefore I do not have to fix this manually every time I deploy this package. Could someone please give me some suggestions regarding this issue?
Any comments will be highly appreciated!