Display Chinese PDF properly with Evince on Ubuntu

This note is about how to resolve the problem: Chinese PDFs do not display properly and all the Chinese characters are BLANK in Evince (a PDF reader based on Poppler library in GNOME).

The issue is related to the data files (poppler-data, a package for encoded data) which do not install by default. We can install it and make the PDF display works with:

# apt-get install poppler-data.

Now the characters shown correctly. If the characters are shown as unknown symbols, it may related to the font configurations. You can alter your font settings using Droid fonts with this reference: 套用 Droid 字型到 ubuntu linux. Enjoy it. 🙂

Install java-7-oracle with PPA on Ubuntu

This note is based on Howto- Install Oracle Java7 in Ubuntu12.04 Precise Pangolin | PPA. The download procedure in oracle-java7-installer package is broken. We should modify it for the rest automatically installation. The summary of my steps are listing:

1. Purge installed JDKs:
# apt-get purge openjdk* sun-java6*

2. Add repository for installation:

# add-apt-repository ppa:eugenesan/java
# apt-get update

3. Modify the installation procedure:
# vim /var/lib/dpkg/info/oracle-java7-installer.postinst
Comment out lines 103-106 which refers to download JDK. The contents may seems like:

WGETRC=wgetrc wget $PARTNER_URL \
|| fp_exit_with_error “download failed”
rm -f wgetrc

4. Manual download JDK source and move it into installation directory:
# mv {source} /var/cache/oracle-java7-installer/
The type (x86/x64) and name of the source can be found within the directory (if you had try to install). Eg: jdk-7u3-linux-x64.tar.gz.

5. Resume the installation:
# apt-get install oracle-java7-installer
All things done. Happy enjoy. 🙂

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:

$ 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