Archive for December, 2007

Software installation

What used to be one of the most troublesome aspects is nowadays one of the greatest advantages of almost every Linux distribution: software installation and updating. Xubuntu and Ubuntu are no different.

The problem used to be that, in order to install one application, you needed to install a lot of other software (dependencies) in order to get it to work, which meant a lot of work just to install that single application. On top of that, the installation of that application and its dependencies wasn’t a matter of double-clicking an icon – no, you had to open a terminal window, move to the location of the installation files, type ./configure, find out what software you were missing, then… Let’s just say it was a lot of work 😉

The developers of Debian, the Linux distribution on which Ubuntu is based (on which Xubuntu is based 😉 ), thought of a solution: they’d bundle the application in so-called packages in which they could store a lot of information about that software, such as which other packages it needed. They then created an application called apt (Advanced Packaging Tool) which could automatically download and install the package and all the packages marked as its dependencies! This is often referred to as package management.

Along with solving the problem of dependencies, this solution had a few other advantages. For one, since apt-get would by default download the packages from one location in control of the Debian developers, you could be quite sure that they were free of viruses. The biggest advantage, however, was that apt-get could check for updates to all packages at once, meaning it takes just one action to get the latest version available of every single application you had installed!

There were downsides too, though. For example, the Debian developers are unable to create a package for every piece of software that is available for Linux (According to Wikipedia, though, Debian has over 26 000 packages, so most of the popular applications are there 😉 ). Furthermore, Debian’s package management system wasn’t the only one: Red Hat‘s Red Hat Package Manager is an example of another popular packaging method. Ubuntu uses Debian’s method; however, since Ubuntu’s goals differ from Debian’s, they provide the packages from a different location, which means that you cannot just install the packages made for Debian (though often it is possible). However, as Ubuntu can often copy Debian’s packages with very little modification, they offer about 23 000 packages.

As a result of these different methods in different distributions, an application cannot just offer “a Linux version” – at most they will allow you to download “the source” which you can install in the old and painful way. You can see this on the download page of Wormux where they link to a special page with instructions on installing it on many different Linux distributions.

Though there are many efforts like Autopackage, PackageKit, klik, glick, Smart Package Manager, Zero install and OBLISK, the native tools are still preferable.

As for Debian’s method, a graphical tool called Synaptic was also developed, and if that wasn’t enough, the Ubuntu developers also created the tool Add/Remove… (or gnome-app-install) which made the installation of packages even easier. As per Will’s request I’ll guide you through the basic process of package installation on Xubuntu and Ubuntu, and of course, if you have any questions you can leave a comment.

Software sources

The central place for configuring your package management is in Applications->System->Software Sources. As the name says, this application lets you configure the software sources (repositories): the place where Xubuntu downloads all the packages from. By default only a small portion of all available software is enabled. For full access to all 23 000 packages from the Ubuntu repositories you will want to enable the community maintained open source software, proprietary drivers for devices (not open source) and software restricted by copyright and legal issues (this includes e.g. support for playing MPEG videos which Xubuntu is not allowed to ship by default worldwide).



Then there’s the Third Party Software tab, which allows you to enable non-official repositories such as the Personal Package Archives by members of the Ubuntu community. Such third-party repositories often give you a line like:

deb http://ppa.launchpad.net/jani/ubuntu gutsy main

By clicking Add you can enter such a line and then you have access to all the packages provided in that third-party repository. Note that it is recommended that you stick to the official Ubuntu repositories since these repositories might install newer versions of certain packages which can break other packages, or they might not support newer versions of Ubuntu and Xubuntu which might cause problems when you want to upgrade to a newer version.



These third-party repositories often provide you with their GPG-key, which you can add in the Authentication tab in order to confirm that you trust them. Whenever you update the list of packages from that repository, Xubuntu will check whether this key is still available so as to know it is still the same person that provides the packages.



