Life of a Geek Admin

The Daily adventures of a true geek administrator

Life of a Geek Admin - The Daily adventures of a true geek administrator

Useful RPM and YUM Commands

RPM and YUM commands are used daily by RHEL/CentOS/Fedora Administrators and sometimes having a few more tricks up you sleeve for getting information from the command line are always handy to have.  Listed in this post are 14 useful commands for RPM and YUM.

1. Getting rpm to display architecture

This one is a pretty simple tip, and very useful especially for people using x86_64 systems. Just one line in ~/.rpmmacros will save all sorts of trouble later.

$ echo "%_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch}" >> ~/.rpmmacros

2. Query packages not from Redhat

Want to query all those packages installed from 3rd party repositories, not Redhat?

$ rpm -qa --qf '%{NAME} %{VENDOR}\n' | grep -v -i redhat

3. Reset File Permissions

Have you managed to completely mess up file permissions for a given package? Not a problem, because RPM has you covered.

$ rpm --setperms <packagename>

4. View the Changelog

Because Redhat and the upstream vendor have backported security patches, the version numbers can often be misleading when you look for CVE fixes. Checking the changelog of a package is a good way to see if the fix has been implemented. Once again, rpm comes to the rescue.

$ rpm -q --changelog <packagename>

5. Where’s the Documentation?

To quickly list documentation relating to a package, you can use the following two options:

$ rpm -qd <packagename>

This will show you the documentation contained in that rpm, or if you only have a filename you can do:

$ rpm -qdf /path/to/file

and rpm will show you the documentation in the package that owns the file.

6. Package Origin

Occasionally it’s nice to know where you got certain packages, or how many packages you have on your system from a particular repository or vendor. There are a couple of search options that you can use which are not in the rpm man pages to help you out here. While they’re not 100% perfect, they certainly help out. Most package repositories tag their packages with an identifier in the Release string. For example rpmforge uses rf as their identifier. You can use this to see what you have of theirs installed with

$ rpm -qa release="*rf*"

or if you want to see just how many packages you have installed built by Fred you could use

$ rpm -qa packager="Fred*"

This trick works for most categories visible in rpm -qi <packagename>.

Another approach is to use the keychecker package available in the EPEL repository, which lists rpm packages based on the GPG key they were signed with.

7. Extract just one File

If you need to extract just one file from an rpm without reinstalling the whole package, you can do this with rpm2cpio. For example, to extract just the config file from the logrotate rpm you would use the following statement:

$ rpm2cpio logrotate-1.0-1.i386.rpm |cpio -ivd etc/logrotate.conf

8. Query Package Install Order and Dates

Useful after an upgrade to find old packages that were not upgraded.

$ rpm -qa --last >~/RPMS_by_Install_Date

Review the end of the output file in “less” to find all RPMS older than the install date. Can also grep for specific packages and see when they were installed.

9. Query Available Packages from a Repo

Find all packages available from a specific repository, e.g. RPMfusion. This does not show the already installed packages from this repository.

$ yum --disablerepo "*" --enablerepo "rpmfusion" list available

10. Search yum repositories for a string

Find packages containing a string in package name or description.

$ yum search buildrpmtree | less

11. Using yum with a proxy server

To enable yum operations to use a proxy server you should first add the following parameter to /etc/yum.conf

$  proxy=http://yourproxy:8080/

where yourproxy is the name of the proxy server you want to access and 8080 is the proxy port. If the server requires authentication you can specify the login credentials like:

$ proxy=http://username:password@yourproxy:8080/

The rpm package manager makes use of the proxy environment variable. This can be set system wide in /etc/profile or user specific in ~/.bash_profile::

$ export http_proxy=http://yourproxy:8080/ export ftp_proxy=http://yourproxy:8080/

To use wget through a proxy server add the following lines to /etc/wgetrc

$ http_proxy = http://yourproxy:8080/  ftp_proxy = http://yourproxy:8080/

In both cases, login information can be set like in the example above.

12. Use yum to install a local package, automatically checking/satisfying dependencies

$ yum --nogpgcheck localinstall packagename.arch.rpm

