Tag Archive: ubuntu



 

Linux is a great operating system and more often than not, it’s the installation of Linux that is the matter of discussion.

For a change, I will be talking about how touninstall Linux Ubuntu (or other operating systems) from a dual boot windows pc, and still being able to boot into other OS without much work. So let’s get started right away.

Backup your Linux files

It pops up everytime, but backup really is very important. If you have been using your Linux system for some time, chances are you would have created files you wouldn’t want to loose. In such a case, you can boot into Linux, backup your files (check out your Home directory) on an external device or onto a Windows partition.

Alternatively if you somehow managed to mess up and can’t boot into Linux, you can use ext2 IFS which allows you access to your Linux paritions. It can only read ext2 and ext3 filesystems though. If you are using other filesystems, you would have to look around a bit for a similar application. In any case, you can always boot from a Linux live CD to backup files if everything else fails.

Delete Linux Partitions

Next step: delete every Linux partition. That would include everything – boot, swap, home, whatever way you set up your system, it is time to delete all Linux partitions. There are a couple of ways to achieve this, easiest being from within Windows’ Computer Management. You need to:

how to uninstall ubuntu from dual boot windows pc

  • Log in to an account with administrative privileges.
  • Right click on My Computer, click ‘Manage’.
  • Choose ‘Disk Management’ listed under ‘Storage’ and you will see all of your partitions listed there.

how to uninstall ubuntu from dual boot windows pc

Next, you need to identify Linux partitions. The Linux partitions generally don’t have a file system listed with them if Windows doesn’t recognize it, so this can serve as a clue. Other ways can be identifying by size or partition number. You can use partition managers, these are generally better at identifying filesystems. Go ahead, delete the partitions, just make sure you delete the correct ones. Linux is gone and so is GRUB, which allowed you to choose operating system to use at boot time. So currently, you cannot boot into any other operating system, without some help. We are going to fix that soon.

Restore MBR

As we noted, GRUB is gone and so is the ability to boot into Windows. You would now need to boot from the Windows CD/DVD to restore the Master Boot Record. You can also use other Live CDs like one of my absolute favorites and highly recommended HBCD just in case you don’t have Windows installation media handy. Here are the steps:

  • Boot from Windows CD/DVD and choose “Repair” when it shows up.

uninstall ubuntu from dual boot pc

  • Choose command prompt on the resulting screen and run the following two commands:
    • bootrec /fixmbr
    • bootrec /fixboot

XP users need to run the recovery console from Windows XP CD and then type fixmbr when at the command prompt.

Reclaim free space

Restart now, remove the CD and you should be able to boot into your Windows installation. Once there, you should go ahead and reclaim the unpartitioned free space which was previously occupied by Linux. Doing so is simple and straight forward:

  • Fire up Disk Management as before.
  • Right-click on the unparitioned space, choose new partition or new logical drive.
  • Specify the size and other options according to your needs and you are done.

The free space should now be accessible from My Computer like any other partition. Alternatively, you can create multiple partitions from the free space or resize existing partitions to suit your needs.You can use utilities like GPartedEasues Partition Master or any one of the many partition managers on HBCD to perform such advanced tasks easily.

Managing Packages in Ubuntu


Debian based systems (including Ubuntu) uses apt-* commands for managing packages from the command line.

In this article, using Apache 2 installation as an example, let us review how to use apt-* commands to view, install, remove, or upgrade packages.

1. apt-cache search: Search Repository Using Package Name

If you are installing Apache 2, you may guess that the package name is apache2.  To verify whether it is a valid package name, you may want to search the repository for that particular package name as shown below.

The following example shows how to search the repository for a specific package name.

$ apt-cache search ^apache2$
apache2 - Apache HTTP Server metapackage

2. apt-cache search: Search Repository Using Package Description

If you don’t know the exact name of the package, you can still search using the package description as shown below.