In the Updates tab you can configure which updates you want and how often you want updates to be checked for. Obviously it is highly recommended that you enable the security updates, and you’ll most likely also want the recommended updates. The proposed updates are updates that haven’t yet been thoroughly checked. Unsupported updates can provide you with newer versions of applications that also provide new features, which were only packaged for newer versions of Xubuntu.



The last tab, Statistics, might not provide direct benefit to you, but it allows you to automatically submit anonymous information about which packages you have installed and how often you use your applications. Statistics are then made available at http://popcon.ubuntu.com/ where they can help the developers and packagers.



Add/Remove…

Ubuntu’s Add/Remove… tool is a great way for you to discover new software to install (Applications->System->Add/Remove...). Applications are sorted in categories and come with an extensive description about what it does. There are also plans to expand this tool’s capabilities to show screenshots, reviews and more, but for now, you’ll have to do with this 😉

In the top corner on the right-hand side, you’ll see a drop-down menu. This menu is a quick way to configure the software sources – again, to have access to the widest available range of software, you’ll want to select “All available applications” here. Clicking Preferences in the bottom left-hand side will take you to the Software Sources configuration window.

You can easily find new applications by searching using the input field at the top. For example, a search for “Firewall” will turn up a list of Firewalls. Installation and uninstallation of applications is easy too: just check or uncheck the checkbox in front of an application’s name, and when you’ve selected all desired changes you click Apply Changes in the bottom right-hand side.



Synaptic

A more advanced tool is Synaptic (Applications->System->Synaptic Package Manager). By clicking the Search button on top you can search for applications: if you already know a package’s name I recommend you to just search on Name as it is notably faster than Description and Name.



Once you have found the package you want to install or uninstall, you can click the checkbox in front of its name. You can then “mark” a package for a certain action, which won’t be performed until you click Apply on top.





If a package has dependencies you do not yet have installed, Synaptic will ask you whether you also want to mark those packages for installation.



Once you click Apply on top, Synaptic will give you an overview of all the package it will install and uninstall. Once you click Apply again it will take care of the installation and notify you when it’s done.



Gdebi

Unfortunately, sometimes a package is just not in the repository. However, an application might still provide you with a package that you might want to install by hand. Or perhaps you want to install an application from the popular site GetDeb.net which, for example, packages a lot of games not available in the Ubuntu repositories. Or perhaps you want to install a package you downloaded from packages.ubuntu.com, which provides all the packages from the Ubuntu repositories, after you transferred them to a computer without internet connection.

For this, Xubuntu comes with the Gdebi Package Installer. Gdebi will be opened when you double-click on a .deb file (the package). It can also download and install dependencies – all it takes is a click on the Install button on top.



Conclusion

Whenever a newer version of a package is available in one of your software sources, you will be notified that an update is available and asked whether you want to install it, or perhaps it will automatically install it in the background, depending on what you set.

As you can see, software installation in Xubuntu and Ubuntu is extremely user-friendly. After having used it for a while, you start to wonder how other people get by checking the websites of every application they want to install or update 😉

Xubuntu + Compiz = Pretty pretty Xubuntu

Note to users of 8.04 or 8.10: flotoonie and Ivotron report that this guide also works for Xubuntu 8.04 “Hardy Heron”, which I can confirm myself, and Ravan reports that it works for Xubuntu 8.10 “Intrepid Ibex”.

Note to users of 9.04: According to shadowsky and Andrew, Compiz also works in 9.04, except that you might not be able to use the more efficient way described below. If I get 9.04 running myself I’ll see if I can update this post with my own information. Until then, the section has been updated to link to instructions provided by sisco311 in the comments.

With the release of Xubuntu 7.10 “Gutsy Gibbon”, Xubuntu looks better than ever. However, it can look better still, with the breathtaking effects provided by Compiz. How would you like all your windows zooming out into little thumbnails to give you an overview a la Mac OS X’s ExposĂ©? Or what about flipping through your windows Cover Flow-style (or Flip 3D-style, for that matter)? And then you haven’t even experienced the joy of your windows casting shadows on your desktop, or wobbling like jelly as you drag them!