13. Display priority scores for all repositories

You can list all repositories set up on your system by a yum repolist all. However, this does not show priority scores. Here’s a one liner for that. If no number is defined, the default is the lowest priority (99).

$ sed -n -e "/^\[/h; /priority *=/{ G; s/\n/ /; s/ity=/ity = /; p }" /etc/yum.repos.d/*.repo | sort -k3n

14. Show all installed GPG keys

Shows all GPG keys along with the corresponding repo information.

 rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'

 

Hope this has added a few more ticks up your sleeve as it has mine!

How To Install Bluefish 2.2.4 on Fedora 18

Bluefish is a great Web Development IDE for Linux / Windows and Mac OSX. Having the latest and greatest on Fedora 18 is always a plus and sadly in the repositories it is at 2.2.3 and not 2.2.4, but great news we can take care of that in short order.

If you have installed Fedora’s supplied Bluefish you will need to uninstall it.

$ sudo rpm -e bluefish bluefish-shared-data

Now let’s download the lateste and install it. First download 2.2.4 from http://www.bennewitz.com/bluefish/stable/binaries/Fedora18/.

and now the really difficult part, open a terminal and type.

$ sudo rpm -ivh bluefish-2.2.4-3.fc18.x86_64.rpm

and that’s all there is to it. You can start it using the link in the menu or from a prompt.

bluefish1

Using the Raspberry Pi as a NAS

Here we have another great use for the Raspberry Pi as a NAS server for your LAN. In this post we’ll be using a Thermaltake BlacX USB SATA attached to the Pi with a 1 TB drive with ntfs shared to the Windows and MAC systems for access.
Install ntfs support

$ sudo apt-get install ntfs-3g

Create the mount directory and mount it

$ sudo mkdir /media/ext

Mount as ntfs as user id pi

$sudo mount -t auto /dev/sda1 /media/ext

Create a share directory

$ sudo mkdir /media/ext/share

Install Samba support

 $ sudo apt-get install samba samba-common-bin

Edit Samba config and create the share drive

$ sudo nano /etc/samba/smb.conf

Remove the # symbol from the security = user line (by highlighting it with the cursor and pressing delete) to enable username/password verification for the Samba shares.

Next, we’re going to add an entirely new section to the configuration file. Scroll all the way down to the very bottom of the file and enter the following text:

[Backup]
 comment = Backup Folder
 path = /media/ext/share
 valid users = @users
 force group = users
 browsable = yes
 create mask = 0660
 directory mask = 0771
 read only = no

Press CTRL+X to exit, press Y when asked if you want to keep changes and overwrite the existing configuration file. When back at the command prompt enter the following command to restart the Samba daemons:

$ sudo /etc/init.d/samba restart

At this point we need to add in a user that can access the Pi’s samba shares. We’re going to make an account with the username backups and the password backups4ever. You can make your username and password whatever you wish. To do so type the following commands:

$ sudo useradd backups -m -G users
$ sudo passwd backups

You’ll be prompted to type in the password twice to confirm. After confirming the password, it’s time to add “backups” as a legitimate Samba user. Enter the following command:

$ sudo smbpasswd -a backups

Edit fstab and add the entry for the mount.

$ sudo nano /etc/fstab

This will open up the file systems table in nano so we can add a few quick entries. Within the nano editor add the following lines:

/dev/sda1 /media/ext auto noatime 0 0

This will install the auto usb mounting system.

$ sudo apt-get install autofs

However we need to set up a config file to allow the automounting of the usb disk.

 $ sudo vi /etc/auto.master

At the end of the file is the following
+auto.master
You need to add the following below the +auto.master entry

 +auto.master
 /media/ /etc/auto.ext-usb --timeout=10,defaults,user,exec,uid=1000

That’s all you need and can now access the share from any system in your LAN.

How to Install Tiny Tiny RSS on Fedora 18

If you are an avid reader of RSS feeds then you are aware of Google Reader and Google’s decision to remove the service, leaving users scrambling for a replacement. One such solution is a standalone system so you do not have to rely on a service that may go away. With Linux there are many open sourced options available. One such option is Tiny Tiny RSS which runs using the standard LAMP stack on your distribution.

Install some dependencies.

 $ sudo yum install php-theseer-fDOMDocument php-mbstring php-mysql msql-server httpd php perl-DBD-MySQL

UntarTiny Tiny RSS into /var/www/html

$ tar zxfv Tiny-Tiny-RSS-1.7.9.tar.gz
 $ sudo mv Tiny-Tiny-RSS-1.7.9 /var/www/html/tt-rss
 $ cd /var/www/html
 $ sudo chown -R root:root tt-rss/
 $ cd tt-rss/
 $ sudo chmod -R 777 cache/images
 $ sudo chmod -R 777 cache/upload
 $ sudo chmod -R 777 cache/export
 $ sudo chmod -R 777 cache/js
 $ sudo chmod -R 777 feed-icons
 $ sudo chmod -R 777 lock

Login to MySQL and create user and database fo the app to use.

$ mysql -u root -p
 mysql> CREATE DATABASE `ttrss` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
 mysql> CREATE USER 'ttrss'@'localhost' IDENTIFIED BY 'ttRss1';
 mysql> CREATE USER 'ttrss'@'%' IDENTIFIED BY 'ttRss1';
 mysql> GRANT ALL ON `ttrss` . * TO 'ttrss'@'localhost';
 mysql> GRANT ALL ON `ttrss` . * TO 'ttrss'@'%';
 mysql> exit

 

Open browser and go to http://localhost/tt-rss/install

Enter in credentials for MySQL db

After finishing with the installer, open your Tiny Tiny RSS installation at http://localhost/tt-rss/ and login with default credentials (username: admin, password: password)

Now you are ready to customize Tiny Tiny RSS!

How To Use A Raspberry Pi as a Web Server

The Raspberry Pi is a wonderful little device. A powerful compact computer that is quiet and low power consumption makes it nice for many tasks. One such for me is a web server with PHP and MySQL. In this post that’s exactly what we are shooting for, a web server.

First let’s make sure we are up to date.

 $ sudo apt-get update

Install Apache and PHP

 $ sudo apt-get install apache2 php5 libapache2-mod-php5

Now lets install MySQL to complete the LAMP server.

$ sudo apt-get install mysql-server mysql-client php5-mysql

During the installation we will be prompted for the MySQL root password.

raspweb1

The install will prompt for verification of the new password.
raspweb2
Test MySQL on the system. At the command prompt type:

$ mysql -u root -p

and follow with the show databases; command.
raspweb3
Test Apache by opening a web browser and navigating to the Raspberry Pi’s address and you should receive the It Works! Page.
raspweb4
To check the PHP installation create a file called info.php in the /var/www directory with the contents.

cd /var/www
sudo vi info.php

Paste the following code.

<?php

phpinfo();

?>

raspweb10
Open a browser and  navigating to the Raspberry Pi’s address/info.php (ex: http://192.168.1.15/info.php) and you should receive an output like below.
raspweb5
Now we will need to set rights so the pi user can upload and change files so we need to grant rights to pi user change the ownership of /var/www or the user account you want to use. Or you can create a sub-directory under /var/www and grant access to other id’s.

$ sudo chown -R pi /var/www

If any other Apache or PHP configuration edits are needed the files are located at /etc/apache2/apache2.conf and /etc/php5/apache2/php.ini.

PHPMyAdmin Installation
What easier way to administer a MySQL database than PHPMyAdmin.

$ sudo apt-get install phpmyadmin

First you will be prompted for the web server to use, select apache and slect OK.
Configure Apache to work with PhpMyAdmin
raspweb6
Next prompt will ask for configuration of dbconfig-common can be performed. Answer Yes.
raspweb7
Final prompts have to deal with it and password of the MySQL admin account to allow it to create dbconfig-common database and password to connect to MySQL with.
raspweb8

raspweb9
We need to alter the Apache configuration in order to access PhpMyAdmin. To do this, enter the following command to alter the configuration:

$ sudo nano /etc/apache2/apache2.conf

Navigate to the bottom of the file and add the following new line to the file:

Include /etc/phpmyadmin/apache.conf

Save the file and restart Apache2. To restart Apache, enter the following command:

$ sudo /etc/init.d/apache2 restart

VSFTP Installation
Now we can install VSFTPD to allow for FTP uploading of code to the pi.

$ sudo apt-get install vsftpd

The configuration file for vsftp can be found /etc/vsftpd.conf to make changes as needed.

There you have it. I working Web Server running on the Raspberry Pi!

Install Tomcat 7 and Java 1.7 on CentOS 6 RHEL 6

In this post we will cover how to install the Apache Tomcat 7 and jre 1.7 on CentOS 6 and RHEL 6. This process doesn’t use the rpm’s from the Redhat repositories, but uses the latest tar balls from Apache and Oracle. We will also be using service accounts to control Tomcat and its processes.

Download latest Tomcat from http://tomcat.apache.org/download-70.cgi. Version 7.0.40 is the curent version at the time of this post.
Download the latest Java 1.7 jdk from http://www.oracle.com/technetwork/java/javase/downloads/index.html, click on the JDK download buton. You will want jdk-7u21-linux-x64.tar.gz tarball.
Copy the downloaded tarballs to /tmp directory on your server.

Change directory to /opt or the directory of your choice on the server. I am using /opt for this post to contain Java and Tomcat.

$ cd /opt

Make the tomcat directory and change to it.

$ mkdir tomcat
$ cd tomcat

This step is optional to create individual instances by name for tomcat. Doing this allows you to run multiple instances of tomcat on a server. For this example tomcat-inst1 is what we will be using.

$ mkdir tomcat-inst1
$ cd tomcat-inst1

untar Tomcat in the instance you will be running.

$ tar -xvzf /tmp/apache-tomcat-7.0.40.tar.gz

Create a symlink called tomcat-current. This will allow you to untar newer versions of Tomcat and juwst update the symlink.

$ ln -sf apache-tomcat-7.0.40 tomcat-current

Create tomcat service account and set the UID to 520

$ useradd -u 520 -c “Tomcat Service Account” -d /opt/tomcat -m -s /bin/bash tomcat

 

Change ownership of the tomcat directory to the tomcat user.

$ cd /opt
$ chown -R tomcat:tomcat tomcat

Create an init.d script to start the Tomcat instance at reboot. There is not one available when using Apache supplied tarball install. Copy the below code and save as tomcat-inst1 in /etc/init.d directory, modify the instance name variable.

#!/bin/bash
#
# Startup script for the Tomcat 7.0 Servlet/JSP Container
#
# chkconfig: 345 98 02
# description: Tomcat is the servlet container that is used in the
#              official Reference Implementation for the Java Servlet
#              and JavaServer Pages technologies.

# Source function library.
. /etc/rc.d/init.d/functions

INSTANCE=tomcat-inst1
export INSTANCE
CATALINA_HOME=/app/tomcat/${INSTANCE}/tomcat-current

# Source configuration.
[ -f /etc/sysconfig/${INSTANCE} ] && . /etc/sysconfig/${INSTANCE}

RETVAL=0


start() {
    if [ -f /var/run/${INSTANCE}_restart ]
        then
        /bin/rm /var/run/${INSTANCE}_restart
    fi
    echo -n $"Starting $prog: "

    if [ ! -f /var/lock/subsys/${INSTANCE} ]; then
        
            su - tomcat -c "INST_NAME=${INSTANCE} $CATALINA_HOME/bin/startup.sh"
        

        if [ $RETVAL = 0 ]; then
            success $"$prog startup"
            touch /var/lock/subsys/${INSTANCE}
        else
            failure $"$prog startup"
        fi
    fi

    echo
    return $RETVAL
}

stop() {
    /bin/touch /var/run/${INSTANCE}_restart
    echo -n $"Stopping $prog: "

    if [ -f /var/lock/subsys/${INSTANCE} ]; then
        su - tomcat -c "$CATALINA_HOME/bin/shutdown.sh -force"

        if [ $RETVAL = 0 ]; then
            success $"$prog shutdown"
            rm -f /var/lock/subsys/${INSTANCE}
        else
            failure $"$prog shutdown"
        fi
    fi

    echo
    return $RETVAL
}

stopforce() {
    /bin/touch /var/run/${INSTANCE}_restart
    echo -n $"Forcefully Stopping $prog: "

    if [ -f /var/lock/subsys/${INSTANCE} ]; then
        su - tomcat -c "$CATALINA_HOME/bin/shutdown.sh -force"

        if [ $RETVAL = 0 ]; then
            success $"$prog shutdown"
            rm -f /var/lock/subsys/${INSTANCE}
        else
            failure $"$prog shutdown"
        fi
    fi

    echo
    return $RETVAL
}

status() {
    local base=${1##*/}
    if [ -f /var/lock/subsys/${base} ]; then
        echo $"${base} is running..."
        return 0
    else
        echo $"${base} is stopped."
        return 3
    fi
}

