Replace Unity with gnome-shell on Ubuntu 11.10

This article is about how to remove Unity (and its dependency packages) and launch the Gnome Shell by default.

Note: Some of the packages we want to remove may not installed in your system. Just remove the package name in the remove list.

1. Remove Unity and its dependency packages:
$ sudo apt-get remove unity unity-2d-places unity-2d unity-2d-panel unity-2d-spread unity-asset-pool unity-services unity-lens-files unity-lens-music unity-lens-applications gir1.2-unity-4.0 unity-common indicator-sound indicator-power indicator-appmenu libindicator6 indicator-application evolution-indicator indicator-datetime indicator-messages
This will also remove the tomboy and transmission. If you need them, just install back:
$ sudo apt-get install tomboy transmission

2. Install GNOME-shell and some BEST extra packages:
$ sudo apt-get install gnome-shell gnome-themes-standard gnome-sushi gnome-contacts gnome-tweak-tool

3. Remove scrollbar and appmenu of unity:
$ sudo apt-get remove appmenu-gtk indicator-applet-appmenu indicator-appmenu overlay-scrollbar

4. Use the native notification daemon (Or some notify may use ubuntu’s daemon and make us confuse):
$ sudo apt-get install notification-daemon
$ sudo apt-get remove notify-osd
This also remove gnome-power-manager but we need it.
$ sudo apt-get install gnome-power-manager

5. Clean up the system:

1
2
3
$ sudo apt-get autoremove
$ sudo apt-get autoclean
$ sudo dpkg --list |grep "^rc" | awk '{print $2}' | xargs sudo dpkg --purge

The first line is to clean up dependency packages while the second one is for the unused packages downloaded in system. The third one is to find the records which had been installed but remove and make a purge step.

6. Logout. And now you can log into GNOME Shell via click the ‘gear’ icon in login window and select GNOME Shell. Enjoy it. 🙂

The references are:
Ubuntu 11.10 GNOME Shell Guide
How can you remove Unity?
Ubuntu 11.10 Oneiric: Remove Unity and use Gnome Classic by Default

How to delete immutable files

After fsck for an office box, there exists some IMMUTABLE files. The files cannot be deleted, modified even I am super-user. Asking for help with ZMX (our friend), the reference is useful: Make your files immutable which even root can’t delete. The reason is the attribute of files are setup  as immutable and with owner/group misplaced.

The command to make the file mutable: # chattr -i {files}, and it can be deleted. If some files still cannot be deleted, the final strategy is to remove ALL of its attributes. Just run # chattr -AacDdijsSu {files}, and everything works. Enjoy it. 🙂

Create soft-raid with raidtools on RedHat 9

Because I’m familiar with mdadm, that I should write the note with raidtools as log. With the reference: The Software-RAID HOWTO: RAID setup, the step for raid-0 is listing:

1. Format the prepared disk, for example sdc and sdd, with whole disk for a partition:

1
2
# fdisk /dev/sdc
# fdisk /dev/sdd

2. Setup /etc/raidtab for md0 with 2 disk:

1
2
3
4
5
6
7
8
9
raiddev /dev/md0
raid-level 0
nr-raid-disks 2
chunk-size 32
persistent-superblock 1
device /dev/sdc1
raid-disk 0
device /dev/sdd1
raid-disk 1

3. Create the raid disk: # mkraid /dev/md0

4. Format the raid disk:# fdisk /dev/md0

5. Make a journal system (eg: ext3): # mke2fs -j /dev/md0

OK, that’s all. Enjoy it. 🙂

Partially to make rtl8192se works with kernel 3.0

My laptop is Lenovo X201 with a RTL8191SEvB wireless card. In kernel 2.6.3x version, I’ve to install the rtl8192se and rtl8192se-firmware packages to make it works. In the previous settings, the module named r8192se_pci and with a parameter hwwep=0 can led to a stable network connection no matter my gentoo or ubuntu box.