$ apt-cache search "Apache HTTP Server"
apache2 - Apache HTTP Server metapackage
apache2-doc - Apache HTTP Server documentation
apache2-mpm-event - Apache HTTP Server - event driven model
apache2-mpm-prefork - Apache HTTP Server - traditional non-threaded model
apache2-mpm-worker - Apache HTTP Server - high speed threaded model
apache2.2-common - Apache HTTP Server common files

3. apt-file search: Search Repository Using a Filename from the Package

Sometimes you may know the configuration file name (or) the executable name from the package that you would like to install.

The following example shows that apache2.conf file is part of the apache2.2-common package. Search the repository with a configuration file name using apt-file command as shown below.

$ apt-file search apache2.conf
apache2.2-common: /etc/apache2/apache2.conf
apache2.2-common: /usr/share/doc/apache2.2-common/examples/apache2/apache2.conf.gz

4. apt-cache show: Basic Information About a Package

Following example displays basic information about apache2 package.

$ apt-cache show apache2
Package: apache2
Priority: optional
Maintainer: Ubuntu Core Developers
Original-Maintainer: Debian Apache Maintainers
Version: 2.2.11-2ubuntu2.3
Depends: apache2-mpm-worker (>= 2.2.11-2ubuntu2.3)
 | apache2-mpm-prefork (>= 2.2.11-2ubuntu2.3)
 | apache2-mpm-event (>= 2.2.11-2ubuntu2.3)
Filename: pool/main/a/apache2/apache2_2.2.11-2ubuntu2.3_all.deb
Size: 46350
Description: Apache HTTP Server metapackage
 The Apache Software Foundation's goal is to build a secure, efficient and
 extensible HTTP server as standards-compliant open source software.
Homepage: http://httpd.apache.org/

5. apt-cache showpkg: Detailed Information About a Package

“apt-cache show” displays basic information about a package. Use “apt-cache showpkg” to display detailed information about a package as shown below.

$ apt-cache showpkg apache2
Package: apache2
Versions:
2.2.11-2ubuntu2.3 (/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_jaunty-updates_main_binary-i386_Packages) (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_jaunty-security_main_binary-i386_Packages)
 Description Language:
                 File: /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_jaunty-updates_main_binary-i386_Packages
                  MD5: d24f049cd70ccfc178dd8974e4b1ed01
Reverse Depends:
  squirrelmail,apache2
  squid3-cgi,apache2
  phpmyadmin,apache2
  mahara-apache2,apache2
  ipplan,apache2
Dependencies:
  2.2.11-2ubuntu2.3 - apache2-mpm-worker (18 2.2.11-2ubuntu2.3) apache2-mpm-prefork (18 2.2.11-2ubuntu2.3) apache2-mpm-event (2 2.2.11-2ubuntu2.3)
  2.2.11-2ubuntu2 - apache2-mpm-worker (18 2.2.11-2ubuntu2) apache2-mpm-prefork (18 2.2.11-2ubuntu2) apache2-mpm-event (2 2.2.11-2ubuntu2)
Provides:   2.2.11-2ubuntu2.3 -
  2.2.11-2ubuntu2 -
Reverse Provides:   apache2-mpm-itk 2.2.6-02-1build4.3
  apache2-mpm-worker 2.2.11-2ubuntu2.3
  apache2-mpm-prefork 2.2.11-2ubuntu2.3
  apache2-mpm-prefork 2.2.11-2ubuntu2
  apache2-mpm-event 2.2.11-2ubuntu2

6. apt-file list: List all the Files Located Inside a Package

Use “apt-file list” to display all the files located inside the apache2 package as shown below.

$ apt-file list apache2 | more
apache2: /usr/share/bug/apache2/control
apache2: /usr/share/bug/apache2/script
apache2: /usr/share/doc/apache2/NEWS.Debian.gz
apache2: /usr/share/doc/apache2/README.Debian.gz
apache2: /usr/share/doc/apache2/changelog.Debian.gz
...