getpid() {
        tomcatpid=`ps auwwwx | grep -v grep |grep -i /${INSTANCE}/ | awk '{print $2}'`
        echo "The PID for ${INSTANCE} is ${tomcatpid}."
        echo
}

threaddump() {
        getpid
        kill -3 ${tomcatpid}
        echo "Thread dump has been sent to where stdout is logged."
        echo
}

# See how we were called.
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  stopforce)
        stopforce
        ;;
  status)
        status ${INSTANCE}
        ;;
  restart|reload)
        stopforce
        start
        ;;
  condrestart)
        if [ -f /var/lock/subsys/${INSTANCE} ] ; then
                stop
                start
        fi
        ;;
  getpid)
        getpid
        ;;
  threaddump)
        threaddump
        ;;
  *)
        echo $"Usage: $prog {start|stop|stopforce|restart|condrestart|reload|status|getpid|threaddump}"
        exit 1
esac

exit $RETVAL

Make the following changes
# Source function library.
. /etc/rc.d/init.d/functions

INSTANCE=tomcat-inst1
export INSTANCE
CATALINA_HOME=/app/tomcat/${INSTANCE}/tomcat-current

Set init script to run at startup.

$ chkconfig --levels 345 tomcat-inst1 on

Setup Java jdk 1.7

