Showing posts with label redhat. Show all posts
Showing posts with label redhat. Show all posts

Sunday, July 3, 2016

How To Install PHP on Linux

How To Install PHP on Linux


PHP is one of the popular opensource server side scripting language mostly used in web development. PHP originally stood for "Personal Home Page", but it now stands for the recursive backronym PHP: Hypertext Preprocessor.
Today I'm going to show you how to install PHP on Linux

First things first, You need to install apache web server first.. Because often we use PHP incombination with Apache.. See, How To Install Apache On Different Linux Distros...

After installing the Apache web server successfully... start to install PHP..

Installing PHP On Ubuntu

Following command will install PHP and libapache2-mod-php5, php5-mcrypt modules.. which are useful for web developers..

sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt php5-mysql

Or, On Newer systems (Ubuntu 16.04 and later versions..)

sudo apt install php libapache2-mod-php php-mcrypt php-mysql

PHP has a variety of useful libraries and modules that you can add onto your virtual server. You can see the libraries that are available.

Run, apt-cache search php- (For Ubuntu 16.04) or apt-cache search php5- (For Ubuntu 14.04) to see the list of possible/available modules.

shivaraj@shivaraj-A14RM0E:~$ apt-cache search php5- php5-cgi - server-side, HTML-embedded scripting language (CGI binary) php5-cli - command-line interpreter for the php5 scripting language php5-common - Common files for packages built from the php5 source php5-curl - CURL module for php5 php5-dbg - Debug symbols for PHP5 php5-dev - Files for PHP5 module development php5-gd - GD module for php5 php5-gmp - GMP module for php5 php5-json - JSON module for php5 php5-ldap - LDAP module for php5 php5-mysql - MySQL module for php5 php5-odbc - ODBC module for php5 php5-pgsql - PostgreSQL module for php5 php5-pspell - pspell module for php5 php5-readline - Readline module for php5 php5-recode - recode module for php5 php5-snmp - SNMP module for php5 php5-sqlite - SQLite module for php5 php5-tidy - tidy module for php5 php5-xmlrpc - XML-RPC module for php5 php5-xsl - XSL module for php5 libphp5-embed - HTML-embedded scripting language (Embedded SAPI library) php5-adodb - Extension optimising the ADOdb database abstraction library php5-apcu - APC User Cache for PHP 5 php5-enchant - Enchant module for php5 php5-exactimage - fast image manipulation library (PHP bindings) php5-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary) php5-gdcm - Grassroots DICOM PHP5 bindings php5-gearman - PHP wrapper to libgearman php5-geoip - GeoIP module for php5 php5-gnupg - wrapper around the gpgme library php5-imagick - ImageMagick module for php5 php5-imap - IMAP module for php5 php5-interbase - interbase/firebird module for php5 php5-intl - internationalisation module for php5 php5-lasso - Library for Liberty Alliance and SAML protocols - PHP 5 bindings php5-librdf - PHP5 language bindings for the Redland RDF library php5-mapscript - php5-cgi module for MapServer php5-mcrypt - MCrypt module for php5 php5-memcache - memcache extension module for PHP5 php5-memcached - memcached extension module for PHP5, uses libmemcached php5-midgard2 - Midgard2 Content Repository - PHP5 language bindings and module php5-ming - Ming module for php5 php5-mongo - MongoDB database driver php5-msgpack - PHP extension for interfacing with MessagePack php5-mysqlnd - MySQL module for php5 (Native Driver) php5-mysqlnd-ms - MySQL replication and load balancing module for PHP php5-oauth - OAuth 1.0 consumer and provider extension php5-pinba - Pinba module for PHP 5 php5-ps - ps module for PHP 5 php5-radius - PECL radius module for PHP 5 php5-redis - PHP extension for interfacing with Redis php5-remctl - PECL module for Kerberos-authenticated command execution php5-rrd - PHP bindings to rrd tool system php5-sasl - Cyrus SASL Extension php5-stomp - Streaming Text Oriented Messaging Protocol (STOMP) client module for PHP 5 php5-svn - PHP Bindings for the Subversion Revision control system php5-sybase - Sybase / MS SQL Server module for php5 php5-tokyo-tyrant - PHP interface to Tokyo Cabinet's network interface, Tokyo Tyrant php5-vtkgdcm - Grassroots DICOM VTK PHP bindings php5-xcache - Fast, stable PHP opcode cacher php5-xdebug - Xdebug Module for PHP 5 php5-xhprof - Hierarchical Profiler for PHP5 shivaraj@shivaraj-A14RM0E:~$

