Wednesday, June 26, 2013

The KDE mess


How KDE infactuation messed my desktop

After much adieu and drool about MINT KDE15, I was tempted to try KDE desktop and installed it
sudo add-apt-repository ppa:kubuntu-ppa/backports
sudo apt-get update && sudo apt-get install kubuntu-desktop
sudo apt-get upgrade && sudo did apt-get update

KDE did comeup well, but my Cinnamon, GNOME and Mint got totally messed up. This meant that the default display manager became kdm and all other display managers - gdm, mdm, lightdm were messed up by something that happened during the installation. All attempts to fix it did not help. The only choice I thought I was left with was to reinstall the OS. But then I have done that so many times in the past, I was not excited anymore to do that. Instead I thought how about removing KDE-Desktop and get back to how things were before. Well, its's much easily said than done. Here's what I did to start with

sudo service lightdm start

Tried to manually start lightdm. That did not help a bit. It was an endless wait.

After much adieu and drool about MINT KDE15, I was tempted to try kde desktop and installed it
sudo add-apt-repository ppa:kubuntu-ppa/backports
sudo apt-get update && sudo apt-get install kubuntu-desktop
sudo apt-get upgrade && sudo apt-get update

KDE did comeup well, but my Cinnamon, GNOME and Mint got totally messed up. This meant that the default display manager became kdm and all other display managers - gdm, mdm, lightdm were messed up by something that happened during the installation. All attempts to fix it did not help. The only choice I thought I was left with was to reinstall the OS. But then I have done that so many times in the past, I was not excited anymore to do that. Instead I thought how about removing KDE-Desktop and get back to how things were before. Well, its's much easily said than done. Here's what I did to start with

sudo service lightdm start

Tried to manually start lightdm. That did not help a bit. It was an endless wait.


Opened the file /etc/x11/default-display-manager and manually det the default display manager to gdm

All hell cut loose and the system won't show me even the login screen now. After a ,couple of re-start, even KDM would not start. Now this was the worst point and I was totally struck. So I logged in to the command prompt mode and wanted to reconfigure lightdm and here's what I did

sudo dpkg-reconfigure lightdm
sudo apt-get upgrade && sudo apt-get update

That did help a bit. Now I was able to login to a default session and things started to get better, but still my gdm and mdm were not working. So I decided to totally remove gdm, mdm, kdm and reinstall what I wanted

sudo gnome-session quit #logout from the current session
sudo apt-get purge gdm
sudo reboot

sudo apt-get --purge remove kubuntu-desktop
sudo apt-get autoremove
sudo apt-get install gdm
sudo apt-get upgrade && sudo apt-get update
sudo dpkg-reconfigure gdm

Nope, this also did not help. The only choice I had was to manually remove every kdm package

#Remove all KDE and QT packages individually
sudo apt-get remove $(dpkg --get-selections | grep kde | awk '{ print $1 }')
sudo apt-get remove $(dpkg --get-selections | grep qt | awk '{ print $1 }')
# Remove the bin, if it was left hanging around
sudo apt-get remove kdebase-bin
# make sure you root the entire family out
sudo apt-get autoremove

sudo reboot

Now you are safe and finally, back to sane world. Hope this helps you guys too

Customize Linux Mint


Linux Mint customization
Some of the customizations I do

If Cinnamon theme is installed, I open Cinnamon "System settings". Browse into Themes and download more custom themes. These are the following themes I downloaded
1. Adwaita Classic
2. Ambiance Minty
3. Dark void
4. Elegance
5. Minty
6. Spearmint
7. Void
8. White Aqua
9. Zorin
10. Cinnamon classic

I prefer "void", Minty and Cinnamon Classic, although I love all of the above themes

If you want to install a theme manually, here's how you do it.
1. Download the theme of your choice from http://cinnamon-spices.linuxmint.com/themes
2. Unpack it into a local direcotry
3. Move the unpacked file into ~/.themes
4. Open Cinnamon settings, new theme should show up for selection

