Fight for the Internet 1!

Tuesday, November 23, 2010

Ubuntu Graphics Session Fix after botched Kernel Upgrade

Overview
This post is about restoring graphics to your Linux Desktop session if you install some kernel updates that don't go so well. Particularly, ones that fail with your graphics drivers.

Quick Steps
If you get error message (when trying to upgrade kernel packages or kernel drivers): "Skipping (driver build) at this time because kernel-source is missing." Try the following steps:

Note: `uname -r` is a commandline option which will auto-substitute your kernel version and architecture into the install command. If installing via a GUI, just use the info output from running the console command `uname -r`.
sudo apt-get install linux-source-`uname -r` linux-headers-`uname -r`
If this does not automatically cause your nvidia drivers to compile, cause a manual install with:
sudo apt-get install nvidia-current
If that still doesn't work, try uninstalling and reinstalling nvidia-current.


Background
Today I noticed there were some kernel updates in Ubuntu, but they had been kept back. So I decided to manually install them, since they did not appear to be causing any package conflicts. I do updates from command line with 'apt-get' (because I'm awesome that way *wink*). While installing the held-back packages, being kernel updates, it tried to accommodate my Nvidia graphics drivers.

Apparently, this failed. I noticed the error on the console, and immediately downgraded my kernel back to the previous versions. But alas, it did no good. I rebooted and was confronted with a text-only machine. Now, I'm fine with this, since I spend a lot of time on console. (Screen, vim, ssh, and elinks are usually all I need for most rescue operations. Sometimes rtorrent, wget, and curl are handy too.)

After trying to get the packages to jive well together, I gave up trying to juggle the kernel packages and instead focused on the Nvidia drivers. I tried installing the nvidia-current package provided by the Ubuntu repositories. (I was running a later version from a PPA.). This failed, but triggered the same error.

"Skipping (driver build) at this time because kernel-source is missing." Now, I've seen this error before. So I quickly installed the linux-source-`uname -r` package. This did not quite do the trick, and I have been around long enough to know that the source-packages often require the header packages as well. So I install linux-headers-`uname -r` package.

Once installed that, I didn't even have to do anything. The system automatically compiled the missing nvidia drivers and installed them for me. A quick reboot later, and now I am blogging about this simple solution.

Thursday, November 18, 2010

How to replace Pidgin certificates (the GUI method)

This morning I tried Pidgin and got an error message saying:

"Unable to validate certificate. The certificate for omega.contacts.msn.com could not be validated."

For the record, the problem isn't on Pidgin's end – it's a misconfiguration of the MSN servers. Here is a short term fix until the problem on Microsoft's end is fixed.

How to replace your certificate (the GUI method)

Go to pidgin's Tools->Certificates. Remove the old certificate. Don't close this window yet. (You can, but it is easier to not).

With your browser, go to https://omega.contacts.msn.com. It will give you "Directory Listing Denied"error.

With Firefox, click on the lock symbol in the lower right corner. This will display dialog box about the page info. Click the button "View Certificate." On the window that pops up, go to the Details tab. Click on the "Export" button to export the certificate to a file.Call it whatever you like.

Now, go back to the pidgin Tools->Certificates dialog. Click the "Add" button to add the newly exported certificate. I had to specify the hostname as explicitly: omega.contacts.msn.com

This was the only way I could get it to work.

Saturday, November 6, 2010

Harddrive Space Disappearance and Freespace

Overview
This is just a quick list of places to look to free up space on your harddrive when using KDE. (In this article, I am dealing with version 4, but some of it does work for version 3 too.) This can be helpful if you ever suffer an anomaly of used space you just can't seem to locate and free up under the great KDE desktop.

Background Information
Sometimes rarely in Linux (running KDE) I receive the message that I'm running low on diskspace on my root (/) partition. (I only give it about 15 GBs total.) After emptying my Trash, most of the space on root (/) was still in use. So I began to dig around to find out the cause of this.

Akonadi
Size: 140.9 MB (on my system)
Location: ~/.kde/share/apps/akonadi
Though I own a Droid X smartphone, I do not use any of KDE's utilities to synchronize my devices. So I was quite surprised to see it taking up that much space. Please note, this is not the location of the installed program, just some data it had accrued about me personally and stored in my home directory.

Nepomuk
Size: 378.2 MB (on my system)
Location: ~/.kde/share/apps/nepomuk
Since no services in KDE actually use Nepomuk (and no programs I know of connect to it), currently is a 100% completely useless service. Don't let it run on your system, since it will only take up space and resources that you cannot use.

Thumbnails
Size: 4.6 GB (on my system)
Location: ~/.thumbnails
Now this one makes sense. I collect literally tens-of-thousands of images and regularly browse them, so I'm not surprised this is so large. Still, it would be nice to specify a limit to the size of this folder.

Clearing out this folder took a bit of skill. I had over 100,000 files in this directory total, and even doing `rm .thumbnails/normal/*` threw a rarely seen error: "Argument list too long"

The simple solution is just to delete the sub folder 'normal' and 'large' inside of '.thumbnails'. I could tell you some nifty console commands to hack around this, but this works just fine.


Apt cache (a.k.a. the System Package Cache)
Size: 1.3 GB (on my system)
Location: /var/cache/apt/archives/
If you are not a seasoned and knowledgeable Linux user, chances are you don't know about this one. Whenever you install any new updates or packages through any number of GUI / Graphical front-ends (such as Synaptic or Software Management) or through command-line program like dpkg or apt, all downloaded files (called packages) have to be placed somewhere while downloading. This location varies a little between Linux distributions, like Ubuntu versus Red Hat. Under Ubuntu and Debian (and any Debian forks) are placed in /var/cache/apt/archives. This can become very full with lots of temporary download files. There are a couple of ways to clear this folder out. My favorite is simply from command line:
sudo apt-get clean
Yum/DNF cache (a.k.a. the System Package Cache)
Size: 1.3 GB (on my system)
Location: /var/cache/yum/
If you are not a seasoned and knowledgeable Linux user, chances are you don't know about this one. Whenever you install any new updates or packages through any number of GUI / Graphical front-ends (such as Synaptic or Software Management) or through command-line program like dpkg or apt, all downloaded files (called packages) have to be placed somewhere while downloading. This location varies a little between Linux distributions, like Ubuntu versus Red Hat. Under Ubuntu and Debian (and any Debian forks) are placed in /var/cache/yum. This can become very full with lots of temporary download files

You should manually clear any folders of files you don't need.

Wine
Size: 5.0 GB (on my system)
Location: ~/.wine
The Wine folder. I was pretty surprised by this one also. All my Windows applications are installed in non-home-directory locations and I haven't done much with Wine lately, so this folder should have been relatively small. After doing some quick checking, I found the folder (.wine/drive_c/users/MY_USER_NAME/Local Settings/Temporary Internet Files) to be the culprit. I suspect this came from updating a videogame of mine recently, since it had a multiple Gigabytes to download and install.

Trash Files (Lost/Forgotten)
Size: 2.0 GB (on my system)
Location: ~/.local/share/Trash/files/
Even after emptying the Trash through the regular interface, some large files persisted. I found them here and manually deleted them. (Side Note: I have to say, though I generally love KDE, their trash system is fairly broken with two major problems. The first is if you open the Trash to look inside, it copies all the files to the /tmp/kde-username/ folder, consuming harddrive space. In my case, I let my trash become huge, so this immediately fills up all freespace on the root / partition. This is a terrible bug they absolutely should have fixed years ago. The other problem is, like this situation, occasionally letting files slip through the cracks and not be correctly deleted.)

KTorrent Magnet Links
Size: 8.3 GB (on my system)
Location: ~/.kde/share/apps/kio_magnet
There is a bug with the KDE IO Slave for using Magnet Links in Ktorrent. Instead of downloading files using the temporary storage directory as specified within KTorrent, it dumps them to this location. That's a serious problem. The easy fix to remove this directory, and create a symbolic link (with the same name) to some temporary folder wherever you want.


Hope that helps you clear up some space on your home-directories and root partitions.

Update 1: Added the Wine section.
Update 2: Added the forgotten Trash files section.
Update 3: Added KIO_Magnet /KDE Magnet Links section.