The Debian Experience: Cheat Sheet for CentOS and Fedora users

- by

DebianI’ve just installed a LAMP stack on my Nook Tablet using Debian. However I’ve been using CentOS since 2008 and I’m so used to how things are done there that it was a bit of a culture shock doing relatively simple things “on the other side”. It’s like a country whose language you don’t speak well enough.

Here are a few pointers for how to so these simple things in Debian and Ubuntu, for CentOS and Fedora Users:

Installing Packages

While I’m used to yum and it’s super easy search and install options, its counterpart apt is very different. Searching for packages is done with

apt-cache search package

instead of yum list. Likewise, installing a package is done with

apt-get install package

I believe the cache is not created automatically, so from time to time (or before an update/install operation) we need to run

apt-get update

To update all packages (equivalent to yum update), we have to run

apt-get upgrade

There are other front ends available which I have not explored yet. aptitude is for the command line and appears to have a similar simplified syntax to yum. synaptic is for GNOME like environments.

 

LAMP Stack

Apache is called httpd on CentOS, but it’s called apache2 on Debian. Its system user does not run as apache:apache, but as www-data:www-data.

The web root directory is not in /var/www/html but instead in /var/www. File ownership should be tweaked to the above user in this directory. SELinux is not enabled by default.

The Apache config file is not in /etc/httpd/httpd.conf but in /etc/apache2/apache2.conf. The content however is the same, except for the system user which is defined in envvars in the same directory.

PHP is not just called php, but instead it’s php5 on Debian. This is true for all derivatives, such as

  • php5
  • php5-cli
  • php5-mysql
  • php5-gd

MySQL is still MySQL in Debian Wheezy, and not MariaDB (yet).

 

Starting and stopping services on boot

chkconfig does not work on Debian. Instead we can use a script called update-rc.d. Here’s how to enable something at boot:

update-rc.d apache2 defaults

And to disable something:

update-rc.d -f apache2 remove


If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

1 thought on “The Debian Experience: Cheat Sheet for CentOS and Fedora users”

  1. Becoming root on Ubuntu

    Ubuntu is special in that it does not allow us to login as root, nor is there a root password as far as I know. However, there is a way to become root during a session by using

    sudo su
    

    or

    sudo -i
    

    To become your standard user again, type exit (works the same on OS X by the way).

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.