Sign In

    Enjoy FOSSwire's content? Have it delivered! Subscribe

    Printable Guide - Installing Software on Ubuntu

    Ubuntu 'Circle of Friends' logoIf you're brand new to Ubuntu, or Linux, many concepts will be alien to you and whilst it is pretty simple to pick it up after a while, you may be left in the dark when things differ from how Windows works.

    One of the key differences between the two is how you install software. With terms like package and repository flying around, it can be a challenge to know where to start to get some new software downloaded and installed.

    For this reason, I've put together a two-sided printable guide which explains, in very simple and easy-to-understand terms, how to install most software in Ubuntu.

    Click the image below to download it as a PDF file.

    Installing Software on Ubuntu Guide Thumbnail

    It is also available in two alternative formats:

    In true open source and open content style, the printable guide is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported licence. This means you have the right to adapt and build upon it, provided that you credit FOSSwire (our logo and link should be fine!) and allow others to do the same to your versions too!

    In fact, we'd love people to help us, particularly with translating this guide into other languages. It would be great if this information was available to every new Ubuntu user, regardless of where they are from and what language they speak!

    If you want to do a translation, I suggest you download the OpenDocument Text version, do the business and then email it to me - peter at fosswire.com - and I will put it up here on FOSSwire.

    Translations

    Finally, it would be great if you spread the word about this new guide - feel free to download and share this among your Linux newbie friends, put it up on your website as well, or just link to us so that the word gets out that help is at hand.


    Installing Gentoo 2008.0 Live CD

    Gentoo logo

    Traditionally, Gentoo Linux has been a distribution designed more towards the more experienced Linux user, perhaps the 'power user', if you will.

    Its source-based package management and offering the user complete control over the system installation and configuration have meant that traditionally, it can be difficult to approach.

    Having myself tried and failed to install Gentoo in the past, I thought I would take the recently released 2008.0 Live CD for a spin, and see what the installation process is like, and how easy it is to use and understand. So here goes.

    You get started like any other Live CD - throw it in the drive, reboot and press Enter to boot in. Before the GUI even arrives, you'll be asked to pick a keyboard layout to use for the live CD, then eventually you will be greeted with this GDM login screen.

    GDM in Gentoo 2008.0

    There's an autologin set here, so you just have to wait a few seconds for the live user to be logged in. Gentoo now uses Xfce as the default GUI environment, so it will load up (fast, as it always seems to be).

    Xfce in Gentoo 2008.0

    As expected, this is a fully usable Gentoo system at this point, albeit running Live, so of limited utility. A fair selection of packages are installed, included Firefox 2.0.0.14, in a 'Bon Echo' branded guise.

    Bon Echo in Gentoo 2008.0

    Still, we're interested in the installation procedure. Conveniently on the desktop is an installer shortcut. Actually there are two - a command-line based installer, and the graphical GTK+ version. I'll be using the latter.

    There's no introduction or anything. As soon as you double-click the installer, you're thrown straight in at a partitioning screen. Provided you have a clean disk and don't mind Gentoo monopolising your hard drive, it's simple to click the Recommend Layout button for a one-click solution to this screen.

    Partitioning in Gentoo Installer

    It does, however, give its power user base the ability to fully control how Gentoo will inhabit their hard drives.

    Partition layout

    Click Next at this point and you are right away doing mount points for those partitions you just set up (and any others you want too). This is usually saved for the tail end of distro installations, but the way that the Gentoo installer works means that it will mount all of these partitions for you in the live distro too for the install, so it is done at this point.

    You don't get an awful lot of confirmation, so pretty much as soon as you hit Next, those partitions will be written to disk and a few files get copied over.

    Initial 'stage' File Copy

    Once that initial set of files gets copied, you then go back into answering questions. Personally, I don't like this sort of do some work, then ask more questions, then do more work thing.

    It reminds me of the Windows XP installation procedure - when you can never just answer questions and set it off doing its own thing, it requires constant supervision. The Gentoo install isn't nearly as bad, but the way it works doesn't feel very 'standard' in comparison to more mainstream Linux distros.

    From this point on, you are asked about configuring network interfaces, your root password and setting up the different users for your newly installed system.

    Adding Users

    The users module could potentially be a little confusing without a fair bit of Linux experience, as you are asked to manually fill in details such as the user's shell, home directory and user ID. You can leave things blank for defaults, however.

    The final step before the proper copying of packages happens is to choose any additional packages you need. If you want a graphical system at the end of the install, you'll need to make sure you check at least the xfce and xorg-x11 packages.

    Finally, the proper copy operation gets started. This will probably take considerable time (it did in my VM installation, at least).

    Main installation copying

    Once the copy is finished, just as abruptly as it begun, you are notified that the installation is complete and you can reboot into the installed system.

    Conclusion

    So, how easy is this to install?

    It certainly doesn't require much specific knowledge of Gentoo or how it works, but neither is it for the faint hearted.

    A significant body of previous Linux experience is expected, as you'll be on your own with respect to key concepts, such as partitioning, packages and users.

    I imagine that in a 'safe' environment - i.e. a machine that didn't particularly matter, someone with only intermediate Linux skills could probably get through relatively easily and progress to using the distro.

    Gentoo is still very oriented towards the more experienced user and the person who likes to endlessly fiddle with and tweak their system so it works exactly how they like it and has the maximum possible performance.

    I don't remember how I fell down on installing in the past, but it certainly seems like an achievable feat for someone with some Linux experience now, and that in itself has lowered the bar to learning and using Gentoo.

    They could try to make it even easier to install, but then I guess there might be complaints from those who do not want their installer to be 'simplified' any more.

    People like control over their machines.


    Installing mod_python and Django on Apache

    I've recently started learning Django for doing web development, so as part of that, I needed to also learn how to set up Django within mod_python so I could deploy my new Django applications on my server.

    In this post, I'll be sharing the method I used to install mod_python and Django on my CentOS 5, Apache-based web server. So without any further ado, let's get started on the process!

    Starting Off

    I'll be running the latest SVN release of Django, which provides the latest features. Despite not officially being stable, I've found it to be fine, and doesn't restrict me to having to develop to the older spec of the 0.9x releases. That siad, you should regularly update your SVN copy to keep updated with the latest security and bug fixes.

    Apparently:

    "We improve Django almost every day and are pretty good about keeping the code stable. Thus, using the latest development code is a safe and easy way to get access to new features as they're added."

    Before we get started downloading Django, however, we first need to grab mod_python (the plumbing between Apache and Django) for the installed Apache. The easiest way to do this is through yum:

    # yum install mod_python

    This should automatically add to your httpd.conf Modules, but if it doesn't, then you should manually do so with the line:

    Module python_module modules/mod_python.so

    Getting and Installing Django

    Now let's go and get the latest version of Django. For the whole of this tutorial, I'll assume you are putting Django in /opt, as I am here. As root:

    # mkdir /opt/django
    # cd /opt/django
    # svn co http://code.djangoproject.com/svn/django/trunk/

    Once the SVN checkout completes, you have Django downloaded. Next, we need to get it installed into Python, by symlinking this new Django directory into Python's site-packages directory.

    # ln -s /opt/django/trunk/django /usr/lib/python2.4/site-packages

    Also, we should at this point add django-admin.py to your PATH, so you can use it to create new Django projects from anywhere on your system.

    # ln -s /opt/django/trunk/django/bin/django-admin.py /usr/local/bin/django-admin.py

    To test that the Django installation worked, run the following. If it works, Python shouldn't give you any error message and go silently back to its prompt. If you get ImportError: No module named django, you have a problem. Check that symlink to /opt/django/trunk/django is in Python's site-packages directory.

    # python
    >>> import django

    Getting a Database Library

    You need a Python module for the database you plan to use with Django installed, so that Django can talk to the database. Most people will be using MySQL, so that's what I'll cover installing here.

    Right now, the version of connector module MySQL-python in the CentOS repositories is too old to use with the SVN release of Django. Instead, get the latest tar.gz release from here.

    Once that's downloaded, do this in the directory where you downloaded it:

    # tar xzvf MySQL-python-1.2.2.tar.gz
    # cd MySQL-python-1.2.2
    # python setup.py build
    # python setup.py install

    Making Application and Template Directories

    Django applications aren't deployed like PHP, for example. Your application's source files and templates are kept outside of your web server's document root (much better for security), and you instead use Django's URL resolvers to build a logical URL structure. This also has the disadvantage of meaning you have to put your media files for a project somewhere separately, but I'll cover that later.

    For now, we need to make both an application directory, where our application code will reside, and a template directory. In CentOS, the document root by default is /var/www/html, meaning we have the whole of /var/www/ to use for other web server stuff that needs to remain outside the web server's normal root. Perfect for this.

    # mkdir /var/www/djangoapps
    # chown apache /var/www/djangoapps
    # mkdir /var/www/djangotemplates
    # chown apache /var/www/djangotemplates

    Make an Egg Cache

    We're almost done in the preparation stage, but we also have to add a Python egg cache that the web server can write to. I found the easiest way to do this was to add a new directory in /var/cache for the purpose.

    # mkdir -p /var/cache/www/pythoneggs
    # chown apache /var/cache/www/pythoneggs

    Serving up Media Files

    Media files have to be done separately. If you're into Vhosts, you could set up a subdomain for serving media, but the simplest way is to just make a /media directory in /var/www/html and place your Django application's media in a subfolder of that (then updating settings.py for each app to reflect the location).

    If you're planning on using the Django admin interface, I recommend symlinking the Django admin media directory in here too, like so:

    # ln -s /opt/django/trunk/django/contrib/admin/media /var/www/html/media/admin

    Now, set ADMIN_MEDIA to this path in the settings.py file for each app you deploy.

    Deploying an Application

    Finally, you need to actually deploy an application. Here, I'll assume you're working with an application named myapp. Initially, you should drop the application source code in /var/www/djangoapps/myapp, the templates in /var/www/djangotemplates/myapp and your media in the media location you set up earlier.

    Make sure at this point you now go back to /var/www/djangoapps/myapp/settings.py and tweak the project's settings, including Debug mode, media URL, admin media URL and anything else relevant to your new deployment. Also, don't forget to check your database settings if you're working with a different database server or instance.

    You also need to go into urls.py and update the URL patterns with a prefix that you want to use for your application (in this case, /myapp), or your links will be broken and URLs won't resolve once installed.

    In httpd.conf, add a Location tag to specify your new application's root:

    <Location /myapp>
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE myapp.settings
    SetEnv PYTHON_EGG_CACHE "/var/cache/www/pythoneggs"
    PythonDebug Off
    PythonPath "['/var/www/djangoapps'] + sys.path"
    </Location>

    Save httpd.conf, and restart Apache:

    # /etc/init.d/httpd restart

    Also remember that any changes to source code will likely require a restart of Apache to read them in.


    1. 1
    2. 2