And that’s just the tip of the proverbial iceberg as there are many more features for you to discover – after you’ve installed it using this guide :).

Preliminary note: your graphics card should support it. Most cards from Nvidia and ATI are supposed to work, as well as some cards from Intel. Most likely you will need to enable the proprietary, non-open source drivers using the Restricted Drivers Manager in Applications->System->Restricted Drivers Manager.

You can check whether you system can run Compiz using Compiz Check.

Before we start, I should also note that Compiz has not made a stable (i.e. 1.0) release, and undoubtly you will experience bugs yourself. This could include the occasional crash, your window borders disappearing (you can get them back by pressing Alt+F2 and entering “emerald” or, if that doesn’t work, “xfwm4”), windows being black in their entirety, or even being thrown out of your graphical environment completely. Be aware of the risks, and don’t blame me if it breaks 😉 .

A bit of history would be appropriate, so here goes. You can skip this paragraph if you already know what Compiz and Compiz Fusion are and just want to install them.
Developed within Novell (they bring you SUSE Linux) they released Compiz, a window manager with gorgeous effects to demonstrate their new XGL software which allowed better use of hardware and made these effects possible. Compiz became an independent project and kept adding astonishing new effects. As Red Hat (who bring you Red Hat Linux) developed AIGLX as an alternative to XGL, Compiz didn’t even need XGL anymore. A community formed around Compiz that made lots of useful and not-so-useful (but pretty) additions. One particular group of enhancements were not accepted into the main project and, being open source, a spin-off named Beryl that did include the enhancements was started. Beryl became very popular – perhaps even more popular than Compiz itself. However, both projects were dissatisfied with the duplicate work and found that they could settle their previous arguments. In a re-merge, most of Beryl’s plugins were made to work on Compiz under the name of Compiz Fusion. So now we have Compiz (or Compiz-core), the base system, with Compiz Fusion, which provides many additional, perhaps more experimental, plugins.

We will install Compiz as well as Compiz Fusion from the official software sources which will no longer pull along half of Gnome as it did in the previous version of Xubuntu.

A word of thanks goes out to Forlong who wrote a guide titled “How to install Compiz Fusion on Ubuntu Feisty – tutorial for advanced and/or KDE as well as Xfce users” – about the only guide that explains how to install Compiz on Xubuntu (up until now, that is 😉 ). Whereas his tutorial focus[es] mostly on terminal commands I’ll explain it like I usually do – the graphical way, with loads of screenshots. Do use his excellent tutorial if you prefer using terminal commands. Be sure to note, though, that his tutorial is for version 7.04, so you’ll have to replace “feisty” with “gutsy”.

Let’s start, shall we?

Note: If you rather copy and paste a command into a terminal window, use this: sudo apt-get install compiz-core compiz-plugins compiz-fusion-plugins-main compiz-fusion-plugins-extra emerald compizconfig-settings-manager

Fire up Applications->System->Synaptic Package Manager to install the required packages. First of all, we need compiz-core. This is just pure Compiz as opposed to the compiz package which pulls along half of Gnome. Then, of course, we need the plugins that take care of all the bling – don’t worry, you can select which plugins you want to activate 😉 . We need the packages compiz-plugins, compiz-fusion-plugins-main and compiz-fusion-plugins-extra. Furthermore, you might like the application to draw the window borders, Emerald, instead of Xubuntu’s default xfwm4 (if you’re unsure, you’ll probably want it). If so, select the package emerald. Last but not least, we need an application to configure Compiz to be usable, so select compizconfig-settings-manager too.
Having selected them all, you can click Apply to start the installation.



Setting it up

Before you can run your newly installed Compiz, you need to configure it a bit. In order to do so, open Applications->Settings->Advanced Desktop Effects Settings.



Beneath the “Effects” heading, click Window Decoration. In the Command input field, enter the window decorator you prefer (emerald if you installed that, xfwm4 if not).



Well, that’s about it – let’s try running it!

Running Compiz

Only one way to find out whether everything works as expected – run it! In order to do so, press Alt+F2, enter compiz --replace, then click Run. If everything works as it should, you should now see shadows around your windows!





Make it default

Now I’ll just assume that it ran successfully and that you want to have Compiz run by default every time you login. I’ll cover two ways to do that.

The easy-but-inefficient way

Using the first way Compiz will replace your default window manager every time you login. This means that, when you log in, first xfwm4 is ran which will then be replaced by Compiz, so even though xfwm4 is started, it will then be closed again without being used.

Also note that you might want to skip to the next part “Managing window decorations” if you’re going for the easy way.

For this method, you open Applications->Settings->Autostarted applications.



There, you click Add to create an entry with the following values:

Name:
Compiz Fusion
Description:
Desktop Effects
Command:
compiz --replace

Well, actually, only the last entry really matters 😉



Click OK and you’re done! The next time you login, Compiz will be started automatically.

The more-difficult-but-better way

Update: Reportedly this way doesn’t work anymore in Xubuntu 9.04 and above, due to the new version of Xfce being used (namely version 4.6). Though I haven’t verified them myself, sisco311 provides updated instructions in the comments section. Users of Xubuntu 9.10 reportedly need Sahkolihaa’s instructions.

So… You prefer the scary stuff? Well, it’s not that difficult, actually. You just press Alt+F2 and enter

gksudo "mousepad /etc/xdg/xfce4-session/xfce4-session.rc"

Basically, that opens the file xfce4-session.rc with root rights with the text editor mousepad.

In this file, all you have to do is replace:

Client0_Command=xfwm4

…with:

Client0_Command=compiz

(Thank Ubuntuforums user sisco311 for this one)

Do note that this makes Compiz default for all users, as opposed to the previous method which made it default just for you.

Managing window decorations

It might be that you’re not always in the mood for shiny effects on your desktop – perhaps you prefer working in good old xfwm4. Fear not, as Fusion Icon is here to save the day! Fusion Icon is an application that sits in your system tray, waiting for you to right-click it. When you do, a menu will pop up so you can quickly and easily enable Compiz when your friends are watching 😉 .

You can easily install it like you would install any other application. You can then run it from Applications->System and play with it.

If you followed “the easy-but-inefficient way” above, you’ll want to follow those steps now but replace the command with fusion-icon (and perhaps the name with “Compiz Fusion Icon”) to start it by default.

If you followed the more-difficult-but-better way and want to load this by default, you also have to follow the steps described in the-easy-but-inefficient way above (though in this case there’s nothing inefficient about it), but with the command fusion-icon --no-start (and perhaps the name “Compiz Fusion Icon”).

(Thanks to Ravan)

Take it easy

CompizConfig allows you to tweak a lot of the settings, which might be a bit overwhelming. Therefore you might feel the need for some sane defaults. Luckily, CompizConfig, in the Preferences menu, allows you to import and export profiles.



As you can guess, I’ve exported mine, so go and download it and Import it!

You might also want to use different themes for your window borders (“Emerald themes”). Fortunately, Ravan provides some instructions on the installation of Emerald themes.

Troubleshooting

It might just be that it does not work for you – please say so using the comment form below, then I can share the solution with the world:

  • If you experience problems that you cannot solve using any of the methods above, you can revert back to Xfwm4. Of course, how to revert depends on the method you used. If you used the easy-but-inefficient way you can simply uncheck the checkbox before Compiz Fusion in Applications->Settings->Autostarted Applications. If you used the more-difficult-but-better way you have to open that configuration file again (gksudo "mousepad /etc/xdg/xfce4-session/xfce4-session.rc") and replace

    Client0_Command=compiz

    
