running `apt download atop` ; `sudo dpkg -x atop_2.4.0-3_amd64.deb /` kills the system

Bug #1843476 reported by Norbert
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
base-files (Ubuntu)
New
Undecided
Unassigned
dpkg (Ubuntu)
New
Undecided
Unassigned

Bug Description

Steps to reproduce:
1. Have Ubuntu 19.10 installed
2. Ensure that all dependencies for needed packages are satisfied:

$ apt install -s atop
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  atop
0 upgraded, 1 newly installed, 0 to remove and 199 not upgraded.
Inst atop (2.4.0-3 Ubuntu:19.10/eoan [amd64])
Conf atop (2.4.0-3 Ubuntu:19.10/eoan [amd64])

3. Download the package with `apt download atop`
4. Extract the package by hand with `sudo dpkg -x atop_2.4.0-3_amd64.deb /` (this is needed if system is broken and it is used in practice; atop is just an example)

Expected results:
package is extracted normally

Actual results:
package is extracted, but system is killed - unable to use `sudo` and many other commands -

  $ sudo
  bash: /usr/bin/sudo: No such file or directory

  $ bash
  bash: /usr/bin/bash: No such file or directory

  $ dash
  bash: /usr/bin/dash: No such file or directory

  $ systemctl
  bash: /usr/bin/systemctl: No such file or directory

  $ journalctl
  bash: /usr/bin/journalctl: No such file or directory

  $ ip a
  bash: /usr/sbin/ip: No such file or directory

  $ ldd
  bash: /usr/bin/ldd: /bin/bash: bad interpreter: No such file or directory

  $ mc
  bash: /usr/lib/command-not-found: /usr/bin/python3: bad interpreter: No such file or directory

  $ python
  bash: /usr/bin/python: No such file or directory

  $ apt
  bash: /usr/bin/apt: No such file or directory

ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: dpkg 1.19.7ubuntu1
ProcVersionSignature: Ubuntu 5.2.0-15.16-generic 5.2.9
Uname: Linux 5.2.0-15-generic x86_64
ApportVersion: 2.20.11-0ubuntu7
Architecture: amd64
CurrentDesktop: MATE
Date: Tue Sep 10 21:25:58 2019
InstallationDate: Installed on 2019-09-06 (4 days ago)
InstallationMedia: Ubuntu-MATE 19.10 "Eoan Ermine" - Alpha amd64 (20190906)
SourcePackage: dpkg
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Norbert (nrbrtx) wrote :
description: updated
description: updated
tags: added: disco
Revision history for this message
Norbert (nrbrtx) wrote :

Ubuntu 19.04 is also affected.

Ubuntu 18.04 LTS and 16.04 LTS are not affected.

Revision history for this message
Norbert (nrbrtx) wrote :

It is a bit unbelievable.

After extracting of atop package the `/lib` folder contains only one folder `/lib/systemd`.
But before the accident it was a symlink to `/usr/lib`.

So you have a serious bug in `dpkg` - it should distinguish between ordinary objects and symlinks.

Problem is solvable by the following actions

   sudo chroot /media/user/problematic-disk/ busybox sh
   rm -rf /lib
   ln -s usr/lib lib

then boot the system and reinstall the package

   apt install atop --reinstall

Norbert (nrbrtx)
tags: added: focal
Norbert (nrbrtx)
tags: removed: disco eoan
tags: added: hirsute impish
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.