e.g. I installed mountain lion theme
cd ~/Downloads
wget http://cinnamon-spices.linuxmint.com/uploads/themes/RXU6-3BU1-D8AG.zip
This command downloaded a file (RXU6-3BU1-D8AG.zip). Now unzip it with command
unzip RXU6-3BU1-D8AG.zip
This would have created a directory "Mountain-Lion" with all files extracted.
Move this directory "Mountain-Lion" into ~/.themes
Open System setting and change you current theme to "Mountain-Lion"

Now that we have the choice of basic themes, out next objkective is to make sure if all of the themes render the way we want it. If you are not happy with the icons in the theme or with the window border, fonts, you can customize each of them for your need. Lets start with start menu

Star Menu
Linux Mint 15 (MATE) Start menu seems to have some weird disappearence issue. I wass not able to find out waht was causing it. That's when moved into Linux Cinnamon. I did not like the Star Menu icon and wanted to change it. Here's how I did it. Downloaded a PNG image of my choice (size 22*22 or 24*24) moved the file into the location /usr/lib/linuxmint/mintMenu/. Right-click on the start menu and select "Menu Settings". Changed the test "Menu" to "Start Linux" and changed the default settings image to the one I downloaded. Job done

Customize a theme
Open "System Settings"
Select a theme
Tap on "Other Settings" tab
Make your customization from the list for controls, window border, icon, mouse pointer and key bindings
I choose "Mint-X" for controls, "Neu" for icons, "eOS" for Window border, DMZ-White for mouse pointer, "Default" for keybindings

/usr/lib/linuxmint/mintMenu/search_engines/ideas.png


Install GNOME 3.8 in Ubuntu/Mint

The first repository is the Gnome 3 Team repo that contains all things missing from Ubuntu’s default repositories. You should add this one before the other two and run the usual update on your system. You can do this by typing the following commands on a terminal:

sudo add-apt-repository ppa:gnome3-team/gnome3
sudo apt-get update
sudo apt-get upgrade
Then you need to add the Ricotz testing repository that contains cutting edge git versions for the shell, gtk, glib, clutter and many Gnome applications and utilities.

sudo add-apt-repository ppa:ricotz/testing
sudo apt-get update
sudo apt-get upgrade
If you want to get some more latest Gnome components and risk the stability of the system even further, then you can use the Ricotz staging repository that can be correctly used only if you added the previous two.

sudo add-apt-repository ppa:ricotz/staging
sudo apt-get update
sudo apt-get upgrade

Setup new OS automatically


Install packages/applications from command prompt
Every once in a while we like to clean our OSs. But the problem doing that is the fear of loosing something you may need that you have not accounted for. If you are going to take a complete backup of your OS and restore it after the new installation, it defeats the cleanup purpose.

What I love to do is backup my data and then reinstall the OS, and through scripts install all the necessary s/w. This way if I miss any s/w I needed, I will know it in advance, and will add it to the list. No clutter in terms of adding garbage s/w.

In addition to the above, I love to try every upgrade that comes along with Mint, Cinnamon, Ubuntu (Unity), Kubuntu. In the process I sometimes mess up my local copy in the process. Hence I decided to put in a script that will automatically reinstall all the needed s/w. Remembering them is not going to help, writing them in a piece of paper is a joke. I save this command in the cloud. Everytime I install Ubuntu in my machine or for someone else, I just run these commands, sit back and relax, until these are done

First things first
Do an upgrade and update as soon as you install the OS. That's the first most important thing you need to do
sudo apt-get upgrade && sudo apt-get update

Install packages you need (I need all of this, if you don't need any of them, feel free to remove)
sudo apt-get install synaptic vlc p7zip-full gimp shutter chromium-browser bluefish wireshark vim calibre mono-complete idle3 idle3-tools eclipse smplayer cheese ruby1.9.3 mongodb monodevelop artha nemo-dropbox


Install Django
sudo apt-get install python-django python-django-doc python-mako python-openstack-auth django-ajax-selects django-filter django-tables python-django-app-plugins python3-dexml

Ruby for Rails
sudo apt-get install rubygems ruby-rails-3.2 rails3 rails-doc ruby-activesupport-3.2 ruby-activeresource-3.2 ruby-activemodel-3.2 ruby-actionpack-3.2 ruby-actionmailer-3.2

Install Aptana Studio for DJango, RoR
cd ~/Downloads
wget http://download.aptana.com/studio3/standalone/3.4.2/linux/Aptana_Studio_3_Setup_Linux_x86_3.4.2.zip
unzip Aptana_Studio_3_Setup_Linux_x86_3.4.2.zip
sudo mv ~/downloads/Aptana_studio_3 /etc/Aptna
sudo ln -s /etc/Aptana/AptanaStudio3 /bin/AptanaStudio

Install Cinnamon
sudo apt-get install cinnamon

Install Skype
sudo dpkg --add-architecture i386
sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"
sudo apt-get update && sudo apt-get install skype

Installing applications manually
Sometimes few applications in LINUX do not come with nice installers .deb, .dpkg. You may have to either download and install them or they may not have any installation piece at all. Copy them over to a directory of your choice and use them. This is the most confusing part for LINUX beginners. Where should I move these applications and how do I make it accessible. There are a lot of ways to do that, I 'll share what I was told by my seniors, and it is up to you to handle things the way you want it

These are some applications you will need as a developer and they may or may not be available in the software center. Like
1. Sublime Text
2. Eclipse
3. JDK
4. ADT for Android development
5. Android SDK
6. Ruby

Each of these will have to be downloaded from http/ftp location. I download all of these and dump them in my Downloads directory
Then extract them into /opt/<<package name>>
Then identify, locate executable, create an alias in /usr/local/bin

Here is an example of the same

Install sublime text
cd ~/Download
wget http://c758482.r82.cf2.rackcdn.com/sublime-text_build-3047_i386.deb
sudo dpkg -i sublime-text_build-3047_i386.deb

Now that was easy, because it was an executable. How about library files, should we do the same. Not really
Take the case of JDK or Android SDK. In this case,
I download the files into ~/Download directory
Unzip them into /usr/local/lib directory

Download an install ADT (32-bit)
cd ~/Downloads
wget http://dl.google.com/android/adt/adt-bundle-linux-x86-20130522.zip
unzip adt-bundle-linux-x86-20130522.zip
sudo mv ./adt-bundle-linux-x86-20130522 /usr/local/lib
cd /usr/local/lib/adt-bundle-linux-x86-20130522/sdk
chmod -R 755 ./tools ./build-tools ./platforms ./platform-tools

Follow the same procedure for both JDK, Android SDK and others

APT for Debian Linux


APT (Advanced Packaging tool) help
apt is the packaging tool used in debian based applications and does a great job in maintaining the repository. It is very important to understand and be comfortable with this packaging tool if you are a command line freak in Debian based world. Here are some command examples of different pieces in apt you may use in the daily worl. This is not the complete list of commands. There are more to it....make sure you read complete manual to get totally comfortable.

Why APT?
APT has proven its worth over the years. It is fast, responsive and stable, but most importantly, it is reliable. Should you lose Internet connection while updating your system or break the current operating, APT will gracefully pick up where you left the next time. Quite a few other management tools tend to remain in a broken state when the update process gets interrupted.

APT will manage the software dependencies in a smart way, both when installing and removing software. This includes maintaining a higher level revision control and topological sorting, in order to make sure your system will remain in a consistent state after numerous updates and uninstallations.

APT has many other smart features, all of which make it a very useful candidate for software management. It is not without a reason among the most popular choices in many Linux distributions.

Search for a package
You wish to know the name of the package you need to use for installation, here's how you do it
apt-cache search vlc

To know more information about a package
apt-cache show vlc

Install a package
apt-get install <<>>

To upgrade your distro
sudo apt-get dist-upgrade

To clean up cache
sudo apt-get clean && sudo apt-get autoclean

To remove a specific package 
apt-get remove <<package name>>

To do a auto remove of all packages, if some of them were not removed properly
apt-get autoremove

Do an update or upgrade
sudo apt-get update && sudo apt-get upgrade

A nice website to read about apt, if you want to know more http://www.dedoimedo.com/computers/aptitude.html