Gangmax Blog

Fixed issues after installing Ubuntu 14.04

Ubuntu 14.04 was released several days before, and I ran into several problems with it. Here is a note how to fix them.

Octopress cannot generate pages

After install rvm/ruby-1.9.3, I run “rake generate” will lead to the following error:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
$ rake generate
## Generating Site with Jekyll
unchanged sass/screen.scss
Configuration from /home/gang/coderoot/github/octopress/_config.yml
Building site: source -> public
/home/gang/.rvm/gems/ruby-1.9.3-p545/gems/ffi-1.0.11/lib/ffi/library.rb:121:in `block in ffi_lib': Could not open library 'lib.so': lib.so: cannot open shared object file: No such file or directory (LoadError)
from /home/gang/.rvm/gems/ruby-1.9.3-p545/gems/ffi-1.0.11/lib/ffi/library.rb:88:in `map'
from /home/gang/.rvm/gems/ruby-1.9.3-p545/gems/ffi-1.0.11/lib/ffi/library.rb:88:in `ffi_lib'
from /home/gang/.rvm/gems/ruby-1.9.3-p545/gems/rubypython-0.5.3/lib/rubypython/python.rb:29:in `<module:Python>'
from /home/gang/.rvm/gems/ruby-1.9.3-p545/gems/rubypython-0.5.3/lib/rubypython/python.rb:21:in `<top (required)>'
from /home/gang/.rvm/gems/ruby-1.9.3-p545/gems/rubypython-0.5.3/lib/rubypython.rb:261:in `load'
from /home/gang/.rvm/gems/ruby-1.9.3-p545/gems/rubypython-0.5.3/lib/rubypython.rb:261:in `reload_library'
from /home/gang/.rvm/gems/ruby-1.9.3-p545/gems/rubypython-0.5.3/lib/rubypython.rb:104:in `start'
from /home/gang/.rvm/gems/ruby-1.9.3-p545/gems/pygments.rb-0.2.4/lib/pygments/ffi.rb:8:in `start'
from /home/gang/.rvm/gems/ruby-1.9.3-p545/gems/pygments.rb-0.2.4/lib/pygments/ffi.rb:82:in `highlight'
from /home/gang/coderoot/github/octopress/plugins/pygments_code.rb:24:in `pygments'
from /home/gang/coderoot/github/octopress/plugins/pygments_code.rb:14:in `highlight'
from /home/gang/coderoot/github/octopress/plugins/backtick_code_block.rb:37:in `block in render_code_block'
from /home/gang/coderoot/github/octopress/plugins/backtick_code_block.rb:13:in `gsub'
from /home/gang/coderoot/github/octopress/plugins/backtick_code_block.rb:13:in `render_code_block'
from /home/gang/coderoot/github/octopress/plugins/octopress_filters.rb:12:in `pre_filter'
from /home/gang/coderoot/github/octopress/plugins/octopress_filters.rb:27:in `pre_render'
from /home/gang/coderoot/github/octopress/plugins/post_filters.rb:112:in `block in pre_render'
from /home/gang/coderoot/github/octopress/plugins/post_filters.rb:111:in `each'
from /home/gang/coderoot/github/octopress/plugins/post_filters.rb:111:in `pre_render'
from /home/gang/coderoot/github/octopress/plugins/post_filters.rb:166:in `do_layout'
from /home/gang/.rvm/gems/ruby-1.9.3-p545/gems/jekyll-0.11.0/lib/jekyll/post.rb:189:in `render'
from /home/gang/.rvm/gems/ruby-1.9.3-p545/gems/jekyll-0.11.0/lib/jekyll/site.rb:193:in `block in render'
from /home/gang/.rvm/gems/ruby-1.9.3-p545/gems/jekyll-0.11.0/lib/jekyll/site.rb:192:in `each'
from /home/gang/.rvm/gems/ruby-1.9.3-p545/gems/jekyll-0.11.0/lib/jekyll/site.rb:192:in `render'
from /home/gang/.rvm/gems/ruby-1.9.3-p545/gems/jekyll-0.11.0/lib/jekyll/site.rb:40:in `process'
from /home/gang/.rvm/gems/ruby-1.9.3-p545/gems/jekyll-0.11.0/bin/jekyll:250:in `<top (required)>'
from /home/gang/.rvm/gems/ruby-1.9.3-p545/bin/jekyll:23:in `load'
from /home/gang/.rvm/gems/ruby-1.9.3-p545/bin/jekyll:23:in `<main>'
from /home/gang/.rvm/gems/ruby-1.9.3-p545/bin/ruby_executable_hooks:15:in `eval'
from /home/gang/.rvm/gems/ruby-1.9.3-p545/bin/ruby_executable_hooks:15:in `<main>'

I found the fix from here. The root cause is that the “rubypython” gem was looking for the python library file from a path which was incorrect on the ubuntu-14.04(AMD64) environment. So the fix is simple: create sybolic links of the library files where the “rubypython” gem is comfortable to work:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$ dpkg -L libpython2.7
/.
/usr
/usr/lib
/usr/lib/python2.7
/usr/lib/python2.7/config-x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
/usr/share
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/libpython2.7
/usr/share/doc
/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1
/usr/share/doc/libpython2.7

$ cd /usr/lib
# For ubuntu 14.04(AMD64/x86_64)
$ sudo ln -s /usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
# For ubuntu 14.04(x86)
sudo ln -s /usr/lib/python2.7/config-i386-linux-gnu/libpython2.7.so
sudo ln -s /usr/lib/i386-linux-gnu/libpython2.7.so.1.0

Another possibility is that the needed Python version is not installed. In my case when building the Octopress posts on Ubuntu 16.04 Xenial, I meet the same issue but the Python lib files are in the right place, the roor cause is that: the Python version “2.7.10” is not installed. Install it by using “pyenv install 2.7.10” then it works.

Eclipse menu is disappeared

“Eclipse(Kepler SR2)” cannot show the menu under Ubuntu 14.04. The solution was found from here:

1
2
3
4
5
6
# Add the following line at the end of "~/.local/share/applications/alacarte-made.desktop(or any name you're sure indicating eclipse)":
X-Ayatana-Desktop-Shortcuts=NewWindow
[NewWindow Shortcut Group]
Name=New Window
Exec=env UBUNTU_MENUPROXY= eclipse
TargetEnvironment=Unity

RabbitVCS right-click menu is disappeared

The solution is found from here. This is actually 2 problems:

  1. The python lib files missing problem as “octopress cannot generate pages”;
  2. The “/usr/share/nautilus-python/extensions/RabbitVCS.py” file should be updated as the one from here.

Default Chinese font

The default Chinese font of Ubuntu 14.04 is Song while I prefer WQY(文泉驿). Install the WQY fonts and the default Chinese font of Ubuntu will be changed to WQY automatically.

1
2
3
4
5
6
7
$ apt-cache search wqy
fonts-wqy-microhei - Sans-serif style CJK font derived from Droid
fonts-wqy-zenhei - "WenQuanYi Zen Hei" A Hei-Ti Style (sans-serif) Chinese font
ttf-wqy-microhei - transitional dummy package
ttf-wqy-zenhei - transitional dummy package
xfonts-wqy - WenQuanYi Bitmap Song CJK font for X
$ sudo apt-get install fonts-wqy-microhei fonts-wqy-zenhei ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy

And here is a list of the packages I want to install at the first place after install a new Ubuntu environment besides the WQY fonts:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
curl
vim
git
subversion
meld
rabbitcvs-nautilus
rabbitcvs-cli
rabbitcvs-gedit
unrar
shutter
pidgin
chromium
gthumb
zim
dia
filezilla
audacity
stardict
screenlets

GUI(Compiz) performance issue

I experienced very pool GUI performance issue. Here is the fix(from here and here):

  1. Run the following command to check if the 3D acceleration is enabled or not:
1
2
3
4
5
/usr/lib/nux/unity_support_test -p
# If the result is as follows:
Not software rendered: no
# That means the 3D acceleration is NOT enabled which shoulb be.
# Enable the 3D acceleration at "Virtualbox -> selected VM -> settings -> Display -> Enable 3d Acceleration".

After enabling the 3D acceleration, the performance issue should be resolved. If you want a better performance, do the next step as well.

  1. Config compiz
1
2
3
# Install "compizconfig-settings-manager":
sudo apt-get install compizconfig-settings-manager
# Run it from dash, go to "OpenGL", select "Fast" from the "Texture Filter" dropdown list.

@Added on 2014-05-28

Today I found this problem happened again, I guess the reason is I updated the kernel version yesterday. And I confirm my guess and get the solution from here. I also experienced “clipboard copy problem” and “screen resolution problem” which are also resolved after the following “VirtualBox additions” reinstallation.

I’ve had the same problem since Unity came out, here is the solution that always works for me.

1. Enable 3D acceleration in VirtualBox for the machine

2. Provide adequate video memory

3. Boot the Ubuntu guest

4. ensure kernel headers is installed for your running kernel

5. sudo apt-get install build-essential linux-headers-$(uname -r)

6. Mount vbox additions

7. Install Guest Additions, it should autostart, if not run it from a sudo command prompt

8. sudo ./VBoxLinuxAdditions.run

9. Ensure that the word 'vboxvideo' appears on a line on it's own in /etc/modules

10. Reboot

11. Test with sudo /usr/lib/nux/unity_support_test -p

This ensures the vbox video driver is built correctly and installed for your current running kernel.

Note, if you ever do an apt-get dist-upgrade you will need to repeat this process as your kernel version might change.

@Added on 2014-07-02

This problem happened again more than one month ago. I found it’s a known issue(Ticket #12941) of Virtualbox. I fixed it by installing VBoxGuestAdditions_4.3.13-94438.iso. More details can be found from here.

Disable overlay scrollbars

From here.

1
2
3
4
# Enter following command in terminal to disable overlay scrollbar:
gsettings set com.canonical.desktop.interface scrollbar-mode normal
# If you want to get back overlay bars, enter following command:
gsettings reset com.canonical.desktop.interface scrollbar-mode

Comments