$ cd /opt
$ mkdir java
$ cd java

Untar the tarball

$ tar -xzvf /tmp/jdk-7u21-linux-x64.tar.gz

Create the symlink

$ ln -sf jdk1.7.0_21 current

Create setenv.sh in /opt/tomcat/tomcat-inst1/tomcat-current/bin/ . In this exaple there is a ENV_LEVEL which you can omit the two lines or use them. This is for maintaining different developement levels set to correct environment (DEV, INT, CERT, PROD) if you want to use them.

#Java Home for this Tomcat Instance
JAVA_HOME=/app/java/current

#Set Java Options (Memory minimum/maximum?
JAVA_OPTS="-server -Xms1024m -Xmx1024m"

#Modify umask so that group has r+w
umask 02
CATALINA_PID=${CATALINA_HOME}/bin/catalina.pid

ENV_LEVEL=DEV
export ENV_LEVEL

$ chmod 755 setenv.sh
$ chown tomcat:tomcat setenv.sh

Modify tomcat-users.xml to set password and roles access.

$ cd /opt/tomcat/tomcat-inst1/tomcat-current/conf

Make a backup of the current file.

$ mv tomcat-users.xml tomcat-users.xml.orig

Create a new file with the following contents and set the passwords to your liking.

$ vi tomcat_users.xml

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="manager-gui"/>
  <role rolename="tomcat"/>
  <role rolename="admin"/>
  <user username="manager" password="tommgr" roles="manager-gui,admin"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
