Re: Re: removing gdb-minimal removed plasma-desktop?

2024-01-14 Thread Morten Hauke Solvang
On 2024-01-14 08:54 +0100, Morten Hauke Solvang wrote:

> That assumption was a bit misguided.  The correct way would have been to
> "apt install gdb" _without_ first removing gdb-minimal, that would have
> avoided the removal of reverse dependencies.

> Pretty sure not only was this information printed, apt also asks for
> confirmation if it has to install or remove more packages than
> requested.  But it did what you told it to do, although the outcome
> might not have been what you desired.

Right, makes sense to me. I was apparently just asleep at the wheel.

> Good you sorted it out.  The only question is why apt installed gdb even
> though it removed plasma-workspace anyway.  When I tried to replicate
> your situation in a bookworm chroot, "apt remove gdb-minimal" removes
> plasma-workspace but does not install gdb.

I just ran 'apt install gdb-minimal' to get back to the state from
before yesterday.
If I then run 'apt remove gdb-minimal' I do infact see the warning you were
saying I would see.

$ sudo apt remove gdb-minimal
... (trimmed output)
The following additional packages will be installed:
 gdb
Suggested packages:
 gdb-doc gdbserver
The following packages will be REMOVED:
 gdb-minimal kde-plasma-desktop kinfocenter plasma-desktop
plasma-widgets-addons plasma-workspace plasma-workspace-wayland
sddm-theme-breeze sddm-theme-debian-breeze
The following NEW packages will be installed:
 gdb
0 upgraded, 1 newly installed, 9 to remove and 0 not upgraded.

If I follow what you are saying, then this is all is fine, except that
 - It's a bit odd that plasma-desktop depends on gdb-minimal | gdb
 - Why is it installing gdb?
 - If it is installing gdb, then it shouldn't actually need to remove
plasma-desktop.

If I type 'n' to abort the 'apt remove ...' call, and instead install
'gdb', I see this:

$ sudo apt install gdb
... (trimmed output)
The following packages will be REMOVED:
 gdb-minimal
The following NEW packages will be installed:
 gdb
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
Need to get 3,962 kB of archives.
After this operation, 1,757 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://deb.debian.org/debian bookworm/main amd64 gdb amd64
13.1-3 [3,962 kB]
Fetched 3,962 kB in 0s (34.7 MB/s)
dpkg: gdb-minimal: dependency problems, but removing anyway as you requested:
plasma-workspace depends on gdb-minimal | gdb; however:
 Package gdb-minimal is to be removed.
 Package gdb is not installed.
 Package gdb-minimal which provides gdb is to be removed.
plasma-workspace depends on gdb-minimal | gdb; however:
 Package gdb-minimal is to be removed.
 Package gdb is not installed.
 Package gdb-minimal which provides gdb is to be removed.
... (trimmed output)

This ends up doing what I wanted to do yesterday: I get full gdb
instead of gdb-minimal, and my desktop
environemnt doesn't disappear.
The warning from dpkg seems a bit odd, looks like it also is confused
about whether or not gdb is installed
(and the warning also is printed twice...).

Maybe I'll try booting up a full clean install in a VM to see if I can
reproduce, to rule out that there
is anything else which is messed up on my system.

Either way, thanks a lot for your reply!
Best regards, Morten



removing gdb-minimal removed plasma-desktop?

2024-01-14 Thread Morten Hauke Solvang
Short version: "apt remove gdb-minimal" seems to have also removed
plasma-desktop + a bunch of related packages.

Curious if there are any good debugging tips for figuring out what
happened here.
Or maybe I'm missing something obvious about how apt works, and this
is expected behavior?

Yesterday, I was trying to use gdb, and realized I had gdb-minimal
installed instead of the regular gdb package.

To fix this, I first ran "apt remove gdb-minimal".
My assumption was that I then would have to run "apt install gdb".
But turns out that invoking "gdb" after running "apt remove
gdb-minimal", I had the full version of gdb installed.
I didn't think more about it, went on using gdb and later shut down
the computer.

When I booted it today, a different display manager than what I
usually have was shown. Switching to a different pseudoterminal and
checking "/var/log/apt/history.log" showed that when I had removed
gdb-minimal, for some reason plasma-desktop and some other packages
had also been removed.

This is the entry I saw:

Start-Date: 2024-01-13  15:52:49
Commandline: apt remove gdb-minimal
Requested-By: morten (1000)
Install: gdb:amd64 (13.1-3, automatic),
libsource-highlight-common:amd64 (3.1.9-4.2, automatic),
libboost-regex1.74.0:amd64 (1.74.0+ds1-21, automatic), libc6-dbg:amd64
(2.36-9+deb12u3, automatic), libbabeltrace1:amd64 (1.5.11-1+b2,
automatic), libsource-highlight4v5:amd64 (3.1.9-4.2+b3, automatic)
Remove: kinfocenter:amd64 (4:5.27.5-2), plasma-workspace:amd64
(4:5.27.5-2+deb12u1), plasma-widgets-addons:amd64 (4:5.27.5-2),
plasma-workspace-wayland:amd64 (4:5.27.5-2+deb12u1),
sddm-theme-breeze:amd64 (4:5.27.5-2+deb12u1),
sddm-theme-debian-breeze:amd64 (4:5.27.5-2+deb12u1), gdb-minimal:amd64
(13.1-3), kde-plasma-desktop:amd64 (5:142), plasma-desktop:amd64
(4:5.27.5-2)
End-Date: 2024-01-13  15:52:52

(Looks like this is where regular gdb got installed too, so I didn't
actually have it, it just got autoinstalled when I removed
gdb-minimal?)
(Also, probably this info got printed when I ran "apt remove
gdb-minimal", and I was not paying attention.)

To fix it, I ran this command and rebooted with "systemctl reboot",
which seems to have worked fine. Now I'm back in the expected desktop
environment.
apt install kinfocenter plasma-workspace plasma-widgets-addons
plasma-workspace-wayland sddm-theme-breeze sddm-theme-debian-breeze
kde-plasma-desktop plasma-desktop

Looking back in history.log, the only other references to gdb-minimal
and plasma-desktop I could find was near the top of the file (15th
entry):

Start-Date: 2024-01-08  06:25:16
Commandline: apt-get -o APT::Status-Fd=4 -o APT::Keep-Fds::=5 -o
APT::Keep-Fds::=6 -q -y -o APT::Install-Recommends=true -o
APT::Get::AutomaticRemove=true -o Acquire::Retries=3 install
task-kde-desktop bind9-dnsutils dbus systemd-timesyncd apt-listchanges
reportbug netcat-traditional debian-faq python3-reportbug man-db
ncurses-term bash-completion bind9-host groff-base mime-support
manpages bzip2 inetutils-telnet doc-debian krb5-locales lsof ucf wget
libnss-systemd ca-certificates gettext-base perl wamerican
openssh-client xz-utils traceroute file liblockfile-bin libpam-systemd
media-types task-english task-desktop task-ssh-server
Install: ...

I've cut off the "Install :" part, because it continues for more than
a screen. It contains both the kde-packages which were gone from my
system, and gdb-minimal.
I assume that this is from when I ran the debian installer on monday
(fresh install).

I appreciate any input, thanks in advance.