D
D
Dmitry Kinash2014-10-05 13:32:16
linux
Dmitry Kinash, 2014-10-05 13:32:16

Where does apt store its data? Or how to correctly remove a package with errors in the prerm trigger?

When updating one of the packages along the dependency chain, it was necessary to update python-minimal, but this action causes an error. Now any operation with apt-get causes a message about unresolved dependencies and a suggestion to use apt-get -f install . But that doesn't help either:
The following packages will be upgraded:
python-minimal
1 upgraded, 3 newly installed, 0 to remove and 382 not upgraded.
21 not fully installed or removed.
Need to get 0 B/119 kB of archives.
After this operation, 865 kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
(Reading database ... 73348 files and directories currently installed.)
Preparing to replace python-minimal 2.7.2-7ubuntu2 (using .../python-minimal_2.7.3-0ubuntu2.2_amd64.deb) ...
find: invalid predicate `-delete'
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
find: invalid predicate `-delete'
dpkg: error processing /var/cache/apt/archives/python-minimal_2.7.3-0ubuntu2.2_amd64.deb ( --unpack):
subprocess new pre-removal script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/python-minimal_2.7.3-0ubuntu2.2_amd64.deb
E: Sub-process /usr/ bin/dpkg returned an error code (1)

In the package mentioned in the error, I found in the trigger before removing the package the line: I didn’t understand the find command very well, but the manuals mentioned changing the removal behavior with updating the findutils version (I currently have version 4.4.2-1ubuntu3). But this is not very important, since I already deleted *.pyc myself. Now I just need to remove this trigger from the package. I unpacked the contents of the package with " dpkg -x ... ... " and " dpkg -e ... . Next, I threw the finished profiled package into /var/cache/apt/archives/ and checked in the MC view mode that everything was in order there. Ran apt-get -f install
find /usr/share/python/ -name '*.py[oc]' -delete
and got the same error again. I went to look in the apta cache - but there is not my package, but the original one with errors came from somewhere.
Question: Where are packages stored before they are placed in /var/cache/apt/archives/ ?
Or tell me other ways to fix the broken python-minimal package ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Chistyakov, 2014-10-05
@Dementor

prerm scripts are stored separately in unpacked form, as far as I remember.
Try using strace to see where exactly the prerm script is run from.
Upd: they are stored in /var/lib/dpkg/info/.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question