Installing Debian From Ubuntu or any other GNU/Linux

This post is about how to install Debian GNU Linux from your hard disk, with the help of your Ubuntu GNU Linux operating system and without using CDrom, floppy, or any other removeable media.

I have tried a few Linux distros and of course Microsoft Windows and I can say confidently that Ubuntu’s installation is the easiest and the best. All my hardware works out of the box like they were made for Ubuntu (They were not actually my hardware is very Windowish). This time, I was now trying to install Debian (testing) on one of the remaining partitions on my hard disk. Debian’s net install cd booted just fine but failed to deal with my CD-ROM drive. I was asked to provide drivers for it or manually select a driver. I didn’t have a floppy with drivers and none of the Debian drivers worked. After spending a few hours to get the installation media work, I finally gave up and opted to install from USB flash drive. Once again for some unknown reasons I failed to boot from USB.

Then I tried to install Debian from hard disk and it worked smoothly. I think you can install Debian from any operating system but not from an NTFS partition. In my case, I installed it from Ubuntu and it was much easier this way because Ubuntu itself is a GNU/Linux/Debian based operating system. Instructions to do that are available on the official Debian Installer Manual (Debian Installer Manual’s instructions are not Ubuntu specific but it does not matter). I would just try to make it a little more simpler. Please note that there are many other ways to do this, it will be a good idea to review other methods before trying this one.

In this example we are trying to Install Debian tesing. You need to download:

Place these three files in /boot/newinstall directory. Now open Grub menu.lst located at /boot/grub/menu.lst with your favorite text editor.

Scroll down until you see something like this:


title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd0,6)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=3599efe8-de32-4c9f-aed1-33c1c61d4bdf ro quiet splash
initrd /boot/initrd.img-2.6.22-14-generic
quiet

Note the root (hd0,6) line this is the partition where your Ubuntu is installed. It could be different for you depending your partition location. And now, we are going to boot Debian Installer from here. Add the following lines to your Grub.lst file.

title New Install
kernel (hd0,6)/boot/newinstall/vmlinuz
initrd (hd0,6)/boot/newinstall/initrd.gz

Now save the file and reboot your computer and you will see Grub showing you “New Install” as an option in the menu. Select it to boot Debian Installer and install it.

There is a similar way to install Ubuntu from a GNU/Linux based operating system. You can also Install Ubuntu, Debian and many other Linux distributions from your Windows or anyother operating system by using UNetbootin. To be very honest, I am kind of surprised to find out the many ways to install freedom for my computing needs.

Using Terminal to Shutdown Processes

XFCE does not come with a system monitor utility like the one I had in Gnome. I used the utility to kill unresponsive processes. So how do we kill unresponsive programs using the terminal? To understand how Linux handles processes and how you can control them read this great article by Gary Sim (in plain English). Here is what I learnt from Gary’s article.

We need to know the process id of the program that is not responding. We find out process id or PID by running the command

ps aux

This command displays all running processes. Below are a few of the many running processes on my computer. The list is long so I am only showing you a few to give you an idea.

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
nom 3006 0.0 0.3 2476 772 ? S 23:15 0:00 gnome-pty-helpe
nom 3097 0.0 4.0 16584 10348 ? Ss 23:23 0:01 gksu -u root /u
root 3102 0.0 0.4 3712 1068 pts/1 Ss+ 23:23 0:00 /bin/su root -c
root 3105 0.0 0.2 2256 592 pts/1 S+ 23:23 0:00 /usr/lib/libgks
nom 3321 0.7 3.2 14920 8364 ? Ss 23:44 0:01 mousepad

Now find out which one of them you want to kill. I want to kill the mousepad it has the PID 3321 and I kill it by running this command:

kill 3321

Just incase if this command doesn’t work you can try

kill -9 3321

I am very happy with XFCE. But I need to find out a nice and lite pdf viewer. Evince is great but how could I download evince without downloading so many gnome libs? There is an evince-gtk package in Debian experimental but I can not install it due to dependency issues.

Gmail and Google Reader in Startup Programs

