Solarshock
Posts: 3
Joined: Thu Feb 14, 2013 3:56 pm

Project Temp sensor - Pi not installing new Modules

Thu Feb 14, 2013 4:13 pm

Hey guys,

First time posting, but ive been working with my Pi at work now for a couple weeks. Im a complete beginner in most of this (linux, Pi's..etc..) but have experience with circuits. Im building a temperature sensor using an LM75.

I've looked through a couple guides on using a temp sens. through a Pi and I was certain I had got the setup working. (edit:1) - I am using wheezy image.

However:

When attempting to install 2 modules (sudo apt-get install python-smbus and sudo apt-get install lm sensors), both give the same error code:

dpkg: warning: parsing file '/var/lib/dpkg/available' near line 6746 package 'gnupg' :
'depends' field, reference to 'libreadline6':
'>' is obsolete, use '>=' or '>>' instead
dpkg: error: parsing file '/var/lib/dpkg/available' near line 6746 package 'gnupg' :
'depends' field, reference to 'libreadline6': version contains
E: sub-process /usr/bin/dpkg returned an error code (2)

I have tried searching for this error and the problems many times to no avail, I have tried reboots and I have seen a linux user in my workplace, who has not been able to help as of yet (today).

Any help would be greatly appreciated :)
Going to be trying a clean install and seeing if it works then tomorrow.

User avatar
terrycarlin
Posts: 70
Joined: Thu Jun 14, 2012 10:42 pm

Re: Project Temp sensor - Pi not installing new Modules

Thu Feb 14, 2013 9:31 pm

Did you do a

Code: Select all

sudo apt-get update
before your

Code: Select all

sudo apt-get install package
?
The update is pretty much required before each session of installing packages.
It is also wise to do a

Code: Select all

sudo apt-get upgrade
after the update just to keep everything current.
If it ain't broke, take it apart and see how it works.

rocketero
Posts: 64
Joined: Wed Jul 11, 2012 5:45 pm

Re: Project Temp sensor - Pi not installing new Modules

Fri Feb 15, 2013 8:15 am

the problem is that you have a corrupted /var/lib/dpkg/available file, as a result it won't work if you try to do 'sudo apt-get dist-upgrade' or 'sudo apt-get install packagename'

before you do any changes to this file, create a copy (cd /var/lib/dpkg then sudo cp -p available available.backup)

what you have to do then is use vi or nano (sudo nano /var/lib/dpkg/available) and edit the 'available' file and find more unless the line 6746 that this error is talking about and delete the whole entry for that package, in this case 'gnupg' .

After doing that run the command 'sudo dpkg --purge -a' and see if it runs, if it does then it should be fixed and you should be able to install packages.

Solarshock
Posts: 3
Joined: Thu Feb 14, 2013 3:56 pm

Re: Project Temp sensor - Pi not installing new Modules

Fri Feb 15, 2013 12:13 pm

I had a feeling this was the sort of problem. It had been suggested to me by a linux user at work, but he did not know how to sort it. So i will give that a try :) Thank you for the info.

Solarshock
Posts: 3
Joined: Thu Feb 14, 2013 3:56 pm

Re: Project Temp sensor - Pi not installing new Modules

Mon Feb 18, 2013 7:55 am

This issue was resolved by a clean install of the wheezy raspian. Modules now installing correctly.

Return to “Troubleshooting”