Siduction Forum

Siduction Forum => Software - Support => Topic started by: michaa7 on 2015/09/12, 11:31:59

Title: (solved) how did I mess up my database of installed packages?
Post by: michaa7 on 2015/09/12, 11:31:59
I am confused:

my default system (on sdb1) and my experimental system (on sdc1) share the partition with the debian packages archiv on sda8 which is mounted on /var/cache/apt/archives depending on which system is booted. This is how I did it all the years.

Now, yesterday I d-u_ed my experimental system without problems. Today, while my default system is runing, I simulated a d-u. I expected about 1 GB of new packages. But to my surprise it seems apt uses the database of the updated sdc1 system, not sdb1. The d-u would be about 100MB only. Nothing removed. On my experimental system digikam got removed. Here on sdb1 digikam is still usuable,  but apt shows:
Quote
# apt-cache policy digikam
digikam:
  Installiert:           (keine)
  Installationskandidat: 4:4.4.0-1.1+b2
  Versionstabelle:
     4:4.4.0-1.1+b2 0
        500 http://httpredir.debian.org/debian/ unstable/main amd64 Packages
        100 /var/lib/dpkg/status
     4:2.6.0-1+deb7u1 0
        500 http://http.debian.net/debian/ wheezy/main amd64 Packages
which is wrong, obviously.

I am confused about what I did wrong.
Title: Re: how did I mess up my database of installed packages?
Post by: michaa7 on 2015/09/12, 12:30:17
ok, understood.

Both systems not only share sda8 on /var/cache/apt/archives. /var itself is a partition on its own, which I forgott about. I did this to be sure to keep my emails on my lokal mailserver in case I installed a new system.

Now I didn't pay attentention to this fact when I configured my experimental system. When I copied and edited the fstab I forgott about it. Therefore /var/cache/apt/pkgcache.bin  was shared, too.  >:(

So the problem and the reason for it is understood.

Consequenzes:

1)
My experimental system will become my default system, forcibly, because it is the only system with a valid package database. Thanks to god or the Debian maintainers, the d-u went well. I have to live with the fact that digikam will be uninstallable for a while.

2)
Is there a way to recreate the database for my old default system? It's now ready for experiments (after editing the fstab and unmount /var).

shit happens ...
Title: Re: (solved) how did I mess up my database of installed packages?
Post by: dibl on 2015/09/12, 13:56:44
I don't know how you could read your installed package list and then make a database for apt.  But, if you know the approximate date of your last d-u on that system, you could set it to the debian archive repo for that date, and you could come close to a match.
Title: Re: (solved) how did I mess up my database of installed packages?
Post by: musca on 2015/09/12, 15:59:55
dibl, you meant http://snapshot.debian.org/ , didn't you?
Title: Re: (solved) how did I mess up my database of installed packages?
Post by: dibl on 2015/09/12, 17:04:34
dibl, you meant http://snapshot.debian.org/ (http://snapshot.debian.org/) , didn't you?


Yes, sorry that is exactly what I meant.  Thanks!
Title: Re: (solved) how did I mess up my database of installed packages?
Post by: michaa7 on 2015/09/12, 17:23:03
The problem seem to be the files in /var/lib/dpkg/*, specially the status file which can't be recreated easily. Whereas the pkgcache.bin and srcpkgcache.bin could be deleted any time you want.

In this regard live would be much easier if there would be really some old status files, too. The status-old file isn't *old*, it is a duplicate of the current status file and presumably is a fallback file in case the status file gets currupted during an update.

So I give up on this system but keep it alive as is as long as digikam isn't installable on my new system.

Thanks for your suggestions.
Title: Re: (solved) how did I mess up my database of installed packages?
Post by: ralul on 2015/09/12, 23:03:25
Yes, you cannot mix /var/lib/dpkg/
using two installations on that directory :(
Time to learn debootstrap to install on another partition!
Title: Re: (solved) how did I mess up my database of installed packages?
Post by: michaa7 on 2015/09/13, 11:24:31
I don't know how you could read your installed package list and then make a database for apt.  But, if you know the approximate date of your last d-u on that system, you could set it to the debian archive repo for that date, and you could come close to a match.
Although I gave up on this system, out of curiosity, how is this supposed to work?

I set my debian.list to
Quote
#snapshot
deb http://http://snapshot.debian.org/archive/debian/20150731/ unstable main contrib non-free
and disabled all other repos. D-u then wants to install one new package, nothing else.