I have tried several Email Clients and Feedreaders on Ubuntu and my primary Debian Operating System. But now I was feeling that why bother with any more software when you have Google and Firefox (Iceweasel on Debian). So, I decided to make myself a script that automatically opens my Gmail and Google Reader account in Firefox each time I log on to my computer. I thought may be some of you would find it useful.

Step 1: We need to create two files.
mailnreader1 which contains this:

#! /bin/sh
firefox http://mail.google.com/

And mailnreader2 which contains this:

#! /bin/sh
sleep 30;
firefox -new-tab http://www.google.com/reader

We are going to save these two files in /usr/bin/ directory. Once you have pasted these files please check the permissions. Select a file right click and select Properties and then click on Permissions tab. Make sure that the file is read and executeable by all. See the image below:

file permissions should look like this

These two files contain simple commands to open Firefox with specified web addresses. The sleep command tells your computer to wait for 30 seconds before running the next command. The reason behind doing this is that when your session begins your computer performs some tasks. Like loading your settings, Desktop, Nautilus, etc. My system is only 800 mghz, and If I don’t wait for 30 seconds the browser would give me an error something like this:

Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system.

If you have a faster computer you can try removing the sleep line or decrease the number of seconds.

2: Now Go to Preferences > Sessions, click on Startup Programs tab, press the Add button and add this:

mailnreader1

Press Ok and then press the Add button again to add the second file:


mailnreader2

Press Ok and then Close. Now to check these scripts out you need to Log Out and then Log In.

Why two files?

I tried creating a single file containing this code:

#! /bin/sh
firefox http://mail.google.com/
sleep 30;
firefox -new-tab http://www.google.com/reader

But it didn’t work. I hope someone would improve the script so that we don’t have to wait longer and we can add more sites all in one single script. Until then, I guess I will keep using it because it works and saves me time and hassle of fetching mail and feeds in two separate windows while browsing the web in the third window.

Troubleshooting Volume and Sound Card Configuration in Debian

I had a problem with gnome-volume-control. It didn’t save my volume control settings and displayed a mute sign on every startup.

While trying to solve this issue, I did something (I don’t remember what it was) that totally messed my sound configuration and now gnome-volume-control stopped working at all. Today I solved this problem and thought that I should write it here may be some one would find it useful. Please note that these instructions are written for Gnome. You can use these settings for KDE too but for that you will have to set sound system to use Alsa.

The first step is to make sure that you have following packages installed:

  • alsa-base
  • alsa-source
  • alsa-tools
  • alsa-tools-gui
  • alsa-utils

ALSA is Advanced Linux Sound Architecture. It provides sound drivers and provides audio and MIDI functionality to Linux Operating System. With the above packages installed we are now equipped to move on. Now start the Terminal and run:

# alsaconf

Remember that # sign tells you that the command should be entered with super user privileges.

This command will start a wizard ‘Alsa Configurator’ to assist you configure your ALSA settings. Read and follow the instructions, they are self explanatory and you just need to press the enter button on your keyboard. This script automatically closes gnome-volume-control and a notification appears informing you about that and asking you whether or not you want to reload gnome-volume-control applet. Choose Don’t load or do nothing and press the Reload button when you are done with Alsa Configurator script.

gnome volume iconNow if you pressed the Don’t load button then you will have to start gnome-volume-control. I will tell you only the easiest way. Move your mouse to the panel, right click and select Add to Panel and then add Volume Control applet. Double click the volume icon on your panel and set the sound. Don’t worry we are going to test it later.

Exit volume control and type

# alsactl store

now run

# speaker-test

You hear the sound?

Yes: Thats good now close the terminal to get rid of this annoying noise. You can now set your volume control settings to your desired levels.

No: Try again, reboot your system and they try to play some music or sound files. Sound doesn’t work at all? Then I suggest you read the expert advise. If the expert advise is too difficult for you to follow then you should try Debian IRC chat room for help.

Using Terminal as FTP Client

