-4

When I roll a brand new LXC CT with Ubuntu 21.04, I can't install software-properties-common which is required for apt-add-repository.

On a brand new instance I login as root and run apt update and apt upgrade, then apt install software-properties-common but get this output:

root@kubernetes:~# apt install software-properties-common
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
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:
 software-properties-common : Depends: packagekit but it is not installable
E: Unable to correct problems, you have held broken packages.

root@kubernetes:~# apt install packagekit
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
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:
 libglib2.0-bin : Depends: libglib2.0-0 (= 2.68.1-1~ubuntu21.04.1) but 2.68.0-1 is to be installed
E: Unable to correct problems, you have held broken packages.

Any idea why I can't install this on a brand new instance? Seems kind of messed up.

automaton
  • 115
  • 2
  • 4
  • Does this answer your question? [How do I restore the default repositories?](https://askubuntu.com/questions/124017/how-do-i-restore-the-default-repositories) – N0rbert May 25 '21 at 19:09
  • 1
    On fresh 20.04 LTS running `sudo lxc-create -t download -n ubuntu -- --dist ubuntu --release hirsute --arch amd64` with `sudo lxc-start -n ubuntu -d; sudo lxc-attach -n ubuntu -- sh -c "apt-get update && apt-get install software-properties-common && add-apt-repository -h"` does not lead to any issues. Please edit your question to make it reproducible. – N0rbert May 25 '21 at 19:49
  • 2
    -1: The OP seems to be using the -proposed pocket. That error message is expected behavior when using -proposed. It's for testing, not for normal use. This un-reproducible question (and it's answer below) seem more likely to mislead folks into trying -proposed rather than help them avoid it. – user535733 May 25 '21 at 21:21
  • Does this answer your question? [Unable to correct problems, you have held broken packages](https://askubuntu.com/questions/223237/unable-to-correct-problems-you-have-held-broken-packages) – karel May 26 '21 at 06:57

1 Answers1

-4

Well for anyone else having this problem the solution was to edit /etc/apt/sources.list and the following into it as the only item (comment out everything else):

deb http://archive.ubuntu.com/ubuntu/ hirsute-proposed main

Then run apt update and apt upgrade again to fix libglib2.0-0 package, then restore sources.list back to before (but leave the proposed line) and it will work when trying to install software-properties-common again.

Why you have to do this for a stock installation is really confusing and a terrible user experience.

automaton
  • 115
  • 2
  • 4
  • Very strange idea. You have to understand the current list of repositories. Using proposed is not recommended for end users. Check https://pastebin.com/x6YPa21B for understanding. Such Dockerfile works out the box. – N0rbert May 25 '21 at 19:15