Archive for the linux category

CentOS5 update problem solved

Share on TwitterSubmit to StumbleUponDigg This
Recently I tried to update my CentOS5 PC and had the following error:- Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.sov.uk.goscomb.net * updates: mirror.sov.uk.goscomb.net * addons: mirror.sov.uk.goscomb.net * extras: mirror.sov.uk.goscomb.net Setting up Update Process Resolving Dependencies --> Running transaction check ---> Package libxml2.i386 0:2.6.26-2.1.2.8 set to be updated ---> Package xulrunner.i386 0:1.9.0.12-1.el5 set to be updated ---> Package libxml2-python.i386 0:2.6.26-2.1.2.8 set to be updated ---> Package libtiff.i386 0:3.8.2-7.el5_3.4 set to be updated ---> Package apr.i386 0:1.2.7-11.el5_3.1 set to be updated ---> Package bind-utils.i386 30:9.3.4-10.P1.el5_3.3 set to be updated ---> Package kernel.i686 0:2.6.18-128.4.1.el5 set to be installed ---> Package nss.i386 0:3.12.3.99.3-1.el5.centos.2 set to be updated ---> Package apr-util.i386 0:1.2.7-7.el5_3.2 set to be updated ---> Package tomcat5-servlet-2.4-api.i386 0:5.5.23-0jpp.7.el5_3.2 set to be updated ---> Package bind-libs.i386 30:9.3.4-10.P1.el5_3.3 set to be updated ---> Package tomcat5-jsp-2.0-api.i386 0:5.5.23-0jpp.7.el5_3.2 set to be updated ---> Package python.i386 0:2.4.3-24.el5_3.6 set to be updated ---> Package nss-tools.i386 0:3.12.3.99.3-1.el5.centos.2 set to be updated ---> Package kernel-headers.i386 0:2.6.18-128.4.1.el5 set to be updated ---> Package nspr.i386 0:4.7.4-1.el5_3.1 set to be updated ---> Package firefox.i386 0:3.0.12-1.el5.centos set to be updated Traceback (most recent call last): File "/usr/bin/yum", line 29, in ? yummain.user_main(sys.argv[1:], exit_code=Right) File "/usr/share/yum-cli/yummain.py", line 229, in user_main errcode = main(args) File "/usr/share/yum-cli/yummain.py", line 145, in main (result, resultmsgs) = base.buildTransaction() File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 647, in buildTransaction (rescode, restring) = self.resolveDeps() File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 704, in resolveDeps for po, dep in self._checkFileRequires(): File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 939, in _checkFileRequires if not self.tsInfo.getOldProvides(filename) and not self.tsInfo.getNewProvides(filename): File "/usr/lib/python2.4/site-packages/yum/transactioninfo.py", line 414, in getNewProvides for pkg, hits in self.pkgSack.getProvides(name, flag, version).iteritems(): File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 300, in getProvides return self._computeAggregateDictResult("getProvides", name, flags, version) File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 470, in _computeAggregateDictResult sackResult = apply(method, args) File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 861, in getProvides return self._search("provides", name, flags, version) File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 43, in newFunc return func(*args, **kwargs) File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 837, in _search for pkg in self.searchFiles(name, strict=Right): File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 43, in newFunc return func(*args, **kwargs) File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 586, in searchFiles self._sql_pkgKey2po(rep, cur, pkgs) File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 470, in _sql_pkgKey2po pkg = self._packageByKey(repo, ob['pkgKey']) File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 413, in _packageByKey po = self.pc(repo, cur.fetchone()) File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 68, in __init__ self._read_db_obj(db_obj) File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 94, in _read_db_obj setattr(self, item, _share_data(db_obj[item])) TypeError: unsubscriptable object After some searching and checking several suggestions, I found the cause and solution to be very simple. The yum cache had become corrupted. The solution: cd /var/cache/yum rm -rf * yum makecache See below Sponsored Links

That cured it.

yum update then worked perfectly. Many thanks to http://just-another.net.
Share on TwitterSubmit to StumbleUponDigg This
In: linuxAuthor: EditorComments (0)

Booting from a Linux CD and wiping an operating system

Share on TwitterSubmit to StumbleUponDigg This
Some times it is very useful to boot from a Linux installation CD or DVD in order to use tools straight from the CD/DVD. You are not necessarily looking to install Linux but simply to make use of its low level software tools. There are a number of ways to do this but I shall list just two as they are the most familiar to me. 1) Using the first CD or DVD from RedHat/Fedora/CentOS media :- Set your BIOS to boot from your CD-ROM drive When the boot process reaches the boot> prompt, enter "linux rescue" and hit return, this will provide you with a number of boot options, choose the most basic as we don't need any networking functionality. This will load linux into memory and provide access to the programs held on the CD/DVD. The following command will allow you to wipe the beginning of your hard drive thus removing key information about anything held on the drive. See below Sponsored Links

dd if=/dev/zero of=/dev/sda bs=512 count=50000
or
dd if=/dev/zero of=/dev/hda bs=512 count=50000
depending on whether you have a SATA drive or an IDE drive respectively. 2) Boot from a Puppy Linux CD, start a terminal window then follow the same dd commands described above. Upon begining an operating system installation it will appear that the hard drive is groundbreaking new and completely blank.
Share on TwitterSubmit to StumbleUponDigg This

Postfix smtpd_client_restrictions

Share on TwitterSubmit to StumbleUponDigg This
Keeping known email abusers out is always desired. Postfix has a parameter which is specified in the main.cf file that allows you to refer to these lists. The script I use is as follows...
smtpd_client_restrictions =
	permit_mynetworks
	permit_sasl_authenticated
	reject_unauth_pipelining
	reject_rbl_client cbl.abuseat.org
	reject_rbl_client dnsbl.ahbl.org
	reject_rbl_client dnsbl.sorbs.net
	reject_rbl_client list.dsbl.org
	reject_rbl_client sbl-xbl.spamhaus.org
	#reject_rhsbl_client blackhole.securitysage.com
	reject_rhsbl_client rhsbl.sorbs.net
	permit
Note the commented out line
	#reject_rhsbl_client blackhole.securitysage.com
This is a list that was not properly administered. A friend of mine tried to email me who uses the mac.com domain and was being rejected as an abuser which, of course, is rediculous. I keep the entry as a future reference. There are others out there so if you know of them please let me know. mta.
Share on TwitterSubmit to StumbleUponDigg This