If you would like to install one of the available modules.. Run command like one shown below..

sudo apt-get install name_of_the_module

or

sudo apt install name_of_the_module

Installing PHP On CentOS, RHEL and Fedora Linux

For Fedora 22 and later versions..

sudo dnf -y install php php-mysql

For CentOS, RHEL, Fedora 21 and earlier..

sudo yum -y install php php-mysql

To list available modules for PHP, Run the following command..

dnf search php-

Or (For CentOS, RHEL and older Fedora systems..)

yum search php-

If you would like to install one of the available modules.. Run command like one shown below..

sudo dnf name_of_the_module

or

sudo yum name_of_the_module

Installing PHP On Arch Linux

First, make sure that your Arch Linux System is up-to-date by running following command

sudo pacman -Syu

Now Install PHP with following command..

sudo pacman -S php

Installing PHP On SUSE Linux

Run following command to install PHP on SUSE Linux..

sudo zypper install php5 apache2-mod_php5

Installing PHP On Gentoo Linux

Run the following command to ensure that your Gentoo Linux System is up-to-date..

sudo emerge --sync && sudo emerge --update world

Now run the following command to install PHP on Gentoo..

sudo emerge -pv php

That's it..


Friday, June 3, 2016

Top Things To Do After Installing Fedora Linux On Your System (part 2)

Top Things To Do
After Installing Fedora Linux
On Your System
(part 2)


Previous Page (part 1)

21 . Install Gparted - Disk partitioning app

GParted is a GTK+ front-end to GNU Parted and an official GNOME partition-editing application (alongside Disks). GParted is used for creating, deleting, resizing, moving, checking, and copying disk partitions and their file systems. This is useful for creating space for new operating systems, reorganizing disk usage, copying data residing on hard disks, and mirroring one partition with another (disk imaging).

For Fedora 22 and later

sudo dnf install gparted

For Fedora 21 and older releases..

sudo yum install gparted

22 . Install Openshot Video Editor

OpenShot Video Editor is a simple, powerful , free and open-source video editing software available for Linux , windows and OS X. and it supports many media formats.

Installation :

Fortunately , Openshot shipping its binaries in Appimage format. Means No installation Needed. Just go to Official download page , download the package and make it executable and run.

For example if you download openshot version 2.0.7 from http://releases.openshot.org/linux/OpenShot-2.0.7.AppImage ,You can run it by just making it as executable.

make it executable with following command.. sudo chmod a+x downloaded_filename

Here ,for openshot 2.0.7

cd && wget http://releases.openshot.org/linux/OpenShot-2.0.7.AppImage && sudo chmod a+x OpenShot-2.0.7.AppImage

23 . Install Cheese

Cheese uses your webcam to take photos and videos, applies fancy special effects and lets you share the fun with others. To install cheese on your Fedora desktop, enter the following command:

For Fedora 22 and later

sudo dnf install cheese

For Fedora 21 and older releases..

sudo yum install cheese

24 . Install Shutter

Shutter is a feature-rich screenshot program for Linux based operating systems. You can take a screenshot of a specific area, window, your whole screen, or even of a website - apply different effects to it, draw on it to highlight points, and then upload to an image hosting site, all within one window. Shutter is free, open-source, and licensed under GPL v3.

Installation :

For Fedora 22 and later

sudo dnf install shutter

For Fedora 21 and older releases..

sudo yum install shutter

25 . Install Meld and Recoll

Meld is a visual diff and merge tool targeted at developers. Meld helps you compare files, directories, and version controlled projects. It provides two- and three-way comparison of both files and directories, and has support for many popular version control systems.
Meld helps you review code changes and understand patches. It might even help you to figure out what is going on in that merge you keep avoiding.

Meld Installation

For Fedora 22 and later

sudo dnf install meld

For Fedora 21 and older releases..

sudo yum install meld

Recol is an indexing software for Linux.. with the help of Recoll you can able to search files , not only by their names but also with it content..

For Fedora 22 and later

sudo dnf install recoll

For Fedora 21 and older releases..

sudo yum install recoll Here, You can find official documentation about how to use it..

26 . Install Screen Recorder

If you want to record desktop screen casts on linux... then simple screen recorder is a simple and best option for your need.

Installation :

