Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

On Debian 6 servers dependency issues are preventing me from installing nis (or any package). When I try to resolve that issue I get a python error. How do I get past this issue and re-gain the ability to install packages?

I have googled and found a few people reporting the same error message, but no one had a solution. I also checked SE to no avail. This is affecting 10s of servers at my company.

root 7 # apt-get install nis
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libglib2.0-dev : Depends: libglib2.0-0 (= 2.24.2-1) but 2.40.0-2 is to be installed
 nis : Depends: libdbus-glib-1-2 (>= 0.78) but it is not going to be installed
       Depends: libslp1 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

So then I tried to resolve this by following the suggestion:

root 8 # apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  xfonts-encodings ttf-dejavu-core xfonts-utils libxfont1 libpango1.0-common libdb5.1 libxcb-render-util0
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libglib2.0-dev
Suggested packages:
  libglib2.0-doc
The following packages will be upgraded:
  libglib2.0-dev
1 upgraded, 0 newly installed, 0 to remove and 559 not upgraded.
42 not fully installed or removed.
Need to get 0 B/2642 kB of archives.
After this operation, 3982 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
dpkg: error processing /var/cache/apt/archives/libglib2.0-dev_2.40.0-2_amd64.deb (--unpack):
 parse error, in file '/var/lib/dpkg/tmp.ci/control' near line 7 package 'libglib2.0-dev':
 `Depends' field, invalid package name `python:any': character `:' not allowed (only letters, digits and characters `-+._')
configured to not write apport reports
                                      Errors were encountered while processing:
 /var/cache/apt/archives/libglib2.0-dev_2.40.0-2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

root 9 # 

I also tried

apt-get autoremove

but this just told me to do

apt-get -f install

again.

I tried to look at the offending file but I got this:

root 11 # cat /var/lib/dpkg/tmp.ci/control
/var/lib/dpkg/tmp.ci/control: No such file or directory

As requested:

root 14 # apt-cache policy nis libglib2.0-dev libglib2.0-0 libdbus-glib-1-2 libslp1 
libglib2.0-0:
  Installed: 2.40.0-2
  Candidate: 2.40.0-2
  Version table:
 *** 2.40.0-2 0
        500 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
        100 /var/lib/dpkg/status
libdbus-glib-1-2:
  Installed: (none)
  Candidate: 0.102-1
  Version table:
     0.102-1 0
        500 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libglib2.0-dev:
  Installed: 2.24.2-1
  Candidate: 2.40.0-2
  Version table:
     2.40.0-2 0
        500 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
 *** 2.24.2-1 0
        100 /var/lib/dpkg/status
nis:
  Installed: (none)
  Candidate: 3.17-33
  Version table:
     3.17-33 0
        500 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
libslp1:
  Installed: (none)
  Candidate: 1.2.1-9
  Version table:
     1.2.1-9 0
        500 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages

as requested:

apt-cache policy
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://security.debian.org/ stable/updates/main Translation-en
 500 http://security.debian.org/ stable/updates/main amd64 Packages
     release v=7.0,o=Debian,a=stable,n=wheezy,l=Debian-Security,c=main
     origin security.debian.org
 500 http://ftp.us.debian.org/debian/ unstable/main Translation-en
 500 http://ftp.us.debian.org/debian/ unstable/main amd64 Packages
     release o=Debian,a=unstable,n=sid,l=Debian,c=main
     origin ftp.us.debian.org
Pinned packages:
share|improve this question
    
I suspect you may not be installing stable packages. Can you run apt-cache policy pkgname1 pkgname2... on all the packages mentioned in your question, and then post it in the question? Note that mixing binary packages from testing/unstable with stable will not give good results in general. –  Faheem Mitha Apr 17 at 20:33
    
Faheem, I added the output to the question. I inherited these systems and am trying to get things to work. Is there a way to move everything to stable (short of a complete re-install)? –  MERM Apr 17 at 20:41
    
I think you have enough rep, so hop over to the main unix.sx chatroom and let's talk about it there. Ping me when you are there. –  Faheem Mitha Apr 17 at 20:42
    
Faheem, I need 20 to talk in chat and only have 16 :( –  MERM Apr 17 at 21:00
    
Ok, now you have 21. –  Faheem Mitha Apr 17 at 21:01

1 Answer 1

up vote 3 down vote accepted

This was an interesting one. The poster was trying to fix a machine that was accessible remotely over ssh. This machine had been partially upgraded to unstable, including libc6. However, parts were still on stable, and apt was at the squeeze version. The poster wanted the machine completely on stable.

I walked the poster through fixing his machine. The chat session started at http://chat.stackexchange.com/transcript/message/15047213#15047213

Summary:

  1. The sources.list has only unstable sources. Added stable ones. Also added some stanzas in /etc/apt/preferences to set the priority number
    for testing and unstable to 50.
  2. Upgraded apt to the stable version.
  3. Installed apt-show-versions and ranapt-show-versions | grep unstable to get information about which packages were from unstable.
  4. Removed all unstable packages except libc6.
  5. Commented out unstable sources. NOTE: removing unstable sources before
    running apt-show-versions would have made apt-show-versions unable to tell which packages were from unstable.
  6. Downgraded libc6 from unstable to stable.
  7. Ran apt-get upgrade followed by apt-get dist-upgrade.
  8. Removed 2.6 kernel packages.

Final thoughts: there is probably a better way of spotting which packages are from unstable than using apt-show-versions, but I don't currently know of one. If you do, please comment.

share|improve this answer
    
Faheem - You were a great help and an invaluable resource! –  MERM Apr 19 at 20:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.