File: custom-package-removed.fail.sh

package info (click to toggle)
scap-security-guide 0.1.76-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 110,644 kB
  • sloc: xml: 241,883; sh: 73,777; python: 32,527; makefile: 27
file content (18 lines) | stat: -rw-r--r-- 633 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
# platform = multi_platform_rhel,multi_platform_fedora

# Package libselinux cannot be uninstalled normally
# as it would cause removal of sudo package which is
# protected and package manager returns error in such
# case. If the package would be removed forcefully it
# would make the system unusable. Therefore, we will
# remove the existing rpmdb and we will create a fake
# empty one without libselinux package.
rm -rf /var/lib/rpm/*
rpm --initdb
if grep -q "rhel" /etc/os-release; then
    yum install -y redhat-release
else
    source /etc/os-release
    dnf install -y fedora-release --releasever "$VERSION_ID"
fi