But the nightmare comes back when I upgrade to kernel-3.0.x with built-in rtl8192se modules in rtlwifi catalog. The issues are:
1) Network connection are hard to established and will disconnected dynamically itself.
2) My ad-hoc connection shared by Windows cannot be established.
3) And so on.

The symptoms of the issues are: the configurations via ifconfig, iwconfig even route are all CORRECTLY, but I still CANNOT ping the default gateway.

But now I found a PARTIAL solution. That is, to set a new parameter swenc=1 to make the module use software encryption rather than hardware one, which similar the old hwwep=0 with r8192se_pci modules.

To make it set on loaded, adding a configuration file via:
echo "options rtl8192se swenc=1" > /etc/modprobe.d/rtl8192se.conf

If you encounter the same problem with rtl8192se driver on RTL8191SEvB card, Try it. 🙂

[20111114 edit] From the forum, the developer suggest me to install iw and set the CRDA for the wirless card. After I try # iw reg set TW, my network connection in Ubuntu more stable. Maybe this is another trick, too.

Make cpufreqd work as module in Gentoo

I’m using the default setting via genkernel to build my box. But the cpufreqd always shown it cannot be start-up without the kernel config CONFIG_CPU_FREQ.

But the weird thing is: I’ve selected the CPU_FREQ* settings in my kernel and there are corresponding modules in /lib/modules/<kernel version>:/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=m
CONFIG_CPU_FREQ_STAT=m
CONFIG_CPU_FREQ_STAT_DETAILS=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=m
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
...

Finally, I found the reason: the modules (also the government settings) not be auto-loaded when booting. So I append the configuration for module auto-load for gentoo and everything works fine.

1. The final kernel configuration, I’ve change the default government setting from performance to userspace which make me can choose the speed I want:

1
2
3
4
5
6
7
8
9
10
11
12
13
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=m
CONFIG_CPU_FREQ_STAT=m
CONFIG_CPU_FREQ_STAT_DETAILS=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=m
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m

2. The auto-load module settings in gentoo (/etc/conf.d/module):

1
modules_3_0="acpi-cpufreq cpufreq_ondemand cpufreq_powersave cpufreq_conservative"

Which will load the INTEL’s CPUFREQ driver (acpi-cpufreq) and the governments.
Note: The governments which is loaded can be used in the programs (eg: Gnome’s CPU Frequency Scaling Monitor).
Note: the modules should be set AT LEAST major AND minor number of kernel (eg: 3.0 as 3_0) or it cannot be parsed.

Finally, everything works fine. Enjoy it. 🙂

GRUB settings of booting from usb disk with genkernel on Gentoo

I’ve tried to use genkernel to build my gentoo box recent days. But I cannot boot correctly via an installation with external USB disk (My gentoo box is on an external USB 2.5″ disk).

The default GRUB settings for genkernel user is:

1
2
3
4
title Gentoo Linux 2.6.34-r1
root (hd0,0)
kernel /boot/kernel-genkernel-x86-2.6.34-gentoo-r1 real_root=/dev/sda3
initrd /boot/initramfs-genkernel-x86-2.6.34-gentoo-r1

But with this configuration, the boot procedure will stop at there is not correct root sector can be loaded. That’s because the usb is slower o be configured than my laptop’s disks. And on the other hand, the waitroot, doslowusb, and so on additional configurations cannot be passed to a genkernal-ed source.

For some tries and referenced configurations on other linux distribution, the works setting is to use UUID (UUID=….) rather than aliased device name (dev/$ROOT). The correct settings:

1
2
3
4
title Gentoo Linux 2.6.34-r1
root (hd0,0)
kernel /boot/kernel-genkernel-x86-2.6.34-gentoo-r1 real_root=UUID=....
initrd /boot/initramfs-genkernel-x86-2.6.34-gentoo-r1

The UUID for devices can be found in your /etc/fstab if you also use genkernel. Finally, my USB gentoo works fine. Enjoy it. 🙂