</tomcat-users>

chmod 600 tomcat-users.xml
chown tomcat:tomcat tomcat-users.xml

Now we can start Tomcat up and should be working.

How To setup FreeNX-Server on Fedora 18 x64

Admit it, sometimes you need to have the GUI when accessing your Linux system, most times SSH access is all you need. A good option is NoMachine’s NX server with FreeNX running on your Fedora system.

Here is a way to successfully install.

Become root

$ sudo su -

Now install freenx-server

# yum install freenx-server

This will install any dependent programs it needs.

freenx1

After the installation has completed we need to configure freenx-server
# nxsetup –install –setup-nomachine-key

freenx2

Now we need to make a few changes to node.conf file

# vi /etc/nxserver/node.conf
Un-comment ENABLE_USERMODE_AUTHENTICATION=”0″
Un-comment ENABLE_SSH_AUTHENTICATION=”1″

Un-comment and Change DISPLAY_BASE=1000 to DISPLAY_BASE=1001
Un-comment ENABLE_CLIPBOARD=”both”
Un-comment and change NX_LOG_LEVEL=0 to NX_LOG_LEVEL=4
Un-comment NX_LOGFILE=/var/log/nx/nxserver.log

Depending on your window manager you will have to un-comment
For KDE
COMMAND_START_KDE=startkde
for Gnome
COMMAND_START_GNOME=gnome-session

