Meet your Life Partner

Search Your World

Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Wednesday, June 9, 2010

How can I install a package directly from Internet? Can I use a proxy?

 RPM can be used to install and update directly from the network. You don't need to download the package and then installs it, RPM can do it for you. It supports both HTTP and FTP protocols. To install/upgrade from a FTP server, the syntax is:
rpm -Uvh ftp://user:pass@ftpserver/directory/package.rpm
You can exclude user/pass credentials and login as anonymous/ftp user if you want. The following command will connect using a Proxy Server and then lists the contents of the package "remote-package.rpm":
rpm -qpl --ftpproxy proxyserver --ftpport port ftp://ftpserver/dir/remote-package.rpm
Where "proxyserver" can be the hostname or IP address of your Proxy Server as well as "port" is the listening port on that server. The same rules apply to HTTP protocol, so the following command uses a Proxy Server to query the required packages for "remote-package.rpm" installation:
rpm -qpR --httpproxy proxyserver --httpport port http://webserver/dir/remote-package.rpm

How can I list what files will be installed by a RPM package?

This is usefull when you have to verify the contents of a package, execute the following on the shell to see the contents of the installed package "cpp":

rpm -ql cpp


The "-l" parameter stands for list. And here's the output:


# rpm -ql cpp
/lib/cpp
/usr/bin/cpp
/usr/lib/gcc-lib
/usr/lib/gcc-lib/i386-redhat-linux
/usr/lib/gcc-lib/i386-redhat-linux/3.3.2
/usr/lib/gcc-lib/i386-redhat-linux/3.3.2/cc1
/usr/share/info/cpp.info.gz
/usr/share/info/cppinternals.info.gz
/usr/share/man/man1/cpp.1.gz

To do the same for a package file(ex: cpp-3.3.2-1.i386.rpm) add the parameter "-p" indicating a RPM package:

rpm -qpl cpp-3.3.2-1.i386.rpm