Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

How to remove installed package using RPM?

Answer:

To remove installed package using rpm, use the following command

e.g. remove Firefox

rpm -e firefox

To remove multiple packages, try

rpm -e firefox gedit

How to install bulk packages using yum with groupinstall?

Answer:

Sometimes, if you forgot to select "Development Tools" during Fedora/CentOS installations, you can add them later by using one command

yum groupinstall "Development Tools"

Which save you a lot of times from installing the needed packages one by one.

To see what options are available for groupinstall, try

yum grouplist

How to extract RPM package without installing it

Answer:

Assume you have foo.rpm, type the following command to extract the rpm's contents

rpm2cpio foo.rpm | cpio -idmv

How to check if a rpm package is already installed?

Answer:

To query if a package is installed, e.g.

rpm -q httpd

To display package information, e.g.

rpm -qi httpd

How to compile APC module for PHP

Answer:

The following steps works in RHEL/CentOS

1. Download the latest APC from PECL

wget http://pecl.php.net/get/APC

2. Extract the APC source package and compile/install it

tar -xvf APC
cd APC-X.X.X (replace with your downloaded version)
phpize
./configure
make && make install

3. Enable APC in PHP configuration

echo "extension=apc.so" > /etc/php.d/apc.ini

4. Restart the httpd and use phpinfo() to verify if APC is running