LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-18-2018, 09:07 AM   #16
jvermeulen
Member
 
Registered: Nov 2014
Posts: 91

Original Poster
Rep: Reputation: Disabled

Hello,

I didn't know about LC_ALL=c...I will remember that.

jvermeulen@jvermeulen:~/Downloads$
Code:
LC_ALL=c sudo sudo dpkg --purge --force-all PackageX
dpkg: warning: overriding problem because --force enabled:
dpkg: warning: package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
(Reading database ... 278235 files and directories currently installed.)
Removing PackageX (3.0.2.1.el7-2) ...
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (c)
userdel: user 'xxx' does not exist
dpkg: error processing package packageX (--purge):
 subprocess installed post-removal script returned error exit status 6
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Errors were encountered while processing:
 PackageX
 
Old 07-18-2018, 09:10 AM   #17
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Thanks. Do you have the original deb file so that you can reinstall this package? Normally, --force-all should take care of business, so you could try doing as it advises (although you might find that subsequently trying to uninstall it triggers the same post-removal script error, but we'll cross that bridge if/when we come to it).
 
Old 07-18-2018, 09:18 AM   #18
jvermeulen
Member
 
Registered: Nov 2014
Posts: 91

Original Poster
Rep: Reputation: Disabled
Hello,

jvermeulen@jvermeulen:~/Downloads$
Code:
LC_ALL=c sudo dpkg -i --force-all packageX_3.0.2.1.el7-2_amd64.deb
Selecting previously unselected package packageX.
(Reading database ... 278236 files and directories currently installed.)
Preparing to unpack packageX_3.0.2.1.el7-2_amd64.deb ...
Unpacking packageX (3.0.2.1.el7-2) over (3.0.2.1.el7-2) ...
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (c)
userdel: user 'xxx' does not exist
dpkg: warning: subprocess old post-removal script returned error exit status 6
dpkg: trying script from the new package instead ...
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (c)
userdel: user 'xxx' does not exist
dpkg: error processing archive packageX_3.0.2.1.el7-2_amd64.deb (--install):
 subprocess new post-removal script returned error exit status 6
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (c)
userdel: user 'xxx' does not exist
dpkg: error while cleaning up:
 subprocess new post-removal script returned error exit status 6
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Processing triggers for desktop-file-utils (0.23-1) ...
Processing triggers for mime-support (3.60) ...
Errors were encountered while processing:
 packageX_3.0.2.1.el7-2_amd64.deb
But then trying to remove it indeed gives same EM...

greetings, J.
 
Old 07-18-2018, 09:26 AM   #19
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
It doesn't appear to have installed correctly anyway.

Is there any chance that you could paste the post-removal script on here so that I can have a look? If you don't know how to access this then let me know.
 
Old 07-18-2018, 09:48 AM   #20
jvermeulen
Member
 
Registered: Nov 2014
Posts: 91

Original Poster
Rep: Reputation: Disabled
Hello,

I have to admit I don't know where to find that....
 
Old 07-18-2018, 09:59 AM   #21
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Ok. You can first extract the package's control files with:

Code:
dpkg -e packageX_3.0.2.1.el7-2_amd64.deb
This will create a DEBIAN subdirectory in the current directory. In that subdirectory, you will find the control files, including postrm which is the post-removal script.

By the way, is this you commenting here? ...

Last edited by hydrurga; 07-18-2018 at 10:07 AM.
 
Old 07-18-2018, 10:04 AM   #22
jvermeulen
Member
 
Registered: Nov 2014
Posts: 91

Original Poster
Rep: Reputation: Disabled
Hello,

same last name, but it isn't me. I'm not on Stackoverflow.
This is the first time I have an apt-issue. Before I've always worked with rpm disto's.
 
Old 07-18-2018, 10:06 AM   #23
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by jvermeulen View Post
Hello,

same last name, but it isn't me. I'm not on Stackoverflow.
This is the first time I have an apt-issue. Before I've always worked with rpm disto's.
No problem. Quite a coincidence. Anyway, back to the issue at hand... (I'll remove the link above so as not to distract too much)
 
Old 07-18-2018, 10:25 AM   #24
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
I am not sure if it confuses apt if a post install script has an error while removing. After all the package has been removed. I mean would apt set the package to partially installed or removed if the postrm script returns an error.

If it does, two workarounds: create user 'xxx' or edit the postrm script to force to return OK after running userdel. It is BTW a questionable policy to return an error on something which already has been completed. If the script want to delete a user which does not exist that is not an error.

jlinkels
 
1 members found this post helpful.
Old 07-18-2018, 10:30 AM   #25
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by jlinkels View Post
I am not sure if it confuses apt if a post install script has an error while removing. After all the package has been removed. I mean would apt set the package to partially installed or removed if the postrm script returns an error.

If it does, two workarounds: create user 'xxx' or edit the postrm script to force to return OK after running userdel. It is BTW a questionable policy to return an error on something which already has been completed. If the script want to delete a user which does not exist that is not an error.

jlinkels
Good advice, What I'm hoping to do for the OP is repackage the original package but with a modified or blank postrm file - that will be easy to do and should solve the problem. The package hasn't actually been removed, it has been "half removed". We're down at dpkg level by the way, rather than at apt level.
 
Old 07-18-2018, 10:41 AM   #26
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Quote:
Originally Posted by hydrurga View Post
We're down at dpkg level by the way, rather than at apt level.
Yes, I know. But it is dpkg which sets the package installed status. IIRC apt calls dpkg for installing or removing packages, but apt does much more in terms of dependency management.

jlinkels
 
Old 07-19-2018, 02:43 AM   #27
jvermeulen
Member
 
Registered: Nov 2014
Posts: 91

Original Poster
Rep: Reputation: Disabled
Hello All,

I think adding user xxx solved the problem.
After adding user:

Code:
jvermeulen@jvermeulen:~$ id xxx
UID=1001(xxx) GID=1001(xxx) groepen=1001(xxx)
jvermeulen@jvermeulen:~$ LC_ALL=c sudo sudo dpkg --purge --force-all packageX
dpkg: warning: overriding problem because --force enabled:
dpkg: warning: package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
(Reading database ... 278234 files and directories currently installed.)
Purging configuration files for packageX (3.0.2.1.el7-2) ...
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (c)
After that I can update/upgrade again, use apt in a normal way!
Thanks for the help, I learned a lot.
J.
 
Old 07-19-2018, 03:24 AM   #28
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by jvermeulen View Post
Hello All,

I think adding user xxx solved the problem.
After adding user:

Code:
jvermeulen@jvermeulen:~$ id xxx
UID=1001(xxx) GID=1001(xxx) groepen=1001(xxx)
jvermeulen@jvermeulen:~$ LC_ALL=c sudo sudo dpkg --purge --force-all packageX
dpkg: warning: overriding problem because --force enabled:
dpkg: warning: package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
(Reading database ... 278234 files and directories currently installed.)
Purging configuration files for packageX (3.0.2.1.el7-2) ...
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (c)
After that I can update/upgrade again, use apt in a normal way!
Thanks for the help, I learned a lot.
J.
Great to hear. jlinkels' solution was less convoluted than mine was to have been. Nice one.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] No package 'x11' found No package 'xext' found No package 'xdamage' found No package 'xfixes' found No package 'x11-xcb' found Jigsaw Linux From Scratch 14 02-23-2021 08:35 PM
E:Package Not found:The error i get on :sudo apt-get install kde phpserver Ubuntu 2 02-14-2009 02:14 PM
Using Package Archive style package management mugwump84 Linux From Scratch 3 08-25-2005 05:19 PM
How to setup own apt archive palanisaravanan Debian 5 02-21-2004 09:37 AM
installing an unstable package from debian's online package archive ganninu Debian 13 11-07-2003 03:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 11:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration