Showing posts with label ltsp. Show all posts
Showing posts with label ltsp. Show all posts

Friday, 6 July 2012

Fix "trying to overwrite '*', which is also in package *"

Today I was updating few stuffs in edubuntu and dpkg was continually throwing me the problem while trying to install kdelibs-data. The error read as "trying to overwrite 'A', which is also in package X" and the fix was pretty straightforward but still I thought it would help someone out there.

Below is the exact error I was getting while trying to install kdelibs5-data from the deb file.

dpkg: error processing /var/cache/apt/archives/
kdelibs5-data_4%3a4.4.5-0ubuntu1.2_all.deb (--unpack):
trying to overwrite '/usr/share/polkit-1/actions
/org.kde.kcontrol.kcmremotewidgets.policy', which is also in package kdebase-runtime-data 4:4.6.5-0ubuntu1

The fix was pretty simple. Add the --force-overwrite switch in the dpkg command as below:

dpkg -i --force-overwrite kdelibs5-data_4.4.5-0ubuntu1.2_all.deb

I hope this comes useful sometimes.


Wednesday, 23 November 2011

Installation of eBarnamala [Content Management For LTSP]

This post is a reference for the future e-library volunteers who perform the installation of the LTSP server. One of the useful softwares within our e-library deployment is the software known as eBarnamala developed by Nepali developer for nepali schools. While the software itself is very useful for students, most of the volunteers have been complaining about the errors while trying to setup this software. However, the installation of eBarnamala can be simply done by following few simple steps. And this is what I'm writing in this post.

First, due to the different versions(the one with which .py was compiled to .pyc and the python interpreter currently installed in the working system), you might face some bad magic number error. FYI, in the UNIX-like system, filetypes are recognized by the first few bytes of the file which is known as magic bytes. Python also puts the same kind of bytes to ensure they are .pyc files and python interpreter checks for the same number while loading .pyc.

To fix our error, lets delete all the .pyc files in eBarnamala folder. The directory might be different but the commands are the same(except the path). The command for this purpose is as below:

find /opt/eBarnamala/ -name *.pyc -exec rm -f {} \;

Now lets recompile all the *.py files in the eBarnamala folder. Write the following lines of code and save it as and later run as "python" without quotes.

import compileall
compileall.compile_dir('/opt/eBarnamala/', force=True)

Now lets write a small shell script and save it in the /bin/ folder as eBarnamala(This is absolutely necessary since you'll face errors regarding the loading of images if you do "python /opt/eBarnamala/").

cd /opt/eBarnamala/ && python

Now you need to copy the fonts from the eBarnamala directory to /usr/share/fonts/truetype.

So you are done. Just create some menu entry or desktop shortcut so that the general users and students can access the software easily. I hope it helps the future e-library volunteers.