Un-comment and change COMMAND_MD5SUM=”openssl md5″ to COMMAND_MD5SUM=”md5sum”

Save the changes to the file

start freenx-server when booting up Fedora
# systemctl enable freenx-server.service

start freenx-server
# systemctl start freenx-server.service
# systemctl status freenx-server.service

freenx3

Copy the generated client.id_dsa.key to a location for import on your client, Windows or Linux. For this post I will be using a Windows client.

$ sudo cp /var/lib/nxserver/home/.ssh/client.id_dsa.key ~/

Next part of the process is to download and install the NoMachine NX client. Download the Windows client from http://www.nomachine.com/download-package.php?Prod_Id=3835. Download NX Client for Windows and nxfonts-75dpi-3.5.0-1.exe

You can optionally download

  • nxfonts-100dpi-3.5.0-1.exe
  • nxfonts-misc-3.5.0-1.exe
  • nxfonts-others-3.5.0-1.exe

Double click to install the packages. Once installed you will need to start the client and configure it. Make sure to import the client.id_dsa.key from the server.

freenx6

After a successful login.

freenx7

On the Fedora system you can grep for nx (ps -ef | grep -i nx) and should now see the server running and a connection.

freenx4

How To Change the default MySQL data directory on RHEL 6

You’ve been using MySQL for sometime now and the database has been growing and you are at the point where it is time to move to another location or to newly added storage that is in a different location.

Stopping the MySQL server

# service mysqld stop

Create a new data diretory and move the content from the old one
Creating a new data directory

# mkdir /app/mysql/
# chown mysql:mysql /app/mysql

Moving the original data files

# mv /var/lib/mysql/* /app/mysql/

Correct the MySQL configuration file

Edit the /etc/my.cnf file.

# vi /etc/mysql/my.cnf

Change

datadir=/var/lib/mysql

to

datadir=/app/mysql

and

socket=/var/lib/mysql/mysql.sock

to

socket=/app/mysql/mysql.sock

and save the file.
If you are using SELinux, adjust parameters to accept the change

Should the following command output “Permissive” or “Disabled” then you may skip the details for SELinux.

# getenforce

Run the semanage command to add a context mapping for /app/mysql.

# semanage fcontext -a -t mysqld_db_t "/app/mysql(/.*)?"

Now use the restorecon command to apply this context mapping to the running system.

# restorecon -Rv /app/mysql

Starting the MySQL server

# service mysqld start

Verifying access and connectivity

$ mysql -u root -p
mysql> show databases;

If this is working, you’re up and running. It is possible you could get a message that says

Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’

then add the following to your /etc/my.cnf

[client]
 socket = /app/mysql/mysql.sock

Optionally you can just use

$ mysql -u root -p --protocol tcp

You have successfully moved your MySQL database.

How To Install MySQL Community Edition on RHEL 6 x86_64

Recently had the need to install the latest Community edition of MySQL on a RHEL 6.3 x86_64 server. For most purposes the included version of MySQL works but if you want the latest version you will need to install the Community edition.

First download the latest Community Edition MySQL from here. At the time of this post 5.6.10 is the current version. From the drop down select Oracle & RedHat Linux 6. Download the following four packages.

  • MySQL-server
  • MySQL-client
  • MySQL-shared
  • MySQL-shared-compat

 

