0

This could be construed as a 'repeat' question but believe me I have tried everything i've seen bar reset the entire server. I am trying very hard to get a virtualenv working for flask so naturally it needs to be installed / used. However pip says I don't have access to it(as root or --user), python3 never seems to exist to be honest I think I would most benefit from just resetting the python to default with the 2.7 and 3.6. But alas that doesn't seem to be an option, so before I restart the server I thought I would ask here. The following is the list of packages that are errors.

Errors were encountered while processing:
 fail2ban
 ufw
 byobu
 landscape-common
 language-selector-common
 sosreport
 iotop
 dh-python
 salt-common
 ssh-import-id
 cloud-init
 software-properties-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

here are some examples (but by no means all, genuinely comes up for everything relevant to python) of what flags up the message :

sudo dpkg --configure -a

sudo apt-get install -f

sudo apt autoremove

As mentioned before I feel like i've exhausted my options, I feel ive tried everything on the internet unless ive been looking in the wrong places.

Any and all help is very much appreciated, been at this for hours, head is banging :P

EDIT 1:

After entering

sudo dpkg --configure -a

I got the error :

dpkg: dependency problems prevent configuration of salt-minion:
 salt-minion depends on salt-common (= 3002.2+ds-1); however:
  Package salt-common is not configured yet.

dpkg: error processing package salt-minion (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: fail2ban ufw byobu landscape-common language-selector-common sosreport iotop dh-python salt-common ssh-import-id cloud-init salt-minion

With the dependency problem repeated for all packaged listed, with some lke fail2ban stating they are in "a very inconsistent state"

Organic Marble
  • 23,641
  • 15
  • 70
  • 122
  • There is no single magic incantation, you must follow the trail and go down the rabbit hole: Since your output claims that Package salt-common is not configured yet, configure it: sudo dpkg configure salt-common. Then read the resulting output, which will determine your next action. – user535733 Feb 24 '21 at 00:02
  • after entering 'sudo dpkg configure salt-common' says error: needs an action option – Calum Reid Feb 24 '21 at 00:07
  • Say, my mistake makes a good test on learning: What did you do right last time you used 'configure' that I did wrong? – user535733 Feb 24 '21 at 00:13
  • Ah, of course, soon as you said that i realized, forgot the '--' before configure, sadly the same result but just for salt-common, returned exit status 127 if that means anything? – Calum Reid Feb 24 '21 at 01:59
  • Well it can't be both "the same result" and "exit status 127" (which means command-not-found). Your previous output did not mention code 127. Please try to provide complete output, not summaries. Remember, you are following a trail. Many steps. – user535733 Feb 24 '21 at 02:07
  • Setting up salt-common (3002.2+ds-1) ... /var/lib/dpkg/info/salt-common.postinst: 6: /var/lib/dpkg/info/salt-common.postinst: py3compile: not found dpkg: error processing package salt-common (--configure): installed salt-common package post-installation script subprocess returned error exit status 127 Errors were encountered while processing: salt-common – Calum Reid Feb 24 '21 at 02:11
  • Thats the full error output from that command, sorry i cant format it in a response – Calum Reid Feb 24 '21 at 02:11
  • And there's the cause clearly stated in your output: py3compile: not found. You need to install (or re-install) the python3-minimal package (and it's dependencies!) for your release of Ubuntu. Since that package is part of every Ubuntu system's base install (except Ubuntu Core), you've really taken a spanner to your system. Folks have fixed worse in one evening. Have you considered what other undiscovered damage might be out there? – user535733 Feb 24 '21 at 02:17

1 Answers1

0

Looks like there's a problem with the package installer on your system. This sort of thing can happen from a failed software installation, or if the installer itself becomes corrupted. Depending on how dpkg broke, there are a few ways to fix it.

Based on how often you're seeing the message, start by reconfiguring the packages that have been unpacked and potentially not installed. An interruption at the wrong time can cause the database to become corrupt:

sudo dpkg --configure -a 

If this does not resolve the issue, update your question to include the error message(s) so that a better solution can be offered