Hi again, and thanks for the question.
Since my Request for Clarification answered your question, and you
fixed the problem, what I'm going to do here is summarize the
problem, describe two possible solutions (one of which is the one you
used), and give a few tips on searching for this type of
information. Since your problem is solved, the summary and
solutions are largely for the benefit of others who may have this
problem in the future.
PROBLEM SUMMARY
Redhat 7.1 (Seawolf) is shipped with Python 1.5.2, and--as of this
writing--Redhat hasn't offered an upgrade for Python. Upgrading
Python to a newer version (e.g., 2.2) won't create any conflicts
with the Python libraries themselves because they are installed in
a directory which contains the Python version in its name. For
example, the Python 1.5 libraries are installed under
/usr/lib/python1.5 while the Python 2.2 libs are installed under
/usr/lib/python2.2.
The problem comes with the Python binary. The original Python RPM
installs the interpreter as /usr/bin/python and /usr/bin/python1.5
(these are both hard links to the same inode--you can run the
'stat' command to verify this). If your new Python package
overwrites /usr/bin/python, then all of your Python scripts will
be running under the new version of Python.
Redhat's up2date utility is a python script which requires a
module named 'rpm' that comes packaged with the rpm-python RPM.
Since rpm-python installs the module under
/usr/lib/python1.5/site-packages, if your python binary is not
1.5, the interpreter won't be able to locate the 'rpm' module.
SOLUTION
Here are two ways to fix this problem:
1) Create a link so that /usr/bin/python and /usr/bin/python1.5
point to the same file again.
If you don't already have a file called python2 under /usr/bin,
then rename python to python2:
# mv /usr/bin/python /usr/bin/python2
If there is already a python2 (or python2.2, etc) then remove
/usr/bin/python:
# rm /usr/bin/python
Now, create the link (note that this creates a hard link and not a
symbolic link):
# ln /usr/bin/python1.5 /usr/bin/python
The problem with this solution, is that it may break scripts which
rely on your newer version of Python just like up2date is broken
by upgrading Python.
2) Change the "shebang" at the top of /usr/sbin/up2date.
Open /usr/sbin/up2date in your favorite text editor and change the
path on the first line to /usr/bin/python1.5. (Note that there is
also a /usr/bin/up2date which is a symlink to
/usr/bin/consolehelper--be sure to edit the one under /usr/sbin.)
This solution has disadvantages too: you must remember to change
the shebang again if you ever upgrade up2date; you may find that
some other system programs are broken as well, so you may have to
apply this fix to more than one script.
Additional Links:
Redhat maintains a number of Redhat-related mailing lists:
https://listman.redhat.com/mailman/listinfo/
Geocrawler maintains archives of LOTS of mailing lists:
http://geocrawler.com/
SEARCH TIPS
The Redhat mailing lists provide a wealth of information, and they
are archived in a number of different places, but most of the
archives are not in a format which is easily searched. If you do
a simple Google search, you'll probably end up with a lot of
duplicate messages from various list archives. For example, when
researching this question, I performed some of the following
Google searches:
This search will return duplicate messages from various list
archives:
"no module named rpm"
://www.google.com/search?q=%22no%20module%20named%20rpm%22&sourceid=opera&num=0
This narrows the search to one archive site:
site:listman.redhat.com "no module named rpm"
://www.google.com/search?hl=en&lr=&ie=ISO-8859-1&q=site%3Alistman.redhat.com+%22no+module+named+rpm%22&btnG=Google+Search
You can limit your search of listman.redhat.com to the
seawolf-list archives by using the "inurl" operator:
site:listman.redhat.com inurl:seawolf-list upgrade up2date python rpm
://www.google.com/search?hl=en&lr=&ie=ISO-8859-1&q=site%3Alistman.redhat.com+inurl%3Aseawolf-list+upgrade+up2date+python+rpm&btnG=Google+Search
Of course, you can also eliminate list archive sites to help
narrow the search:
"no module named rpm" -site:listman.redhat.com -site:geocrawler.com
://www.google.com/search?hl=en&lr=&ie=ISO-8859-1&q=%22no+module+named+rpm%22+-site%3Alistman.redhat.com+-site%3Ageocrawler.com+&btnG=Google+Search
These features are also helpful for searching the Geocrawler
archives.
I hope you've found some useful information in this posting in
addition to the info in my Request for Clarification.
Best wishes,
bikerman-ga |