See here.. How To Install SSR on Fedora

27 . Install PostInstallerF & Fedy

PostInstallerF & Fedy utility tools help us to install additional software which wasn't included in Fedora by default. Both having GUI and we can install, remove and manage it very easily. This was designed for newbies whoever not familiar in command line.

Install Fedy utility

su -c "curl http://folkswithhats.org/fedy-installer -o fedy-installer && chmod +x fedy-installer && ./fedy-installer"

Install postinstallerf

sudo wget -P /etc/yum.repos.d/ https://raw.github.com/kuboosoft/postinstallerf/master/postinstallerf.repo && sudo dnf -y install postinstallerf

Don't Forget To Share It With Your Friends..!!
Share Your With Linux and Opensource


Previous Page (part 1)


Friday, May 6, 2016

Top Things To Do After Installing Fedora Linux On Your System

Top Things To Do
After Installing Fedora Linux
On Your System
(PART 1)


Next Page (part 2)


Fedora Linux is one of the popular RPM based Linux operating system sponsored by Red Hat to co-ordinate the development of the project. Fedora distribution has a reputation as being a FOSS distribution that focuses on innovation and close work with upstream Linux communities.

Requirements vary from person to person, depending upon whether the person is experienced user, a novice user, an artist or a programmer, but most of the things listed here are essential after a clean install of Fedora Linux. Without wasting time anymore, let's have a look at must to do things after installing Fedora on your system.

1 . Check for updates and Make Sure Your System Is Upto-date

Make sure your system upto date. How to check and do ? It's very simply, you can do by hitting below command on your terminal.

sudo dnf check-update && sudo dnf upgrade

2 . Enable RPMFusion Repos (VERY IMPORTANT)

First and foremost thing to do after installation of Fedora is to enable the RPM Fusion Repos. This will increase the number of applications and programs in your repository and you can easily install them via Software Center or command line.Fedora ships with official repositories & components which will not ship with any non free softwares. RPMFusion is a software repository, providing add-on packages & essential software for Fedora distribution such as multimedia codes.
See, How to enable RPM fusion repositories...

Please Run sudo dnf check-update (for feedora 22 and later) and sudo yum update (for fedora 21 and older releases..) once after enabling RPM Fusion Repos.

3 . Install Gnome Tweak Tool & dconf editor

By default GNOME settings and options are looking good and you want make your desktop settings to more more, alternatively you can install Gnome Tweak Tool & dconf editor which will give lots of cool options which was not there in GNOME Application. This will make your desktop more beautiful.

For Fedora 22 and later:

sudo dnf install gnome-tweak-tool dconf-editor

For Fedora 21 and older releases:

sudo yum install gnome-tweak-tool dconf-editor

4 . Add GNOME Shell Extensions

Still you can avail lots of GNOME shell desktop extensions to make your system easier by adding more GNOME Shell Extension. How to do that ? Simply go to extensions.gnome.org and click the extension you want to install. You can activate/deactivate the extension by clicking on/off button.


5 . Install Media Codecs

Many of the codecs required to play mp3 files, avi files etc are missing from fedora. They must be installed inorder to play different media formats on Fedora , Due to some reason multimedia codecs are not included in Fedora Official repository archive but you can install by adding RPMFusion repositories, check Step-2.

For Fedora 22 and later:

sudo dnf install gstreamer-plugins-bad gstreamer-plugins-bad-free-extras gstreamer-plugins-bad-nonfree gstreamer-plugins-ugly gstreamer-ffmpeg gstreamer1-libav gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-freeworld gstreamer1-plugins-base-tools gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good gstreamer1-plugins-base gstreamer1

For Fedora 21 and older releases:

sudo yum install gstreamer-plugins-bad gstreamer-plugins-bad-free-extras gstreamer-plugins-bad-nonfree gstreamer-plugins-ugly gstreamer-ffmpeg gstreamer1-libav gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-freeworld gstreamer1-plugins-base-tools gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good gstreamer1-plugins-base gstreamer1

6 . Install VLC media player:

Let me confess, I cannot imagine using my personal computer without VLC media player. It's the best out there. It can download subtitles automatically, you can manually synchronize the subs, you can watch online videos with subtitles with VLC . Use the following command to install VLC:

Note : You should first install/enable RPM Fusions repository (check Step 2) to install vlc with following command.

For Fedora 22 and later:

sudo dnf install vlc

For Fedora 21 and older releases:

