移除AppArmor
1.使用systemctl停止Apparmor服務。
sudo systemctl stop apparmor
2.從系統中清除AppArmor
sudo apt purge apparmor
3.更新系統
sudo apt update && sudo apt upgrade -yuf
3.1可能會遇到Hash Sum mismatch問題。
3.2解決方法如下:
sudo su -
mkdir /etc/gcrypt
echo all >> /etc/gcrypt/hwf.deny
apt-get update
4.安裝SELinux及相關包
sudo apt install policycoreutils selinux-utils selinux-basics
5.查看SELinux安裝情況
sudo selinux-activate
如果出現如上內容,則安裝成功。
6.將SELinux置於enforcing狀態
sudo selinux-config-enforcing
7.重啟系統,SELinux將給系統資源加標簽。會花費一定時間。圖為Ubuntu20.04重啟時配置安全標簽過程
參考鏈接:
1.https://stackoverflow.com/questions/64120030/hash-sum-mismatch-when-apt-get-update-ubuntu-20-04-vm-with-multipass
2.https://www.techrepublic.com/article/how-to-install-selinux-on-ubuntu-server-20-04/
3.https://www.linode.com/docs/guides/how-to-install-selinux-on-ubuntu-18-04/
.https://linuxconfig.org/how-to-disable-enable-selinux-on-ubuntu-20-04-focal-fossa-linux