Ok so you have installed Ubuntu and loved the pretty and easy Gnome interface, now what? May be you are thinking, that this Ubuntu is just another operating system. It is indeed just another operating system. But, this one is a Debian Linux based operating system. Sooner or later you are going to realize that your OS is equipped with powerful tools and utilities. Most of these power tools and utilities show their true powers when they are run from the Terminal.

For example there is an FTP client that you can run from Terminal.


$ ftp
ftp>
ftp> open ftp.example.com
Connected to ftp.example.com.
220 ProFTPD 1.3.0rc2 Server (YourHost FTP) [XXX.XXX.XXX.XX]
Name (ftp.sabza.org:nom): yourusername
331 Password required for yourusername.
Password:
230 User yourusername logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

Playing with this ftp tool for a while would make you feel that it is not all that powerful. So you need a powerful ftp tool that you can run from Terminal? Try ncftp.


$ sudo apt-get install ncftp

and then:

$ ncftp
NcFTP 3.2.0 (Aug 05, 2006) by Mike Gleason (http://www.NcFTP.com/contact/).
ncftp>

Want something even more powerful? Well you have ssh but to use ssh your remote host should have SSH enabled.


$ ssh yourusername@ftp.example.com
yourusername@ftp.example.com's password:
[hostmachine]$

Using Terminal gives you the power to do things quickly. Head over to The Linux Terminal – a Beginners’ Bash and learn to do things the Linux way.

Tags:

Deleting Unwanted Files

Recently I realized that the Disks utility was showing 8.6 GiB consumed on my Ubuntu partition (I have Xubuntu installed on another partition and have one FAT partition). I decided to free up some disk space by deleting temporary files. I found that there is no tool in Dapper to automate this process. There is a tool for KDE called ‘Kleansweep‘ and also there is a feature specification on launchpad to integrate a similar tool in Ubuntu. But right now Dapper users should do it manually relying on Google and their own instincts to decide what is safe to delete and what could break their system’s stability.

To free up disk space we need to delete unnecessary files. But where are these files and how do I know that it is safe to delete them? I have found that it is safe to delete files in /home/username/.thumbnails/normal and /home/username/.thumbnails/fail folder.

It is also safe to delete the downloaded packages in /var/cache/apt/archives I personally don’t like to delete these files. Infact I even copy and paste these files to a separate partition on my hard disk. Why? Because these files are the downloaded packages we install using apt (apt-get or synaptic). If we uninstall a package and then later decide to reinstall it we will have to download it again which consumes time and bandwidth. But if you are not like one of those people who install and uninstall software on a daily basis without need or reason then it is safe to delete these files.

You can also free up disk space by emptying browser cache, saved chat files, old log files, etc.

Have we cleaned all unnecessary files? I don’t think so. I really think that there should be an easy to use application to do this job.

Troubleshoot Ubuntu Edgy Upgrade

I haven’t upgraded to Edgy yet. I really want to but I am afraid to loose the stability, usefulness and the charm of Dapper that comes with Long Term Support. I was looking around to see what kind of trouble people facing while upgrading to Edgy from Dapper. To my surprise, there is a whole lot of users out there who had bad experiences while upgrading to Edgy. Looking at these complains on Ubuntu forums, Slashdot and blogosphere, I decided to compile a list of links that might offer some help to those who want to troubleshoot their Upgrade Disaster.

Debian Admin has a wonderful article about Ubuntu Edgy upgrade problems and their solutions. If your issue is not listed there then you can add it in comments or move on to the Ubuntu forums.

In the sub-forum Installation and Upgrades, you will find plenty of solutions. It is good to search the forum and the best way to do it is to search for the error you recieve during your upgrade failure by typing the error in the search box. While browsing the forum, I found quite interesting bits about Edgy upgrade issues in the First sticky thread of the sub-forum, titled “PLEASE use the official upgrade method! (if you decide to upgrade)“. Like I found that the first recommended method described on EdgyUpgrades wiki page does not work for Xubuntu. After further more research I found people who upgraded from Clean 6.06 to 6.10 without using any third party tools and causing any harm to their Ubuntu System’s health and still they faced trouble.