1

I'm working on a Debian 6.0 server where I think the repo was wrong on the server.

deb http://ftp.uk.debian.org/debian/ stable main
deb-src http://ftp.uk.debian.org/debian/ stable main

I compared a new docker image and the correct one seems to be

deb http://archive.debian.org/debian squeeze main
deb http://archive.debian.org/debian squeeze-lts main

Since they were already using the wrong repo I think most packages got updated to a newer version. Now when I try to install build-essentials or libc6-dev, I get that the following error.

What was wrong with the old repo? The distribution entry seems to be "stable" instead of "squeeze" and I wonder what has happened..? what can be done now? I could of course use the old repo but some packages aren't available there OR I could build a new OS instead and use the correct repo. I'm not sure downgrading libc6 is an option...Last time I messed with it I had the OS corrupted.

sudo apt-get install libc6-dev
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:
 libc6-dev : Depends: libc6 (= 2.11.3-4+deb6u11) but 2.19-18+deb8u7 is to be installed
         Depends: libc-dev-bin (= 2.11.3-4+deb6u11) but it is not going to be installed
E: Broken packages

sudo apt-cache madison libc6
 libc6 | 2.11.3-4+deb6u11 | http://archive.debian.org/debian/ squeeze-lts/main amd64 Packages
 libc6 |   2.11.3-4 | http://archive.debian.org/debian/ squeeze/main amd64 Packages

1 Answer 1

0

Issue at Hand

As you are aware your sources.list was set to pull from stable and not squeeze. Thus you upgraded your packages and created FrankenDebian. This can be fixed, hopefully you did not run another apt upgrade or anything like that since.

Solution

So first, you will want to rollback any updates. I found this stack exchange post which could help in rolling back your changes. Run the following command as root(sudo):

apt-get -s install $(apt-history rollback | tr '\n' ' ')

If this works, then you can remove the -s option. As noted by other users in the comments of that post you may need to add a script or use awk instead. This should roll you back to a previous state. Here is another link to a site offering a guide on how to rollback. I will also include a link to the Official Debian Wiki on rolling back packages. I suggest you read through these links carefully and decide what works best for yourself before running any commands.

After you have rolled back all of the bad packages you need to fix your sources.list.

Following the guidelines outlined on the Debian Wiki your sources.list for a Debian 6.0 system should look something like this:

deb http://archive.debian.org/debian/ squeeze main 
deb-src http://archive.debian.org/debian/ squeeze main 

deb http://archive.debian.org/debian-security/ squeeze/updates main 
deb-src http://archive.debian.org/debian-security/ squeeze/updates main 

After making these changes run apt update and if you get an error about missing gpg keys run apt install debian-archive-keyring then apt update. For this section, I referenced this blog post. Again, review the links carefully before taking any actions.

Conclusion

From here you should have a working Debian Squeeze system. Please comment if you have any questions or issues with this answer. I appreciate feedback to correct any misconceptions and to improve my posts. I can update my answer as needed.

Best of Luck!

You must log in to answer this question.