The following packages have unmet dependencies

I have this problem too. using the nextcloud pi image for raspberry pi

feel like at some point the installer removed certbot and installed letsencrypt and the dependency issues started.

I delete the image and I download the last image (january 2019) and I install him without errors

After a little more investigation on the dependencies it looks like the version of some of the python dependencies are a little newer than the package manager is calling for. I will send ncp-report when I figure out how to copy it out of nano. My cert is going to expire so I’m hoping to get this figured out.

<–! Paste this in GitHub report -->

NextCloudPi diagnostics

NextCloudPi version  v1.6.1
NextCloudPi image    NextCloudPi_10-05-18
distribution         Raspbian GNU/Linux 9 \n \l
automount            no
USB devices          none
datadir              /var/www/nextcloud/data
data in SD           yes
data filesystem      ext2/ext3
data disk usage      5.5G/30G
rootfs usage         5.5G/30G
swapfile             /var/swap
dbdir                /var/lib/mysql
Nextcloud check      ok
Nextcloud version
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
Postfix service      up
internet check       ok
port check 80        open
port check 443       open
IP                   ***REMOVED SENSITIVE VALUE***
gateway              ***REMOVED SENSITIVE VALUE***
interface            eth0
certificates         ***REMOVED SENSITIVE VALUE***
NAT loopback         no
uptime               2days

Nextcloud configuration

    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "localhost",
            "5": "nextcloudpi.local",
            "7": "nextcloudpi",
            "8": "nextcloudpi.lan",
            "1": "zzzzzzzzzzz",
            "4": "zzzzzzzzzzzzzzzz",
            "3": "zzzzzzzzzzzzzzzzzzzzzzzz",
            "11": "zzzzzzzzzzzzzzzzzzzzzzzzzz"
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "",
        "overwrite.cli.url": "https:\/\/\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        "mail_smtpmode": "sendmail",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "overwriteprotocol": "https",
        "loglevel": "2",
        "log_type": "file",
        "maintenance": false

HTTPd logs

[Wed Feb 13 06:25:03.371370 2019] [ssl:warn] [pid 859:tid 1995592064] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Wed Feb 13 06:25:04.001153 2019] [mpm_event:notice] [pid 859:tid 1995592064] AH00489: Apache/2.4.25 (Raspbian) OpenSSL/1.0.2q configured -- resuming normal operations
[Wed Feb 13 06:25:04.001306 2019] [core:notice] [pid 859:tid 1995592064] AH00094: Command line: '/usr/sbin/apache2'

Database logs

Nextcloud logs

{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:06:50+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Move .step file of updater to backup location","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:06:50+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Fix potential broken mount points","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:06:50+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::info: Repair info: No mounts updated","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:06:50+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Repair invalid paths in file cache","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:06:50+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Add log rotate job","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:06:50+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Clear frontend caches","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:06:50+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::info: Repair info: Image cache cleared","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:06:56+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::info: Repair info: SCSS cache cleared","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:06:58+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::info: Repair info: JS cache cleared","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:06:58+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Clear every generated avatar on major updates","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:06:58+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Add preview background cleanup job","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:06:58+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Queue a one-time job to cleanup old backups of the updater","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:06:58+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Repair pending cron jobs","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:06:58+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::info: Repair info: No need to repair pending cron jobs.","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:06:58+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Extract the vcard uid and store it in the db","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:06:58+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::startCheckCodeIntegrity: Starting code integrity check...","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:07:46+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::finishedCheckCodeIntegrity: Finished code integrity check","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:07:46+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::updateEnd: Update successful","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:07:46+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::maintenanceDisabled: Turned off maintenance mode","userAgent":"--","version":""}
{"reqId":"AW795tvCorYdrtGkiYxs","level":1,"time":"2019-02-11T00:07:46+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::resetLogLevel: Reset log level to Warning(2)","userAgent":"--","version":""}

yeah you are going to have to solve the dependency situation. Maybe ask in the certbot forums, or try apt-get upgrade first or similar.

Thx I thought about apt upgrade but it didn’t look like that was going to update any of the packages that are causing the issue. I will try that and also hit up the forums. If I figure it out I will post solution here for others who might have the issue.

I run NCP on an OdroidHC2 for quite some time now with no issues at all. Since one of the latest NCP updates (auto-update confgured), I have the same issue and letsencrypt cannot renew the certificate

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:
python-dev : Depends: libpython-dev (= 2.7.13-2) but it is not going to be installed
Depends: python2.7-dev (&gt;= 2.7.13-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Unfortuantely I don’t know how to resolve this. “apt-get upgrade” didn’t do the job. If anyone can help me I would be very grateful!

You could try:

apt-get -f install

i already did without success.
Also with apt-get upgrade & apt-get update no success… :frowning:

Do you have backups?
If so, could just do a fresh install and upgrade, then restore config and data.
Had something similar on a rpi3B+ and thats what I ended up doing.

surely this would be an option and might be worthwhile… I had hoped I could avoid this.
No other ideas?
Just came accross someone stating re-installing with aptitude instead of apt-get might solve, as this was “more intelligent”… unfortunately I would not be sure which packages to re-install with the error messages given…

Edit: There is another entry I had missed mentioning:
python set to manually installed.
Maybe this is the reason? Can I correct that soomehow (without freshly installing the entire thing)?

I have just tried with re-insalling python and libpython-dev with aptitude and this solved the issues, as it allowed to explicitely downgrade to 2.7.13-2 while 2.7.15 was already installed partly… now all is on same version and works fine.


Thanks I will try this

aptitude to the rescue! that’s right didn’t think about that but it’s not the first time it is better than apt at fixing this kind of stuff

thanks for sharing

confirming that this worked for me also. Thanks tjohs and thanks nachoparker.

Thanks for sharing! :sunglasses:
I had no idea aptitude could fix this.

I have the same Problem.
Sorry, that I’m not so good at the command line tool.
Which commands I have to enter in the command line tool to fix this issu? How can I downgrade the packages?

sudo aptitude reinstall python 2.7.13-2
sudo aptitude reinstall libpython-dev 2.7.13-2

??? Its not working… I know I’m the problem

if you use sudo aptitude install python (if this is the package that is actually stated in your error report) you should be presented with an information about the versions currently installed and if which one you want to downgrade. Just follow the details instructions.
I think I had used sudo aptitude install libpython-dev and aptitude resolved all unmet dependencies.

Thanks!!! :slight_smile:

sudo aptitude install python

sudo aptitude install libpython-dev
DON’T accep the first solution!

 Keep the following packages at their current version:
  1. libpython-dev [Not Installed]
  2. libpython2.7-dev [Not Installed]

Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

 Downgrade the following packages:
  1. libpython2.7 [2.7.15-4 (now) -> 2.7.13-2+deb9u3 (stable)]
  2. libpython2.7-minimal [2.7.15-4 (now) -> 2.7.13-2+deb9u3 (stable)]
  3. libpython2.7-stdlib [2.7.15-4 (now) -> 2.7.13-2+deb9u3 (stable)]
  4. python2.7 [2.7.15-4 (now) -> 2.7.13-2+deb9u3 (stable)]
  5. python2.7-minimal [2.7.15-4 (now) -> 2.7.13-2+deb9u3 (stable)]

Accept this solution? [Y/n/q/?] y