with:

    Client0_Command=xfwm4

    Note that this will not uninstall Compiz – it will merely disable it.

  • If nothing happens after you have followed all the steps, it might be that you need XGL for it to work (Xubuntu by default includes AIGLX). You can simply install it using Synaptic – look for the package xserver-xgl.
  • Ivotron reports what’s happening when you do not have window borders and how to solve it:

    For those not having window decorations after following all the steps try first by removing the contents of the .cache/sessions/ folder as mentioned by Rob Hodge.

    Then, on Settings->Settings Manager->Sessions and Startup, check that ‘Automatically save session on logout’ is disabled. Also, check that if you have the ‘Prompt on Logout’ option is enabled, when you actually log out, the checkbox that appears below the ShutDown, Restart, etc.. buttons isn’t checked.

    What happens is the following. If you like (as I did) to save your session so that the next time that you log in all the programs you had running appear again, this will also include the autostarted (from the xfce4-session.rc file) compiz. Then, when you log out and log in again, the XFCE session manager will try to run compiz twice (one from the xfce4-session and another from the last session), causing (at least that’s what happens to me) that the emerald window decorator never gets started (or something alike like killed by the –replace flag).

    So, the conclusion. Follow all the steps, stop saving sessions and use the autostarted applications configuration instead.

  • If Compiz doesn’t work and you have an Nvidia graphics card, then you may need to make sure it is configured correctly. You can do so by pressing Alt+F2, typing sudo nvidia-xconfig --add-argb-glx-visuals -d 24 and pressing “Run”. With thanks to Ransom’s comment.
  • If you are left with just one desktop, you have to set the “Horizontal Virtual Size” in General Options->Desktop Size in the Cube settings.
  • Rob Hodge also had a problem:

    i couldn’t get it to work as the default setup.. it kept loading xfcewm instead of compiz or loading no window mqanager at all. so i”d sometimes be left with no decoration as the major noticable effect. this was even after changing the xfce4-session.rc file.

    He solved it by opening a terminal window (Applications->Accessories->Terminal) and typing:
    rm ~/.cache/sessions/*
    WARNING: After pressing Enter, this command will remove your saved session (i.e. the state saved if you checked “Save session” on logging out previously). If you don’t know what I’m talking about then it’s probably no problem.

  • Crewe did not have window decorations. Though the steps he took are quite complicated, and he needed to install Metacity, GNOME’s window manager, he solved his problem. I am not sure whether this will work for you, and it is probably safest to assume it won’t. For those still interested:

    A run down of what I did was first

    installed all the apps I needed:

    sudo apt-get install compiz-core compiz-plugins compiz-fusion-plugins-main compiz-fusion-plugins-extra emerald compizconfig-settings-manager

    I removed nvidia-glx / nvidia-glx-new as they directly conflicted with my nvidia drivers, and put me into “Low Graphics Mode” and caused all sorts of issues with the xserver.

    sudo apt-get remove nvidia-glx –purge
    sudo apt-get remove nvidia-glx-new –purge

    respectively.

    installed metacity:

    sudo apt-get install metacity

    restarted the computer (this is key)

    then made sure I had a fully functioning xorg.conf that I created from mish-mashing the generated
    configs from the following commands:

    sudo nvidia-xconfig
    sudo dpkg-reconfigure -phigh xserver-xorg
    nvidia-settings

    and everything was working graphically, and I was using the restricted drivers, with nothing was crashing.

    Then I added these entries to my xorg.conf

    Section “Extensions”
    Option “Composite” “Enable”
    EndSection

    and

    Option “AddARGBVisuals” “True”

    to the Device section

    I then reinstalled the nvidia drivers

    sudo nvidia-installer -f

    -f forces the install, when the install asks you if you want it to generate and xorg for you SAY NO! (You just spent a lot of time creating a working one)

    then restarted the computer again.

    it’s still a bit finicky as I had to run it twice to get it to work, and afterwards I can’t switch back to xfwm4 but it’s I small price to pay.

    UPDATE: I’ve since uninstalled metacity, and everything seems to be working great

Of course, you can always read the comments for this post to read everybody’s problems/solutions or general tips.

That’s all folks!

Just because Xubuntu is speedy doesn’t mean it should not look pretty. With the release of 7.10, finally Compiz is no longer exclusively Ubuntu’s. Enjoy the looks!


a