sudo yum install vlc

If above command didn't works for you.. then.. use following commands..

For Fedora 22 and later:

sudo rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-rawhide.noarch.rpm && sudo dnf check-update && sudo dnf install vlc

For Fedora 21 and older releases:

sudo rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-rawhide.noarch.rpm && sudo yum update && sudo yum install vlc

7 . Play encrypted DVD in Fedora :

libdvdcss is a simple library designed for accessing DVDs like a block device without having to bother about the decryption. Enable encrypted DVD playback in Fedora using the following commands:

However , first you should enable Livna repos on your system.. to install libdvdcss.

For Fedora 22 and later:

sudo rpm -ivh http://rpm.livna.org/livna-release.rpm && sudo dnf check-update && sudo dnf install libdvdcss

For Fedora 21 and older releases:

sudo rpm -ivh http://rpm.livna.org/livna-release.rpm && sudo yum update && sudo yum install libdvdcss

8 . Install rar , unrar and 7zip:

To avoid error like "There is no command installed for RAR archive files" or "There is an error occurred while opening RAR archive files" install RAR and 7zip using the following command:

For Fedora 22 and later...

sudo dnf install rar unrar p7zip

For Fedora 21 and older releases..

sudo yum install rar unrar p7zip

9 . Install other Desktop Environments

The default installation of Fedora offers Gnome DE as default desktop. If you want to try other desktops on top of fedora ,you don't need to download install entire/different OS. You can install them on existing system from official repositories just like any other application software. Fortunately, many famous desktop environments such as Mate, KDE, XFCE, LXDE, etc.. are available for download from the official repositories, to install any of these desktops just run the following command.

Install KDE Desktop

sudo dnf install @kde-desktop

Install Cinnamon Desktop

sudo dnf install @cinnamon-desktop

Install MATE desktop

sudo dnf install @mate-desktop

Install XFCE desktop

sudo dnf install @xfce-desktop

Install LXDE desktop

sudo dnf install @lxde-desktop

10 . Improve battery life and reduce overheating:

Overheating of laptops is a common issue, not only in Fedora but in any operating systems. Overheating also affects the battery life. you can use TLP to improve battery life. Install and start TLP using the following command:

For Fedora 22 and later:

sudo dnf install tlp tlp-rdw && sudo tlp start

For Fedora 21 and older releases:

sudo yum install tlp tlp-rdw && sudo tlp start

For More details see , official tlp docs

11 . Install Steam

Steam is a digital store for Windows, Mac and Linux games. It has many great games, some of them are free and some aren't. If you're a gaming fan, you'll love trying Steam.
To install it, first enable RPM Fusion repository from Step-2 and run.

For Fedora 22 and later

sudo dnf install steam

For Fedora 21 and older releases..

sudo yum install steam

12 . Install Google Chrome

Google Chrome is not only one of the more popular, fastest, and most reliable browsers available, but it also includes a pre-packed and fully patched version of Adobe Flash and a huge array of extensions and apps.

Google drops its support for 32 bit Google Crome builds on All Linux systems from JAN 2016

For Fedora 22 and later (64 bit)

sudo dnf --nogpgcheck install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

OR

sudo rpm -Uhv https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

13 . Install Sublime Text & Atom Text Editor:

Sublime Text is a cross-platform text editor with a Python application programming interface (API). It natively supports many programming languages and markup languages, and its functionality can be extended by users with plugins, typically community-built and maintained under free-software licenses

Installation :

See How to install version of sublime text 3 in Linux Systems

And Atom Text Editor is a another nice and feature rich cross platform open source text editor, developed by GitHub. Atom is a desktop application built using web technologies. Atom is based on Electron (formerly known as Atom Shell), a framework that enables cross-platform desktop applications using Chromium and Node.js. It can also be used as an IDE.

Installation :

See , How to install Atom text editor on Fedora.

14 . Install Image Applications

If you are a photography enthusiast and you want to handle and manipulate images on Ubuntu, probably you want to install the following imaging programs:

  1. GIMP (alternative for Adobe Photoshop)
  2. Darktable
  3. Rawtherapee
  4. Pinta
  5. Shotwell
  6. Inkscape (alternative for Adobe Illustrator)
  7. Digikam

This applications can be installed all at once by using the following command line on Terminal:

For Fedora 22 and later

sudo dnf -y install gimp gimp-plugin-registry gimp-data-extras darktable rawtherapee pinta shotwell inkscape digikam

