On 5/2/23, Greg Wooledge wrote: > On Tue, May 02, 2023 at 10:18:10AM +0100, Tixy wrote: >> On Tue, 2023-05-02 at 17:03 +0800, Bret Busby wrote: >> > man apt >> >> Which doesn't say what 'apt purge' does without a package name. It says >> 'Performs the requested action on one or more packages specified via >> regex(7), glob(7) or exact match'. It doesn't go on to say what happens >> if you leave that blank. > > Maybe I can experiment? Let's see if "apt purge" is a syntax error: > > unicorn:~$ apt purge > E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: > Permission denied) > E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), > are you root? > > Rats! No luck here. Either "apt purge" is not an error, or the argument > processing and validation happens only after acquiring the lock. > > Now we have to tread dangerous waters to find out more information. > > unicorn:~$ sudo apt --dry-run > [sudo] password for greg: > E: Command line option --dry-run is not understood in combination with the > other options > > OK... that's progress. It looks like the --dry-run option exists. > So maybe we can use that to avoid destroying our system by trying commands > as root. > > unicorn:~$ sudo apt --dry-run purge > Reading package lists... Done > Building dependency tree... Done > Reading state information... Done > 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
you're a better sysadmin? I get $ sudo apt --dry-run purge [sudo] password for lee: Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages were automatically installed and are no longer required: linux-image-5.10.0-19-amd64 linux-image-5.10.0-20-amd64 Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Regards Lee