cirosantilli / linux-kernel-module-cheat

The perfect emulation setup to study and develop the Linux kernel v5.4.3, kernel modules, QEMU, gem5 and x86_64, ARMv7 and ARMv8 userland and baremetal assembly, ANSI C, C++ and POSIX. GDB step debug and KGDB just work. Powered by Buildroot and crosstool-NG. Highly automated. Thoroughly documented. Automated tests. "Tested" in an Ubuntu 24.04 host.
https://cirosantilli.com/linux-kernel-module-cheat
GNU General Public License v3.0
4.21k stars 605 forks source link

"./build --arch aarch64 --download-dependencies qemu-buildroot" apt install fails with "E: Unable to correct problems, you have held broken packages" in Ubuntu 18.04 #111

Closed rootkiter closed 4 years ago

rootkiter commented 4 years ago
$ ./build --arch aarch64 --download-dependencies qemu-buildroot
+ sudo apt-get update
Hit:1 http://cn.archive.ubuntu.com/ubuntu bionic InRelease
Reading package lists... Done
+ sudo apt-get install \
  bash \
  bc \
  binutils \
  bison \
  build-essential \
  bzip2 \
  cpio \
  flex \
  g++ \
  g++-aarch64-linux-gnu \
  g++-arm-linux-gnueabihf \
  gcc \
  gcc-aarch64-linux-gnu \
  gcc-arm-linux-gnueabihf \
  git \
  graphviz \
  gzip \
  libelf-dev \
  libsdl2-dev \
  make \
  moreutils \
  patch \
  perl \
  python-matplotlib \
  python3 \
  python3-pip \
  rr \
  rsync \
  sed \
  tar \
  tmux \
  unzip \
  vinagre \
  wget \
;
Reading package lists... Done
Building dependency tree       
Reading state information... Done
bash is already the newest version (4.4.18-2ubuntu1).
bc is already the newest version (1.07.1-2).
build-essential is already the newest version (12.4ubuntu1).
build-essential set to manually installed.
bzip2 is already the newest version (1.0.6-8.1).
cpio is already the newest version (2.12+dfsg-6).
g++ is already the newest version (4:7.3.0-3ubuntu2).
g++ set to manually installed.
gcc is already the newest version (4:7.3.0-3ubuntu2).
gcc set to manually installed.
git is already the newest version (1:2.17.0-1ubuntu1).
gzip is already the newest version (1.6-5ubuntu1).
make is already the newest version (4.1-9.1ubuntu1).
make set to manually installed.
patch is already the newest version (2.7.6-2ubuntu1).
rsync is already the newest version (3.1.2-2.1ubuntu1).
sed is already the newest version (4.4-2).
tar is already the newest version (1.29b-2).
unzip is already the newest version (6.0-21ubuntu1).
python3 is already the newest version (3.6.5-3ubuntu1).
perl is already the newest version (5.26.1-6ubuntu0.2).
wget is already the newest version (1.19.4-1ubuntu2.1).
binutils is already the newest version (2.30-20ubuntu2~18.04).
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:
 g++-aarch64-linux-gnu : Depends: g++-7-aarch64-linux-gnu (>= 7.3.0-12~)
 g++-arm-linux-gnueabihf : Depends: g++-7-arm-linux-gnueabihf (>= 7.3.0-12~)
 gcc-aarch64-linux-gnu : Depends: gcc-7-aarch64-linux-gnu (>= 7.3.0-12~)
 gcc-arm-linux-gnueabihf : Depends: gcc-7-arm-linux-gnueabihf (>= 7.3.0-12~)
 libsdl2-dev : Depends: libasound2-dev but it is not going to be installed
               Depends: libegl1-mesa-dev but it is not going to be installed
               Depends: libgl1-mesa-dev but it is not going to be installed
               Depends: libgles2-mesa-dev but it is not going to be installed
               Depends: libglu1-mesa-dev but it is not going to be installed
               Depends: libpulse-dev but it is not going to be installed
               Depends: libudev-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Traceback (most recent call last):
  File "./build", line 656, in <module>
    Main().cli()
  File "/home/rootkiter/github/linux-kernel-module-cheat/cli_function.py", line 267, in cli
    exit_status = self.cli_noexit(*args, **kwargs)
  File "/home/rootkiter/github/linux-kernel-module-cheat/cli_function.py", line 258, in cli_noexit
    return self._do_main(vars(args))
  File "/home/rootkiter/github/linux-kernel-module-cheat/cli_function.py", line 152, in _do_main
    return self.main(**self._get_args(kwargs))
  File "/home/rootkiter/github/linux-kernel-module-cheat/common.py", line 1372, in main
    ret = self.timed_main()
  File "./build", line 542, in timed_main
    self.sh.add_newlines(sorted(apt_get_pkgs))
  File "/home/rootkiter/github/linux-kernel-module-cheat/shell_helpers.py", line 432, in run_cmd
    raise e
Exception: Command exited with status: 100
cirosantilli commented 4 years ago

Hi rootkiter,

I tested at 90f3701f834aadb75f6d92fd8157fe0cbab0fc52 with the Docker setup: https://github.com/cirosantilli/linux-kernel-module-cheat/tree/90f3701f834aadb75f6d92fd8157fe0cbab0fc52#docker which currently uses Ubuntu 18.04, and it did go past the apt install install command.

Also the apt install command appears to work fine in my Ubuntu 19.10 host.

I would just try to google for "E: Unable to correct problems, you have held broken packages." and see if any of the solutions work for you, e.g.: https://askubuntu.com/questions/363200/e-unable-to-correct-problems-you-have-held-broken-packages all that needs to work for now is the apt install command. Also see if it goes forward after removing libsdl2-dev.

Let me know if you find something out.