7. apt-cache depends: List all Dependent Packages

Before installation, if you like to view all the dependent packages, use “apt-cache depends” as shown below.

$ apt-cache depends apache2
apache2
 |Depends: apache2-mpm-worker
 |Depends: apache2-mpm-prefork
  Depends: apache2-mpm-event

8. dpkg -l: Is the Package Already Installed?

Before installing a package, you may want to make sure it is not already installed as shown below using dpkg -l command.

$ dpkg -l | grep -i apache

9. apt-get install: Install a Package

Finally, install the package using “apt-get install” as shown below.

$ sudo apt-get install apache2
[sudo] password for ramesh: 

The following NEW packages will be installed:
  apache2 apache2-mpm-worker apache2-utils apache2.2-common libapr1
  libaprutil1 libpq5

0 upgraded, 7 newly installed, 0 to remove and 26 not upgraded.

10. dpkg -l : Verify Whether the Package got Successfully Installed

After installing the package, use “dpkg -l” to make sure it got installed successfully.

$ dpkg -l | grep apache ii  apache2             2.2.11-2ubuntu2.3  Apache HTTP Server metapackage
ii  apache2-mpm-worker  2.2.11-2ubuntu2.3  Apache HTTP Server - high speed threaded mod
ii  apache2-utils       2.2.11-2ubuntu2.3  utility programs for webservers
ii  apache2.2-common    2.2.11-2ubuntu2.3  Apache HTTP Server common files

11. apt-get remove: Delete a Package

Use “apt-get purge” or “apt-get remove” to delete a package as shown below.

$ sudo apt-get purge apache2 
(or)

$ sudo apt-get remove apache2

The following packages were automatically installed and are no longer required:
  apache2-utils linux-headers-2.6.28-11 libapr1 apache2.2-common
  linux-headers-2.6.28-11-generic apache2-mpm-worker libpq5 libaprutil1Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  apache2
0 upgraded, 0 newly installed, 1 to remove and 26 not upgraded.
Removing apache2 ...
  • apt-get remove will not delete the configuration files of the package
  • apt-get purge will delete the configuration files of the package

12. apt-get -u install: Upgrade a Specific Package

The following example shows how to upgrade one specific package.

$ sudo apt-get -u install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
apache2 is already the newest version.
The following packages were automatically installed and are no longer required:
  linux-headers-2.6.28-11 linux-headers-2.6.28-11-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 26 not upgraded.

13. apt-get -u upgrade: Upgrade all Packages

To upgrade all the packages to it’s latest version, use “apt-get -u upgrade” as shown below.

$ sudo apt-get -u upgrade
The following packages will be upgraded:
  libglib2.0-0 libglib2.0-data libicu38 libsmbclient libwbclient0
  openoffice.org-base-core openoffice.org-calc openoffice.org-common
  openoffice.org-core openoffice.org-draw openoffice.org-emailmerge
  openoffice.org-gnome openoffice.org-gtk openoffice.org-impress
  openoffice.org-math openoffice.org-style-human openoffice.org-writer
  python-uno samba-common smbclient ttf-opensymbol tzdata
26 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Ubuntu

