Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] apt packages cannot be installed due to missing dependencies #53

Closed
1 task done
kykc opened this issue Jan 3, 2024 · 9 comments · Fixed by #67
Closed
1 task done

[BUG] apt packages cannot be installed due to missing dependencies #53

kykc opened this issue Jan 3, 2024 · 9 comments · Fixed by #67

Comments

@kykc
Copy link

kykc commented Jan 3, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

In its current state packages cannot be installed using apt.

Expected Behavior

Being able to install packages inside the container or extending Dockerfile

Steps To Reproduce

  1. Create Dockerfile
FROM lscr.io/linuxserver/unifi-network-application:8.0.24
RUN apt update && apt install -y net-tools
  1. Run docker build .

Environment

- OS: Ubuntu 22.04
- Docker service was installed used official repo from https://docs.docker.com/engine/install/ubuntu/

CPU architecture

x86-64

Docker creation

docker build .

Container logs

> [2/2] RUN apt update && apt install -y net-tools:
0.318
0.318 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
0.318
0.583 Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
1.256 Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
1.425 Get:3 http://archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
1.593 Get:4 http://archive.ubuntu.com/ubuntu jammy/main Sources [1,668 kB]
2.172 Get:5 http://archive.ubuntu.com/ubuntu jammy/restricted Sources [28.2 kB]
2.172 Get:6 http://archive.ubuntu.com/ubuntu jammy/multiverse Sources [361 kB]
2.346 Get:7 http://archive.ubuntu.com/ubuntu jammy/universe Sources [22.0 MB]
3.484 Get:8 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
3.490 Get:9 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
3.492 Get:10 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
4.482 Get:11 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1,792 kB]
4.508 Get:12 http://archive.ubuntu.com/ubuntu jammy-updates/main Sources [577 kB]
4.517 Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/restricted Sources [63.0 kB]
4.518 Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse Sources [21.0 kB]
4.518 Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/universe Sources [375 kB]
4.602 Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1,305 kB]
4.662 Get:17 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [49.8 kB]
4.663 Get:18 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [1,602 kB]
4.720 Get:19 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1,599 kB]
4.812 Get:20 http://archive.ubuntu.com/ubuntu jammy-security/main Sources [303 kB]
4.824 Get:21 http://archive.ubuntu.com/ubuntu jammy-security/multiverse Sources [11.3 kB]
4.825 Get:22 http://archive.ubuntu.com/ubuntu jammy-security/restricted Sources [60.2 kB]
4.828 Get:23 http://archive.ubuntu.com/ubuntu jammy-security/universe Sources [221 kB]
4.836 Get:24 http://archive.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [44.0 kB]
4.840 Get:25 http://archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages [1,326 kB]
4.918 Get:26 http://archive.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [1,046 kB]
4.960 Get:27 http://archive.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [1,572 kB]
5.478 Fetched 54.4 MB in 5s (10.6 MB/s)
5.478 Reading package lists...
6.027 Building dependency tree...
6.125 Reading state information...
6.136 18 packages can be upgraded. Run 'apt list --upgradable' to see them.
6.140
6.140 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
6.140
6.179 Reading package lists...
6.721 Building dependency tree...
6.817 Reading state information...
6.821 You might want to run 'apt --fix-broken install' to correct these.
6.821 The following packages have unmet dependencies:
6.871  unifi : Depends: mongodb-server (>= 1:3.6.0) but it is not installable or
6.871                   mongodb-10gen (>= 3.6.0) but it is not installable or
6.871                   mongodb-org-server (>= 3.6.0) but it is not installable
6.871          Depends: mongodb-server (< 1:5.0.0) but it is not installable or
6.871                   mongodb-10gen (< 5.0.0) but it is not installable or
6.871                   mongodb-org-server (< 5.0.0) but it is not installable
6.874 E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Copy link

github-actions bot commented Jan 3, 2024

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@kykc
Copy link
Author

kykc commented Jan 3, 2024

Obviously caused by this

One of the possible solutions would be to force-overwrite dpkg/status as mentioned here. This is rather crude and invasive, of course. Other option would be to edit deb package itself and erase mongodb dependency prior to installation.

@j0nnymoe
Copy link
Member

j0nnymoe commented Jan 3, 2024

You should be able to bypass that missing package by adding --ignore-missing when running apt.

@j0nnymoe
Copy link
Member

j0nnymoe commented Jan 3, 2024

Also, worth mentioning you don't need to create a dockerfile just to add in net-tools when we have this: https://github.com/linuxserver/docker-mods/tree/universal-package-install

@thespad
Copy link
Member

thespad commented Jan 3, 2024

All of the available options are bad, but it's unfortunately the way they package the software and the way apt operates.

@kykc
Copy link
Author

kykc commented Jan 3, 2024

You should be able to bypass that missing package by adding --ignore-missing when running apt.

Sadly, no luck

root@2c73653608eb:/usr/lib/unifi# apt install --ignore-missing -y net-tools
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 unifi : Depends: mongodb-server (>= 1:3.6.0) but it is not installable or
                  mongodb-10gen (>= 3.6.0) but it is not installable or
                  mongodb-org-server (>= 3.6.0) but it is not installable
         Depends: mongodb-server (< 1:5.0.0) but it is not installable or
                  mongodb-10gen (< 5.0.0) but it is not installable or
                  mongodb-org-server (< 5.0.0) but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

@kykc
Copy link
Author

kykc commented Jan 3, 2024

FYI deb package dependency on mongodb-server can be amended prior to installation of the package during image build like this:

RUN mkdir /tmp/control
RUN ar -p /tmp/unifi.deb control.tar.gz | tar -xvz -C /tmp/control
RUN sed -i '/^ mongodb-server/d' /tmp/control/control
RUN tar -cvzf /tmp/control.tar.gz -C /tmp/control .
RUN ar -r /tmp/unifi.deb /tmp/control.tar.gz

@LinuxServer-CI
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@thespad
Copy link
Member

thespad commented Feb 4, 2024

Looking to try and fix this by installing from their zip bundle rather than deb repo package in #67. We don't want to screw with the deb package to edit the deps because it's liable to break unexpectedly in the future.

You're welcome to test once the PR build finishes and see if it works properly for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants