SakuraOS Wiki

Terminal Assist

Using a terminal for the first time is daunting, and one command can take a whole system with it. Terminal Assist recognises the commands that do real damage, stops them, and says what to run instead. Every check names its own override.

Two layers, and only one of them matters

There are two places a check can live, and they are not equally trustworthy.

The check inside pacman

The real guard is an ALPM hook. It runs as a PreTransaction action on every package removal, is marked AbortOnFail, and a non-zero exit stops the transaction dead.

Because it lives inside pacman itself, it applies no matter how the transaction was started: from your shell, from a script, from an AUR helper, or from the App Store. There is no way to route around it that does not involve removing the hook.

The layer in your shell

A shell function checks the command line before it runs and warns about things pacman never sees, such as a partial upgrade or a destructive rm. This layer is a courtesy, not a guard. It is trivially bypassed, and it is meant to be: it is there to catch a typo and explain it, not to stand between you and your own machine.

What it stops

The removal guard knows which packages a system does not survive losing, and says why rather than simply refusing:

PackageWhy it is guarded
systemdthe init system, the machine will not boot without it
glibcthe C library, essentially every program depends on it
pacmanthe package manager, you could not install anything back
bashthe system shell, install scripts and boot units need it
coreutilscore utilities like ls, cp and rm
filesystemthe base directory layout
sudohow you become root, you may lock yourself out
linux-firmwarehardware firmware, wifi and graphics may stop working
mkinitcpiobuilds the boot image, future kernel updates would not boot
liminethe bootloader, the machine will not boot
sakura-snapshot-bootsnapshot rollback, you would lose the undo button

The shell layer additionally recognises:

Overriding a check

Every message ends with the exact command that gets past it. Nothing here is a wall; it is a speed bump with a sign on it.

# the message tells you which rule fired, and you name it
sudo SAKURA_ASSIST_OVERRIDE=glibc pacman -R glibc

The override names the specific rule. It is deliberately not a universal skeleton key: setting it to bypass one check does not silently disable the other ten, and a habit of pasting one override does not turn into a habit of disabling the system. More than one rule can be named at once, separated by commas.

It is not a nanny. Around thirty rules: eleven packages the removal guard will not let go quietly, and about twenty patterns the shell layer recognises. It is not a filter on what you are allowed to learn, and it never refuses without telling you both why and how to proceed anyway.