Showing posts with label great gnome. Show all posts
Showing posts with label great gnome. Show all posts

Thursday, January 3, 2013

converting Ubuntu to Xubuntu

[UPDATED 2012-05-13] The real fix for the apport-checkresume bug is to purge, clean and reinstall.

I have an old Compaq/HP laptop that I've been running Ubuntu on since Oneiric Ocelot (11.10). Unfortunately a pop up informed me that upgrading to Quantal Quetzal (12.10) wasn't recommended - Unity 2D isn't supported going forward, and the drivers for the ATI graphics in the Compaq/HP laptop don't support 3D acceleration.

Since Xubuntu doesn't use Unity, and I had no problem upgrading a VM on a similarly old Dell laptop also with an ATI graphics card, I decided to convert my machine to Xubuntu. For those unfamiliar with  Xubuntu, it is Canonical Ubuntu with an XFCE desktop, based on X11.

What follows are the steps, blunders, fixes and resources I used/followed to convert my system from Unity to xfce.
  1. Install xubuntu-desktop. I did this from the Ubuntu-Software-Center, but you could easily type sudo apt-get install xubuntu-desktop in a terminal.
  2. Remove ubuntu-desktop and unity. You will get some ugly warnings.
  3. If you restart now, you may get the dreaded "low graphics mode". So while you still can, edit /etc/lightdm/lightdm.conf so that the greeter is lightdm-gtk-greeter. If you do get stuck in "low graphics mode" never fear, just hit CTRL-ALT-F2 to get a terminal and type your username and password. Then you can use sudo nano /etc/lightdm/lightdm.conf to edit the config file and then  use sudo reboot and all should be well.
  4. Remove any remain unity packages. Here are some posts to follow:

Epilogue: So I was able to completely convert my old laptop successfully and upgrade to Quantal, but I did have to run these commands to push through the installation.
sudo dpkg --configure -a
sudo apt-get -f upgrade
You make also experience issues/crashes when your system resumes from suspend. Examining the detail may show the offender as apportcheckresume [1, 2, 3, 4], which is ironic, because this is the bug reporting app, and it is causing the bug, because it can't resume from suspend. I can confirm that purging apport, cleaning your repo database and reinstalling apport fixes this issue.

sudo apt-get purge apport
sudo apt-get autoremove
sudo apt-get clean
sudo apt-get install apport

Good luck and enjoy!

P.S., I was able to compare my converted Xubuntu setup with an iso installed Xubuntu, which gave me a way to check as I went along which packages should be removed.

P.P.S., synaptic and deborphan are good tools to use to clean up orphans and broken dependencies, sudo apt-get autoremove will do something similar. Although synaptic seems to resolve dependencies differently than Ubuntu-Software-Center, it has saved my ass more than once.

P.P.P.S., I suppose as an alternate to lightdm you could install gdm, but it seems like more work, and it is not the default display manager for Xubuntu.

[1] http://askubuntu.com/questions/230670/apportcheckresume-recurring-error-and-gnome-shell-fixations
[2] http://askubuntu.com/questions/203745/suspend-breaks-on-12-10s-kernel
[3] http://askubuntu.com/questions/141671/keep-getting-messages-about-internal-system-errors
[4] http://ubuntuforums.org/showthread.php?t=2073983


Monday, November 26, 2012

Install Add On Software and Create GTK+ Desktop File

Unfortunately not all of the software that you want will be in your linux distro. The most common examples of these are the awesome Sublime Text 2 editor and the bloated but ubiquitous eclipse IDE. Actually eclipse is in most linux distro repositories, but only a limited set of plugins are available, and eclipse uses its own repository system to update and install plugins which is in principle incompatible with your distro's packaging system. For example, if you install eclipse 3.8 from the Ubuntu Quantal Quetzal repo, you can not update it from the eclipse repository, and if you install the PyDev plugin using their repository through the eclipse packaging system, when your upgrade to the next Ubuntu version, your plugins will not work and you will have to reinstall them. If you are okay with this, then you may be alright, but you will have some extra work to do come upgrade time, and you will need to keep track of what is installed via the official repo and what is being maintained by eclipse's repos, because neither can keep track of the other, and they are all for the most part dumped in the /home/<username>/.eclipse/ directory.