mysqlrhel1

Now that we have the downloads we will need to update the current mysql-libs.

$ sudo yum update mysql-libs
$ sudo yum install MySQL-server MySQL-client MySQL-shared MySQL-shared-compat

Now that we have MySQL installed we will need to create the base tables and start the service.

$ sudo /usr/bin/mysql_install_db --user=mysql
$ cd /usr
$ sudo /usr/bin/mysqld_safe &

Next step is to login and set the mysql root password and we are done.

# mysqladmin -u root -p password newpassword

That’s all we need to do.

How To Install LibreOffice 4.0 on Fedora 18

Today is the big day, LibreOffice 4.0 has been released and there many new features. We are going to show how to install LibreOffice 4.0 on Fedora 18. Ever since the fork I have been using LibreOffice and it has never disappointed me, so I had to see what 4.0 has and get it on Fedora 18. So here is how it is done.

First we need to remove the LibreOffice install and remove them. Using the handy rpm command it is easy to find.

$ sudo rpm -qa | grep -i libreoffice
libreoffice-math-3.6.3.2-8.fc18.x86_64
libreoffice-writer-3.6.3.2-8.fc18.x86_64
libreoffice-ure-3.6.3.2-8.fc18.x86_64
libreoffice-opensymbol-fonts-3.6.3.2-8.fc18.noarch
libreoffice-pdfimport-3.6.3.2-8.fc18.x86_64
libreoffice-presenter-screen-3.6.3.2-8.fc18.x86_64
libreoffice-kde-3.6.3.2-8.fc18.x86_64
libreoffice-xsltfilter-3.6.3.2-8.fc18.x86_64
libreoffice-calc-3.6.3.2-8.fc18.x86_64
libreoffice-core-3.6.3.2-8.fc18x6_64
libreoffice-draw-3.6.3.2-8.fc18.x86_64
libreoffice-langpack-en-3.6.3.2-8.fc18.x86_64
libreoffice-graphicfilter-3.6.3.2-8.fc18.x86_64
libreoffice-impress-3.6.3.2-8.fc18.x86_64

As we can see we have a few packages to remove. So in one line we type them (copy paste is must quicker).

$ sudo yum remove libreoffice-writer-3.6.3.2-8.fc18.x86_64 libreoffice-ure-3.6.3.2-8.fc18.x86_64 libreoffice-opensymbol-fonts-3.6.3.2-8.fc18.noarch libreoffice-pdfimport-3.6.3.2-8.fc18.x86_64 libreoffice-presenter-screen-3.6.3.2-8.fc18.x86_64 libreoffice-kde-3.6.3.2-8.fc18.x86_64 libreoffice-xsltfilter-3.6.3.2-8.fc18.x86_64 libreoffice-calc-3.6.3.2-8.fc18.x86_64 libreoffice-core-3.6.3.2-8.fc18.x86_64 libreoffice-draw-3.6.3.2-8.fc18.x86_64 libreoffice-langpack-en-3.6.3.2-8.fc18.x86_64 libreoffice-graphicfilter-3.6.3.2-8.fc18.x86_64 libreoffice-impress-3.6.3.2-8.fc18.x86_64 libreoffice-math.x86_64 1:3.6.3.2-8.fc18

Next download lastest LibreOffice 4.0 from http://www.libreoffice.org/download

Extract the downloaded file.

$ tar -xzvf LibreOffice_4.0.0_Linux_x86-64_rpm.tar.gz

Change to the directory

$ cd LibreOffice_4.0.0_Linux_x86-64_rpm/RPMS

Install the new rpm’s

$ su -c 'yum install *.rpm'

Now we need to install the menu entries on the system, the files are under the desktop-integration folder.

$ cd desktop-integration
$ su -c 'yum install libreoffice4.0-freedesktop-menus-4.0.0-103.noarch.rpm'

Give the system a bit to refresh he menus and the shortcuts will be in the same place as the old ones and you are ready to go!

 

LibreOffice 4.0

LibreOffice 4.0

Switch to our mobile site