Skip to main content

How to install pkgdb2 (Fedora Package Database) from scratch

This cookbook assumes that Fedora 19 is freshly installed, with some design and development tools that the Fedora setup offers.

Install the Required Packages:

$ yum install vim git python-flask \
python-flask-wtf python-wtforms \
python-kitchen python-sqlalchemy \
 postgresql-server postgresql-plpython \
python-psycopg2 mod_wsgi memcached \
 community-mysql-libs community-mysql-devel \
 community-mysqlcommunity-mysql-server \
  python-dogpile-cache python-openid-teams \
  python-openid-cla python-bugzilla python-memcached \
  python-docutils python-dateutil \
 python-urllib3 MySQL-python \

$ git clone

$ cd python-fedora

$ python ./ install

$ cd ~

Getting the Data from the sqllite database and installing pkgdb2 libraries:

$ git clone

$ cd packagedb2

$ python ./ build

if it works properly then say:

$ python ./ install

you may remove the build if you want.

$ python

$ cd /var/tmp

Converting the data dump to and inserting it into MySQL:

$ service mysqld start

$ check: tail /var/log/messages
see if it started successfully "It should say 'Started MYSQL database Server'"

$ mysqladmin -u root password yourpassword

Download this awsome sqllit to mysql script:

and place it under /var/tmp

go to /var/tmp : $ cd /var/tmp

$ sqlite3 pkgdb2_dev.sqlite .dump > mydump

unfortunately, we will have to modify the dump a little bit before we can start converting:

$ vi mydump

Change this line, and two more lines

$ mysql -u root -p

mysql> create database pkgdb2;
mysql> exit

$ cat mydump | python | mysql -u root -p pkgdb2 --default-character-set=utf8

if it executes without saying anything, that means it was successful.

Configuring pkgdb2:

Now lets get back to configuring our pkgdb2.

$ cd ~/packagedb2/

$ mv ./utility/pkgdb2.cfg.sample ./utility/pkgdb2.cfg

$ vi ./utility/pkgdb2.cfg

comment the postgres line and un-comment the mysql line. Change the admin groups to Fedora Groups you are part of, or whatever groups you want to be included in the package admin groups. Also change the FAS username and Password line to reflect your FAS credentials, it can be set to none if you do not want FAS integration. Refer to the screen-shot:

Single quotes around the values are important.

Once that is done, we will have to modify our wsgi script.
$ vi pkgdb2.wsgi

Un-comment and adjust the values as shown:

 Then we will have to edit the script to reflect our new database:

$ vi /lib/python2.7/site-packages/pkgdb2-0.1.0-py2.7.egg/pkgdb2/

DB_URL = 'mysql://root:mypassword@localhost/pkgdb2'

then copy the pkgdb2.conf file to http configuration directory.

$ cp pkgdb2.conf /etc/httpd/conf.d

$ vi /etc/httpd/conf.d/pkgdb2.conf

make the following changes:

Restart Apache and Mysql.
$ service httpd restart
$ service mysqld restart

Security Issues:

Open the http port:

$ iptables -I INPUT -p tcp --dport 80 -j ACCEPT

You may try to access the server, but it will give you a 403 forbidden most probably because of SELINUX or permissions missing on some of the folders. You may chose to disable SELINUX(not recommended) or make exceptions. You can make exceptions like this:

Try to access the website, get the 403 error and then come back to terminal and type

Do a tail /var/log/messages

look for this command, copy it and run on your terminal:
sealert -l a66201ea-062a-4a4b-8d2f-eaf29d3cd855

it will give you some things that are being blocked by SELINUX, and it will give you the boolean, just take the boolean and make exceptions:

setsebool -P httpd_read_user_content 1

Finishing Touch:

make sure you have execute(x) permission for everybody in the whole path to pkgdb2.cfg and pkgdb2.wsgi

also do: pip uninstall flask

and install/check if flask is installed with yum: yum install python-flask.

Now restart the services again

$ service httpd restart
$ service mysqld restart

Go to your favourite browser and type: localhost/pkgdb2
and you will see the deployement.

Any issues regarding this installation you can either ask me on the comments or directly talk to the package authors on github
they are really helpful people.


  1. The whole section about "Converting the data dump to and inserting it into MySQL:" is not necessary. You need to fill the configuration file first and then run the file, which is pretty much what is said at

    1. Yes, I will edit that section to be on the last, if they want to use mysql they can convert it like this and use it.

    2. There is no need to convert anything, if they want to use mysql, they just set the right sqlalchemy URL in the configuration file and run the with the configuration file and it will create the database directly in the MySQL server.


Post a Comment

Popular posts from this blog

ASUS RT N16 + OpenWRT + nodogsplash = WiFi Hotspot (For beginners)

1.Make sure you are directly connected to the router through a cable ·Take an ethernet cable from your ASUS modem and plug it into your pc/laptop
2.Now access your modem by going into the browser and typing: ·Go to administration tab and click on Firmware upgrade/update NOTE: Please use internet explorer for all of these configurations. There are some issues reported in other browsers. 3.You will have to load a DD-WRT basic image first to load the openWRT image. You cannot directly load openWRT image for some reason I dont know of ·Download the image by clicking on the link:
4.Once the image is downloaded just click on browse on the ASUS firmware upgrade page and browse to the DDWRT image and upload it

How to Install GTK-RecordMyDesktop on RHEL 7 (best screen recording software imo)

If you want to record your screen to make tutorials or something else, GTK-recordmydesktop is capable of doing it. Most of the screen-recording programs that I have come across requires you to record your audio separately, however this software is also capable of recording audio without any extra step. It can also work with JACK audio server.

PART 1 - Install EPL repository for RHEL 7:
Open a terminalInstall epel using the following command: yum -y install epel-release.Refresh repo by typing the following commad: yum repolist.PART 2 - Install GTK-RecordMyDesktop: yum install gtk-recordmydesktop That's it, it should work right away. If it doesn't, it is possible that you might be missing some codecs as I installed them from nux and epel repos earlier.

Create isolated network on Virtual Machine Manager - Centos 6.5

Since most of the Linux administration practice is done in a virtual environment, I thought I should create a video about it, as I am aware that some students at my college struggle with it in their labs. Please let me know if I missed anything or did not explain anything clearly.