How to delete programming languages compilers from SLES?

Greetings!
I have quite an unusual task - I need to delete all compilers (like gcc, python and others) and their libraries from SLES15 SP1. I couldn’t find the solution in docs. Can you please give me a hand with this? I assume it’s not sophisticated, but the task needs to be done accuratly, so I would like to hear some experienced user’s advice.

p.s. also looking for a way to delete a component responsible for working with USB devices

[QUOTE=LuckyNumber17;59098]Greetings!
I have quite an unusual task - I need to delete all compilers (like gcc, python and others) and their libraries from SLES15 SP1. I couldn’t find the solution in docs. Can you please give me a hand with this? I assume it’s not sophisticated, but the task needs to be done accuratly, so I would like to hear some experienced user’s advice.

p.s. also looking for a way to delete a component responsible for working with USB devices[/QUOTE]
Hi and welcome to the Forum :slight_smile:
What you asking is not possible as such, you can sure delete the gcc, g++ etc compilers, interpreters like python, perl etc no. What you need to look at is ‘restricted users’ something like rbash, lshell etc.

As far as USB devices, best way is in the BIOS and password protect the BIOS, else you can look at blacklisting the various modules (look at the output from lsusb -t). But what about mouse, keyboard etc? or is this a touchscreen setup?

What is the end goal for your task?

Using alternative shells is not an option, I need to manually remove these modules

I don’t know about installation type, but I am looking for a way to disable this feature at the system level.
lsusb -t command shows
/sys/bus/usb/devices: No such file or directory

Client of the firm where I work has an certified application that works with critical business data (SAP R/3). It used to work on Solaris, but they are moving it to SLES and upgrading to SAP S/4. In order to get a certificate, all the regulator’s demands in the information security field must be maintained. So, I have to figure out how to perform the same limitations they had on Solaris in SLES. Particularly, infosec policy assumes that on the system where such software works, there should be no programming lang. compilers and usb must be unavailable. There are more rules, but thanks to the docs I figured out how to apply them on SUSE. But these two moments remain unsolved.

Let me bring you an example
In Solaris, if package “SUNWgcc” is removed, then no C code can be compiled. Same goes for SUNWp15u/v - Perl module. If SUNWusb is removed, then no usb device can be recognized. I am looking for the packages that do the same thing in SUSE.

Sorry for bad english:) and thanks for your fast reply, looking forward for your advice

Hi
So for gcc and the likes it can be removed either via YaST or zypper eg;

zypper rm gcc

Removing the like of perl, python, python2 and python3 will likely result in a broken system as these interpreters are used for the various system parts, eg bootloader.

For the USB devices, looks like the hardware doesn’t have anything attached… What you could do is search for the usb packages via YaST or zypper;

zypper se -si usb

Then in the list look at removing one at a time to ensure other items you need don’t get deleted.

Then could look at the kernel related USB modules for the hardware and blacklist them.

For example on a SLES 15 SP1 KVM machine I see;

hwinfo --usb | grep "Driver Module"

  Driver Modules: "usbcore"
  Driver Modules: "usbhid"
  Driver Modules: "usbcore"
  Driver Modules: "usbcore"
  Driver Modules: "usbhid"
  Driver Modules: "usbcore"

Thank you very much for your reply!