Somehow part of my ext3 file system got corrupted and large portions of my python installation got all sorts of messed up. The only thing I could notice immediately was Python raising a missing module error. If I tried to cd to the relevant directories I got this:
EXT3-fs error (device mmcblk0p2): htree_dirblock_to_tree: bad entry in directory #444159: directory entry across blocks - offset=0, inode=166100, rec_len=59284, name_len=255 EXT3-fs error (device mmcblk0p2): htree_dirblock_to_tree: bad entry in directory #444137: rec_len % 4 != 0 - offset=0, inode=290535, rec_len=39605, name_len=253
So I decided to just rm -rf those directories and reinstall NumPy. Not so fast:
root@napajohn:/usr/lib/pyshared/python2.6/numpy-1.6.0# python setup.py Running from numpy source directory.Traceback (most recent call last): File "setup.py", line 196, in <module> setup_package() File "setup.py", line 173, in setup_package from numpy.distutils.core import setup File "/usr/lib/pyshared/python2.6/numpy-1.6.0/numpy/distutils/__init__.py", line 7, in <module> import ccompiler File "/usr/lib/pyshared/python2.6/numpy-1.6.0/numpy/distutils/ccompiler.py", line 7, in <module> from distutils.ccompiler import * File "/usr/lib/python2.6/distutils/__init__.py", line 1 d__2); ^ SyntaxError: invalid syntax
What that error said was true. The file /usr/lib/python2.6/distutils/__init__.py started mid-expression, as if the top half of the file got chopped off.
So I go and check to see if I have any other versions of Python installed with
File "/usr/lib/python2.6/ConfigParser.py", line 1 .i, ^ SyntaxError: invalid syntax
What is happening to all my files? I realize this question could hardly be answered without extra information, but before I go that route let me switch contexts to my first alternative solution which naively assumes that nothing else besides python has been affected.
First, a question: where is the "proper" place to install additional software, or more specifically, Python? I've been choosing /opt for most of my unzipping & installing of things I don't download through apt.
Next, the problem:
root@napajohn:/opt/python/Python-2.7.3# ./configure checking for --enable-universalsdk... no checking for --with-universal-archs... 32-bit checking MACHDEP... linux2 checking EXTRAPLATDIR... checking machine type as reported by uname -m... armv7l checking for --without-gcc... no checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/opt/python/Python-2.7.3': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details
I don't have gcc?? Okay, whatever, I'll go install it. I run an update and then
root@napajohn:/opt/python/Python-2.7.3# apt-get install gcc-4.4 Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: gcc-4.4 : Depends: gcc-4.4-base (= 4.4.5-8) but 4.4.5-8em1 is to be installed Depends: cpp-4.4 (= 4.4.5-8) but 4.4.5-8em1 is to be installed Recommends: libc6-dev (>= 2.5) but it is not going to be installed E: Broken packages
But I have gcc-4.4-base and cpp-4.4!
root@napajohn:/opt/python/Python-2.7.3# apt-get install gcc-4.4-base Reading package lists... Done Building dependency tree Reading state information... Done gcc-4.4-base is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded. root@napajohn:/opt/python/Python-2.7.3# apt-get install cpp-4.4 Reading package lists... Done Building dependency tree Reading state information... Done cpp-4.4 is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
After doing some searching, I think this could potentially be caused by a release mismatch (terminology?).
I'm not really sure where to go from here. Also there is the bigger question of whether the file problems are isolated to Python. Should I run an
fsck disk check on the rootfs? How would I do this on an embedded device?
root@napajohn:/opt/python/Python-2.7.3# cat /etc/debian_version 6.0.4 root@napajohn:/opt/python/Python-2.7.3# df Filesystem 1K-blocks Used Available Use% Mounted on tmpfs 250876 0 250876 0% /lib/init/rw udev 10240 156 10084 2% /dev tmpfs 250876 0 250876 0% /dev/shm rootfs 7597856 1722208 5489688 24% /