Linux actually has a protocol for installing software add-ons, if you decide that what's in your distro's repository is not enough for you. There are a few options.

  1. Find a PPA (Personal Package Archives for Ubuntu), add it and then install the package with apt-get. This will most likely install the package in /usr/, /usr/bin/, /usr/lib/, ... and take care of configuration and creating a desktop file so that you the application will appear in the unity dash (on Ubuntu) and you can add it to the launcher or launch files from Nautilus. This works for Sublime Text 2. PPA's are often listed on Launchpad.
  2. Build the code from source using autotools and it should install in /usr/local/, /usr/local/bin/, /usr/local/lib/, /usr/local/include/, ... but of course you will need to make sure that the application's dependencies are all satisfied and do not conflict with your distro. This can be a tough row to hoe.
  3. Find a pre-compiled package and drop it into your system's /opt directory, which is designated specifically for add-on software not provided by the system's package repositories. An alternative often used and actually my preference is to extract the new package into your home directory.  This works, but to avoid cluttering $HOME I add a folder called ~/opt and drop the add-ons in there. Again, it is up to you to make sure that the software's dependencies are satisfied. For example, eclipse requires some jdk, whether it is from Oracle or the openJDK project, and it will need to be a version within the range specified by the add-on software, e.g. jdk >= 7.0 in the case of eclipse.
Now you need to integrate the add-on software into your system. Again you have some choices and it seems that there is some debate about what is the best course to take.
  1. The easiest thing to do is to run the application from the console, and don't integrate it into your desktop (Gnome) or file system browser (Nautilus), by opening a terminal window and typing ./<executable>. You may need to change the permissions first by using sudo chmod 755 <executable>.
  2. Another option that doesn't require you to edit your desktop files is to add the folder to your path, however, this may cause problems if there are filename conflicts, e.g. your system already has a libz.a but your new software does too. One safe way to deal with this is to add  the new directory to the end of your path, or create a special shell for it. This way your default system files will always be used.
  3. Create a symlink to /home/<username>/bin/ which is always first on your path. This is my preferred method for several reasons. First it will survive an update because your personal profile is not altered during upgrades. Second, it only affects you, and not other users if you share your machine. Of course if your intent is to make the application usable for all users, then either you need to add it to all profiles or make a symlink to /usr/bin/. However, links in /usr/bin/ will probably not survive an upgrade because this is system file territory
  4. Create a gtk desktop file in /home/<username>/.local/share/applications/, as described in Desktop files: putting your application in the desktop menus, which again is my preferred method. I wrote a post on eclipse in Ubuntu that has an example of a desktop file. The reasons are the same as above. First it survives an upgrade and second it only affects you. You can customize the desktop file to have as many actions as you want, for example to have an option to open a new window by right clicking directly from the launcher icon, or to list all of your current eclipse profiles so that you can launch them directly. The desktop file is very flexible. You should now be able to find your application in the Unity dash (on Ubuntu) and once it runs you can lock it to the launcher. Also if you add the %f option after the location of the executable in the desktop file, then it will be available to Nautilus as well. Then you can right click and see other applications that can open a file associated with your new application. See this Ask Ubuntu answer on how to install the Sublime Text 2 editor. A lot of people have recommended editing the system wide desktop files, which are in /usr/share/applications/ but I don't recommend this as it will not survive an upgrade.
In general, I tend to be more conservative when it comes to editing system files and directories, preferring to keep my customization localized to my profile, and only deviating from that when absolutely necessary. But you may have a different use case which will necessitate a different approach.

Monday, November 19, 2012

PyGTK with Christoph Gohlke and GTK all in one bundle for x64 systems

This is very straightforward.

  1. Download and install PyGTK, Py2Cairo and PyGObjects from Christoph Gohlke's website. Note, do not install pycairo, as Gohlke clearly states it is not compatible with PyGTK.
  2. Create a folder called "runtime" in `C:\Python27\Lib\site-packages\gtk-2.0`.
  3. Download and install the GTK all in one bundle for 64-bit systems from Gnome. Make sure that it is the same version as PyGTK that you installed from Christoph Gohlke's site, which was version 2.22 upon writing.
  4. Extract the GTK files to the "runtime" folder created in step 2.
  5. Add the runtime folder to your python path, and/or the path environment variable of any shells that you want to have access to GTK
Note: It is not strictly necessary for the location of the runtime folder in step 2 to be in the Python27 file system, it could be in your` /home/bin`, `/local/bin`or `C:\` directory or where ever you want it, as long as it is on your path.
Fork me on GitHub