« Posts tagged package

Converting a RPM package to Deb package

Deb packages are the Debian / Ubuntu equivalent of a Windows MSI file. They package up the required files for a application and provide a convenient way to distribute and install it.

However some more generic applications that work across many distributions, especially Red Hat Linux, come in a RPM file. RPM files are not natively able to run under a Debian version of Linux like Ubuntu. These means that you need some way of running it under Ubuntu. Enter Alien!

Alien is a piece of free open source software that allows you to convert RPM, SLP, TGZ, and PKG file formats to Deb (and also to one another but if you’re using Ubuntu then you want *.deb).

To install Alien you have (as you do most of the time) two choices. Either use the Synaptic Package Manager (SPM) or the Command Line Interface (CLI). At the time of posting the latest version in the repositories is 8.73.

To install via SPM search for the term alien and it should be the third option. Right click alien and select Mark for installation and then click Apply

To install via CLI, fire up the terminal and use the command sudo apt-get install alien type in your root password when prompted and let Ubuntu sort out the rest.

Once it’s installed fire up the Terminal (if you haven’t already to install Alien) and enter the command sudo alien -d name_of_package.rpm This will convert the RPM file to a Deb file. If you use the -i switch so sudo alient -d -i name_of_package.rpm it will generate and install the Deb package.

There other options that can be activated using other switches, these can be found using
alien --help

How to install Apache, MySQL, and PHP (LAMP) on Ubuntu

This is a HOW TO guide to installing LAMP (Linux Apache MySQL PHP). This consists of Apache web server, MySQL database (as well as a DB tool), and PHP. Together these can be used to run as a local web server on your computer, using Ubuntu distribution of Linux. This is similar to WAMP, which is the Windows version.

The idea of this HOW TO is to explain how to get these working together, with little to no use of the Terminal Command Line, but I will give the command line interface (from now on I will call this CLI) as well as they do make life a little faster. For this we will be using the “Synaptic Package Manager” (from now on I will call this SPM) which can be found on Ubuntu in System -> Administration -> Synaptic Package Manager.

So first up we need to install the Apache Web Server. Type the following into the SPM Quick Search box:

apache2

If you add a space after it will be the first result returned, without and it will be the third. For all SPM options make sure you mark them for The command line alternative is (it assumes that you are running as a sudo user, this is the same for all CLI alternatives written here):

sudo apt-get install apache2

To check if this works, click http://localhost, which points to your new local web server. If the words “It works!” appear then everything is on track!

With Apache installed, we now want to install PHP. For this use either SPM and search for:

php5 and libapache2-mod-php5

Or using the CLI: sudo apt-get install php 5 libapache2-mod-php5

Next we need to restart the Apache server so it loads PHP. To do this without the CLI you need to use “Run Application…”, this can be found by right clicking one of the task-bars and and adding the “Run Application..” to the task bar panel. Once this is done type the following command:

gksudo /etc/init.d/apache2 restart Note: This will prompt for your password

Or using the CLI: sudo /etc/init.d/apache2 restart

Now you need to check that PHP is installed correctly. We need to create a small PHP file in the Web Servers directory that displays the PHP info. To do this we are going to run the following command under “Run Application…”:

gksudo gedit /var/www/testphp.php

Or using the CLI: sudo gedit /var/www/testphp.php

Once GEdit is open add the following line and save the file: phpinfo(); inside opening and closing PHP tags

Now check that this has worked by clicking : http://localhost/testphp.php

This should display all the information about the PHP configuration that’s just been installed. Now we move on to the last part which is to install the MySQL server. Using the SPM find and install:

mysql-server

Or using the CLI: sudo apt-get install mysql-server

This will run the MySQL set-up which will at some point prompt you for a root password. This is for root login to your MySQL server, and you’ll need to enter it twice.

After MySQL has been set-up there are two more packages that you need, the first is MySQL libraries for PHP 5, and the second is for Apache to use MySQL.

php5-mysql and libapache2-mod-auth-mysql

Or using the CLI: sudo apt-get install libapache2-mod-auth-mysql php5-mysql

Once these have been installed you need to tell PHP about the MySQL extension by editing the php configuration file. This can be done using “Run Application..” using:

gksudo gedit /etc/php5/apache2/php.ini

In this file you need to find the line that says ; extension=msql.so, remove the ; from the begining of the line, save and close the file.

That’s it, Apache, PHP & MySQL are all installed and set-up. However there is one more stage that might be of use. That is to install Navicat, which allows easy administration to a MySQL Database. First head to the Navicat Download Page and get the appropriate version. I use the Lite (non-commercial) version.

Once your downloaded the tar ball, extract it to where ever you want Navicat to be installed. To run it create a shortcut to the start_navicat file.