For Fedora 21 and older releases..

sudo yum -y install gimp gimp-plugin-registry gimp-data-extras darktable rawtherapee pinta shotwell inkscape digikam

15 . Install Wine

Wine enables Linux, Mac, FreeBSD, and Solaris users to run Windows applications without a copy of Microsoft Windows. Wine is free software under constant development. Other platforms may benefit as well.

First add the repository :

Fedora 22:

sudo dnf config-manager --add-repo https://dl.winehq.org/wine-builds/fedora/22/winehq.repo

Fedora 23:

sudo dnf config-manager --add-repo https://dl.winehq.org/wine-builds/fedora/23/winehq.repo

Install package

sudo dnf install winehq-devel

OR

sudo dnf install winehq-staging

16 . Install Samba File sharing

In order to share folders in Ubuntu with other Linux and windows machines in your network, you will need to install and configure Samba share, for instructions see how to configure Samba in Fedora and similar Linux systems..

For Fedora 22 and later

sudo dnf install samba samba-client samba-common

For Fedora 21 and older releases..

sudo yum -y install samba samba-client samba-common

17 . Install OpenTeacher

OpenTeacher is an opensource application that helps you learn a foreign language vocabulary. Just enter some answers and questions in your native and foreign language or download them from internet, and OpenTeacher will test and let you know your vocabulary test result.

Download OpenTeacher from here..

Installation

  1. Download the .rpm file from the Download section of this website.
  2. When the download has completed, doubleclick the .rpm file you just downloaded. This will open the GUI with installation prompts.
  3. Click "install" to start the installation.

or , simply you can install it with following command..

sudo rpm -Uhv < Download_URL_For_RPM_File>

18 . Install qbittorrent :

qbittorrent is a simple and effecient.. torrent client available for Linux.

Installation :

For Fedora 22 and later

sudo dnf install qbittorrent

For Fedora 21 and older releases..

sudo yum install qbittorrent

19 . Install Clementine - Music player:

Clementine is a cross-platform free and open source music player and library organizer. It is available for Unix-like, Windows and Mac OS X. Clementine is released under the terms of the GNU General Public License.

Installation

For Fedora 22 and later

sudo dnf install clementine

For Fedora 21 and older releases..

sudo yum install clementine

20 . Install Brasero(Disk Burning Program) :

Brasero - A simple disk burning app for Linux. You can simply install it with following command..

For Fedora 22 and later

sudo dnf install brasero

For Fedora 21 and older releases..

sudo yum install brasero
Next Page (part 2)

Don't Forget To Share It With Your Friends..!!
Share Your With Linux and Opensource

Share... Facebook Twitter Google Plus LinkedIn Reddit


How To Install/Enable RPM Fusion Repositories On Fedora , RHEL And CentOS

How To Install/Enable RPM Fusion Repositories On Fedora , RHEL And CentOS

RPM Fusion is a software repository that offers various free or non-free add-on packages that do not ship with the original Fedora distribution. RPM Fusion contains various useful packages that are not included in the Fedora distribution just because they do not meet Fedora's free software requirements. In this post, I will explain how to set up RPM Fusion repository on Fedora or CentOS. Once RPM Fusion is enabled on your system, you can install any package available from the repository simply by using yum command. First of all, to check whether or not RPM Fusion is installed on your system, run the following command.

yum repolist | grep rpmfusion

If the above command does not produce any result, it means that RPM Fusion is not installed on your system. RPM Fusion maintains two separate repositories for free and non-free packages. You can selectively enable either or both repositories as you want.

Set up RPM Fusion on Fedora

For Fedora 14 to Fedora 21 :

To enable the free repository of RPM Fusion:

sudo yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm

To enable the non-free repository of RPM Fusion:

sudo yum localinstall --nogpgcheck http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

For Fedora 22 and later:

To enable the free repository of RPM Fusion:

sudo dnf install http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm

To enable the non-free repository of RPM Fusion:

sudo dnf install http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm'

Set up RPM Fusion on CentOS/RHEL

In order to install RPM fusion on CentOS, you first need to enable EPEL repository first. After that, proceed as follows to set up RPM Fusion on CentOS/RHEL.

To enable the free/non-free repositories of RPM Fusion on RHEL 6 or CentOS 6:

sudo yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/el/updates/6/i386/rpmfusion-free-release-6-1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/6/i386/rpmfusion-nonfree-release-6-1.noarch.rpm

