Package: dpkg
X-Debbugs-Cc: [email protected]
Version: 1.23.7
Severity: wishlist

Dear Maintainers,

I was trying to remove a 3rd party package with apt and it deleted the /opt
folder as well. I have identified that it's due to this package incorrectly
identified /opt as part of its file tree, so dpkg removed /opt as well, seeing
it has no other folders/files in it. Indeed this remove operation didn't cause
any data loss, however this also prevents any further 3rd party packages from
being installed to /opt as well.

Now, of course the main responsibility lies on sloppy packaging practice
of the 3rd party package. But to make sure such packages won't cause problem
for the OS users, would it make sense for add safeguards that make
dpkg ignore such remove requests when removing these folders
might cause system usability problems? (Like /usr/lib/modules and /usr/sbin )

Note that though the following information said I have dpkg 1.22.22 installed, 
conflicting the information in header, I have manually verified on dpkg 1.23.7.

-- System Information:
Debian Release: 13.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.74+deb13+1-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages dpkg depends on:
ii  libbz2-1.0   1.0.8-6
ii  libc6        2.41-12+deb13u2
ii  liblzma5     5.8.1-1
ii  libmd0       1.1.0-2+b1
ii  libselinux1  3.8.1-1
ii  libzstd1     1.5.7+dfsg-1
ii  tar          1.35+dfsg-3.1
ii  zlib1g       1:1.3.dfsg+really1.3.1-1+b1

dpkg recommends no packages.

Versions of packages dpkg suggests:
ii  apt            3.0.3
pn  debsig-verify  <none>

-- no debconf information

Reply via email to