When installing something from source (say, Ruby 1.9.2), what command can I run to get a complete list of all the dependencies needed to install that application? Is this possible?
Get list of required libraries when installing something from source
compilingdependenciesinstallsource
Related Solutions
It's very bad practice to install from source. All you need is to install IUS Community Repo
excerpt
The IUS Community Project is aimed at providing up to date and regularly maintained RPM packages for the latest upstream versions of PHP, Python, MySQL and other common software specifically for Redhat Enterprise Linux. IUS can be thought of as a better way to upgrade RHEL, when you need to.
You can add the repo as follows to yum
:
# rpm --import http://dl.iuscommunity.org/pub/ius/IUS-COMMUNITY-GPG-KEY
# rpm -ivh http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/epel-release-6-5.noarch.rpm
# rpm -ivh http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/ius-release-1.0-11.ius.el6.noarch.rpm
And then install necessary packages
# yum search --enablerepo=ius-testing php55u
php55u-debuginfo.x86_64 : Debug information for package php55u
php55u.x86_64 : PHP scripting language for creating dynamic web sites
php55u-bcmath.x86_64 : A module for PHP applications for using the bcmath library
php55u-cli.x86_64 : Command-line interface for PHP
php55u-common.x86_64 : Common files for PHP
php55u-dba.x86_64 : A database abstraction layer module for PHP applications
php55u-devel.x86_64 : Files needed for building PHP extensions
php55u-embedded.x86_64 : PHP library for embedding in applications
php55u-enchant.x86_64 : Human Language and Character Encoding Support
php55u-fpm.x86_64 : PHP FastCGI Process Manager
php55u-gd.x86_64 : A module for PHP applications for using the gd graphics library
php55u-gmp.x86_64 : A module for PHP applications for using the GNU MP library
php55u-imap.x86_64 : A module for PHP applications that use IMAP
php55u-interbase.x86_64 : A module for PHP applications that use Interbase/Firebird databases
php55u-intl.x86_64 : Internationalization extension for PHP applications
php55u-ldap.x86_64 : A module for PHP applications that use LDAP
php55u-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
php55u-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
php55u-mssql.x86_64 : MSSQL database module for PHP
php55u-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases
php55u-odbc.x86_64 : A module for PHP applications that use ODBC databases
php55u-opcache.x86_64 : The Zend OPcache
php55u-pdo.x86_64 : A database access abstraction module for PHP applications
php55u-pear.noarch : PHP Extension and Application Repository framework
php55u-pgsql.x86_64 : A PostgreSQL database module for PHP
php55u-process.x86_64 : Modules for PHP script using system process interfaces
php55u-pspell.x86_64 : A module for PHP applications for using pspell interfaces
php55u-recode.x86_64 : A module for PHP applications for using the recode library
php55u-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices
php55u-soap.x86_64 : A module for PHP applications that use the SOAP protocol
php55u-tidy.x86_64 : Standard PHP module provides tidy library support
php55u-xml.x86_64 : A module for PHP applications which use XML
php55u-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol
I think I would suggest not installing these items from source directly but rather harness the power of your package manager to still maintain these packages.
locally installing
You can use a command line tool such as curl
or wget
to still download the packages necessary to install them either using yum
or rpm
directly.
$ sudo yum localinstall some.rpm
-or-
$ sudo rpm -ivh some.rpm
I would suggest looking to the repositories RepoForge as well as EPEL for RPMs. For example the git
packages are here.
A simple command in the terminal will download it:
$ wget http://pkgs.repoforge.org/git/git-1.7.10.4-1.el6.rfx.x86_64.rpm
Rebuilding a source RPM
On the off chance you have to have the latest versions, you can still make use of RPMs but rather than download the .rpm
version of a package, you'll want to get the .src.rpm
version. These can be rebuilt using the following command:
$ rpmbuild --rebuild some.src.rpm
Rebuilding a tar.gz using a donor source RPM
You can also take your .tar.gz
tarballs and reuse the .spec
file that's included in the above .src.rpm
. You do this through the following commands.
$ mkdir -p ~/rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS,tmp}
Then create a ~/.rpmmacros
file.
%packager Your Name
%_topdir /home/YOUR HOME DIR/rpm
%_tmppath /home/YOUR HOME DIR/rpm/tmp
Now we're ready to "install" the donor .src.rpm
.
$ rpm -ivh some.src.rpm
This will deposit a tarball and a .spec
file in your ~/rpm
directories. You can then edit this .spec
file and replace the tarball with the newer one.
Now to rebuild it:
$ rpmbuild -ba ~/rpm/SPECS/some.spec
This will create a .rpm
and a new .src.rpm
file once it's complete.
Additional tips
You can use the tool yum-builddep
to make sure you have all the required RPMs installed before getting started.
$ sudo yum-builddep some.src.rpm
Best Answer
Short answer: not possible. The difficulty of getting the exact dependencies from a source distribution is the reason why package management is so popular on Linux (okay, one of several reasons). In fact, if you just need to get it done and don't care so much how, the most reliable way to get the dependencies will probably be to grab a distro package (gentoo ebuilds are easy to work with) and pull the list of dependencies from that.
Otherwise, if you're lucky, the maintainers will have created a listing of the dependencies in the README file or similar - that'd be the first place to check. Failing that, if it's a C project and you don't mind getting your hands dirty, you can look inside the configure script (or better yet the configure.ac or whatever it's generated from) and figure out the dependencies from that based on what it checks.