To enable the free/non-free repositories of RPM Fusion on RHEL 5 or CentOS 5:

sudo rpm -Uvh http://download1.rpmfusion.org/free/el/updates/5/i386/rpmfusion-free-release-5-1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/5/i386/rpmfusion-nonfree-release-5-1.noarch.rpm

Please Run sudo dnf check-update (for feedora 22 and later) and sudo yum update (for fedora older releases..and RHEL/CentOS) once after enabling RPM Fusion Repos.


How To Enable EPEL Repository on RHEL/CentOS

How To Enable EPEL Repository on RHEL/CentOS



If you are using CentOS or RHEL, it is strongly recommended that you enable EPEL (Extra Packages for Enterprise Linux) repository on your system. EPEL (Extra Packages for Enterprise Linux) is a volunteer-based community effort from the Fedora project to create a repository of high-quality add-on packages that complement the Fedora-based Red Hat Enterprise Linux (RHEL) and its compatible spinoffs, such as CentOS and Scientific Linux. Once you set up EPEL repository, you can use yum / dnf command to install software packages from EPEL repos.

EPEL provide lots of packages for CentOS / RHEL, It is not part of RedHat or CentOS but is designed to work with these major distributions. Please note that EPEL only provides free and open source software unencumbered by patents or any legal issues. In short you will not find mp3, dvd and music / media player under EPEL. However, you will find many programs related to networking, monitoring, sys admin, programming and so on.

You can get Non-free softwares by install/enable RPM Fusion repository on your Fedora/CentOS/RHEL or other derivative systems.

Now see How to enable it on various versions of RHEL/CentOS :

For RHEL7/CentOS 7

RHEL7/CentOS 7 users can install EPEL repos by running following command..

sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

OR
Simply , by running..

sudo yum install epel-release.noarch

For RHEL6/CentOS 6

sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

For RHEL5/CentOS 5

sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm

Basic Package Management With RPM command

Basic Package Management With RPM command



The RPM Package Manager (RPM) is a powerful command line driven package management system capable of installing, uninstalling, verifying, querying, and updating software packages for RPM based Linux Distros. This is adopted by many Linux Distros such as Red Hat Enterprise Linux, Fedora , SUSE Linux, openSUSE, CentOS, Meego, Mageia and many others.
It is also used on many other operating systems as well, and the RPM format is part of the Linux Standard Base .

Working with the rpm command

The rpm command performs the most common package-management functions, along with a host of uncommon functions as well. The table below lists the main operations you can perform with the rpm command and the command-line options to specify the given operations.

rpm command operations :

OperationShort OptionLong Option
Upgrade/install-U--upgrade
Install-i--install
Remove-e--erase
Query-q--query
Verify-V--verify
Check signature-K--checksig
Freshen (upgrade) already-installed package-F--freshen
Initialize databaseNone--initdb
Rebuild databaseNone--rebuilddb

Using this table as a guide, you can explore the options to the rpm command. To install or upgrade a package, use the -U command-line option:

rpm -U filename.rpm

Or , You can also use rpm -i filename.rpm for installation but you can use rpm -U filename.rpm for both installation and Upgrading purpose.

Please note that you need to log in as root, or use the su command to change to the root user to install the software using rpm command:

For example, to install the mlocate RPM used as an example in this chapter, run the following command:

rpm -U mlocate-0.22.2-2.i686.rpm

To get extra feedback, you can use a command like the following, with the -h and -v options in conjunction with the -U option:

rpm -Uhv mlocate-0.22.2-2.i686.rpm

When you run this command you will see more output than the default, which is no output unless there are errors. With the -h option, the rpm command will print a series of hash marks, #, to provide feedback that the command is still running. With the -v option, the rpm command provides more verbose messages.

To remove a package (called erase in RPM terminology), use the -e command-line option:

rpm -e package_name
Notice that you install a package file using the file name that ends in .rpm, but uninstall or erase a package without the .rpm extension. This is because you install RPM files, but once installed, you work with the installed packages. The file name and the package name do not have to correspond, but typically (and sanely) they have the same base name.

To list every RPM package installed on your system, use a command like the following.

rpm -qa

Expect to wait while this command completes. Most Linux systems have numerous packages installed, which will result in many lines of output. To better see the output, you can pipe this command to the more command, as shown following:

rpm -qa | more

You will then see the package listing one screen at a time.