My personal favorite was Ubuntu for desktop (#1 in this list) and Red Hat for servers (#5 in this list).

If you are new to any of the distros listed in the top 5, read the rest of the article to understand little bit more about those distros and find out whether your favorite Linux distribution made it in the top 5.

Linux Distro Review

Fig: Favorite Linux Distribution Voting Results

1. Ubuntu

Ubuntu 8.04 LTS Desktop

Like most of you, Ubuntu is my #1 choice for desktop Linux. I use it both at home and work. Ubuntu is the #1 in the Linux desktop market and some use Ubuntu for the servers also. Ubuntu offers the following three editions.

  • Ubuntu Desktop Edition
  • Ubuntu Server Edition
  • Ubuntu Notebook Remix

Additional Details:

Refer to our Ubuntu Tips and Tricks article series.

2. Debian

Debian 4.0r8, or etch

Debian is also called as Debian GNU/Linux, as most of the basic OS tools comes from the GNU Project. Lot of other famous distributions are based on Debian, which includes our #1 distro Ubuntu and many others — such as Knoppix, Linspire, Damn Small Linux etc.,

Additional Details:

Read more about Debian Distribution at wikipedia.

3. Fedora

Fedora 10 Server Edition

Fedora is sponsored by Red Hat. If you are interested in experimenting with the the leading technologies, you should use fedora, as the release cycle is very short and fedora tends to include the latest technology software/packages in it’s distribution.

Additional Details:

Read more about Fedora Distribution at wikipedia.

4. CentOS

CentOS 5 Linux Distro

If your organization does not want to spend money on purchasing Red Hat support, but still want all the benefits of the red-hat distribution, this is obviously the best choice, as this is totally based on the red-hat enterprise Linux.

As you can imagine the Nort American Enterprise Linux vendor mentioned in the quote below is Red Hat.

From the CentOS website: CentOS 2, 3, and 4 are built from publically available open source SRPMS provided by a prominent North American Enterprise Linux vendor. CentOS is designed for people who need an enterprise class OS without the cost or support of the prominent North American Enterprise Linux vendor.

Additional Details:

Read more about CentOS Distribution at wikipedia

5. Red Hat

Linux Red Hat 4 Enterprise Linux for Server

This is my favorite server distribution.  If an organization doesn’t mind spending dollars on purchasing the red-hat support, this is always my #1 recommendation to any organization who runs mission critical applications.

On a side note, one of the reason I like Red Hat Linux for mission critical production application is that Red Hat tends to take some of the new features from Fedora, which is well tested by the community.

Additional Details:

Read more about Red Hat Distribution at wikipedia.

Awesome Linux Articles

Following are few awesome 15 examples articles that you might find helpful.

Fedora 16 to Ubuntu 11.10


In this article is the first of several articles comparing the recently released Fedora 16 to Ubuntu 11.10. This first article is looking at the boot performance and power consumption from several different notebooks when performing clean installs of Fedora Verne and Ubuntu OneiricOcelot.

There are several significant differences between Ubuntu 11.10 and Fedora 16 that make for an interesting comparison. Fedora 16 is shipping with the Linux 3.1 kernel and the GNOME3.2.1 desktop, including the GNOME Shell. Fedora 16 also furthers its integration with the much talked about systemd init service, after it made its premiere with Fedora 15. Fedora also ships with the bleeding-edge Linux graphics stack. Meanwhile, Ubuntu 11.10 shipped last month with the Linux 3.0 kernel and some GNOME 3.0 packages around Canonical’s Unity desktop. Ubuntu has no plans in the foreseeable future to abandon Upstart in favor of systemd. Both Fedora 16 and Ubuntu 11.10 have some similarities like both using GCC 4.6 and sticking to the EXT4 file-system by default for now.

The battery testing and power consumption comparison is being done from a Lenovo ThinkPad T61, ASUS Eee PC, and Lenovo ThinkPad W510 to represent a few popular notebook/netbook configurations on the market.

Linux desktop performance benchmarks and other articles are forthcoming.

The boot speed was measured using Bootchart and for each clean install of the 64-bit version of Ubuntu 11.10 and Fedora 16, the Phoronix user was set to automatic log-in. All other distribution settings were at their defaults. Each system rebooted three times before capturing the Bootchart result.

Starting with the Bootchart results is the ASUS Eee PC 1301N. This netbook has an Intel Atom 330 dual-core x86_64 CPU with NVIDIA GeForce 9400M graphics on Nouveau, 2GB of RAM, and a 250GB Hitachi 5400RPM SATA HDD.

 

Bootchart in Fedora measured a start time of 32.72 seconds. Ubuntu 11.10 had a reported boot time of 32.40 seconds on the same hardware.

 

When running the Lenovo ThinkPad T61 with its Intel Core 2 Duo T9300 CPU, 4GB of RAM, and 100GB Hitachi 7200RPM SATA HDD, Fedora 16 booted in 28.23 seconds. Ubuntu 11.10 meanwhile booted in 22.88 seconds for the Intel Core 2 Duo notebook.

The last notebook being measured today is the Lenovo ThinkPad W510 with an Intel Core i7 720QM quad-core CPU plus Hyper Threading and a 160GB Intel SSD (SSDSA2M160). For this Intel notebook that is still powerful by today’s standards, Fedora 16 booted in 25.81 seconds. Ubuntu 11.10 managed to come in much faster at 12.24 seconds.

 Fedora’s increased usage of systemd would give it a lead in boot performance plus all of the other upstream optimizations and improvements made by the Fedora / Red Hat engineers, this was not the case in comparing Fedora 16 and Ubuntu 11.10. On the Atom netbook the boot speed was comparable between Ubuntu 11.10 and Fedora 16, while for the more powerful Intel notebooks with an HDD and SSD, the Ubuntu 11.10 boot speed was superior. This is a bit surprising because Ubuntu 11.10 has regressed hard on the boot speed, but had there not been this regressing since Ubuntu 10.04 LTS, Oneiric Ocelot would have performed even better.

In terms of the power usage between Fedora 16 and Ubuntu 11.10, first up are the results from the Atom 330 netbook with the NVIDIA ION (GeForce 9400) graphics on Nouveau for both operating systems running on battery.

When both Linux distributions were idling with their respective desktops, Fedora 16 was going through slightly less power than Ubuntu 11.10 for the ASUS Eee PC 1301N.

When running the OpenArena game, Fedora 16 was going through slightly less power Ubuntu 11.10.

OpenArena was also running faster on Fedora 16 with its more bleeding-edge open-source graphics capabilities.

When the poor Intel Atom 330 was being hammered with C-Ray, the power consumption was nearly identical between the Canonical and Red Hat operating systems.

Ubuntu 11.10 was slightly faster this time, although both Linux operating systems are using GCC 4.x.

Now it is onto the power consumption between Fedora 16and Ubuntu 11.10 for the Core 2 Duo Lenovo ThinkPad T61.

For this system, Ubuntu 11.10 ends up with slightly lower power consumption than Fedora 16 when idling.

Ubuntu 11.10 is also slightly more power efficient than Fedora 16 for this Core 2 Duo notebookwith NVIDIA Quadro graphics when running the OpenArena ioquake3-based game.

Fedora 16, however, is much faster than Ubuntu 11.10 thanks to carrying more recent Nouveau driver patches.

The C-Ray power consumption results were close.

This time the ray-tracing test itself was faster under Fedora 16 than Ubuntu 11.10.

Finally it is onto the power consumption results for the Core i7 + NVIDIA Quadro FX 880M notebook, a.k.a. the Lenovo ThinkPad W510.

The power consumption when running the OpenArena game averaged out to be the same between Fedora 16 and Ubuntu 11.10.

However, like all of the other results, the OpenGL performance was much faster under Fedora 16 thanks to its more liberal graphics stack.

There also was not any significant power consumption difference between these two popularLinux distributions when tapping all of the available CPU cores with C-Ray.

The C-Ray test result here was also the same on both distributions.

While Ubuntu 11.10 may commonly be booting faster than Fedora 16, when comparing the power consumption results there is no frontrunner. For the most part, the power consumption is the same between Fedora 16 and Ubuntu 11.10, but depending upon the CPU, GPU, and other factors there can be slight differences. Fortunately, for both operating systems, there are power management improvements coming down the pipe that will hit for Ubuntu 12.04 LTS and Fedora 17, if they do not end up being back-ported.

%d bloggers like this: