From 43b146db91dffdefa2f69103c71c51357583d411 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Wed, 31 Jan 2024 13:59:46 +0800 Subject: [PATCH] install and packagekit --- install/install.sh | 17 +++++++++-------- install/install_cockpit.sh | 28 +++++++--------------------- 2 files changed, 16 insertions(+), 29 deletions(-) diff --git a/install/install.sh b/install/install.sh index d515b3f3..c46a5b55 100644 --- a/install/install.sh +++ b/install/install.sh @@ -460,27 +460,28 @@ install_systemd() { #--------------- main----------------------------------------- -check_ports $http_port $https_port $port | tee -a $path/install.log -install_tools | tee -a $path/install.log -download_source | tee -a $path/install.log +log_path="$path/install.log" +check_ports $http_port $https_port $port | tee -a $log_path +install_tools | tee -a $log_path +download_source | tee -a $log_path -bash $install_path/install/install_docker.sh | tee -a $path/install.log +bash $install_path/install/install_docker.sh | tee -a $log_path if [ $? -ne 0 ]; then echo "install_docker failed with error $?. Exiting." exit 1 fi -install_backends | tee -a $path/install.log +install_backends | tee -a $log_path -install_systemd | tee -a $path/install.log +install_systemd | tee -a $log_path -bash $install_path/install/install_cockpit.sh | tee -a $path/install.log +bash $install_path/install/install_cockpit.sh | tee -a $log_path if [ $? -ne 0 ]; then echo "install_cockpit failed with error $?. Exiting." exit 1 fi -bash $install_path/install/install_plugins.sh | tee -a $path/install.log +bash $install_path/install/install_plugins.sh | tee -a $log_path if [ $? -ne 0 ]; then echo "install_plugins failed with error $?. Exiting." exit 1 diff --git a/install/install_cockpit.sh b/install/install_cockpit.sh index 660e9b4f..6a1a06f5 100644 --- a/install/install_cockpit.sh +++ b/install/install_cockpit.sh @@ -130,32 +130,18 @@ Print_Version(){ sudo /usr/libexec/cockpit-ws --version 2>/dev/null || sudo /usr/lib/cockpit-ws --version 2>/dev/null || /usr/lib/cockpit/cockpit-ws --version 2>/dev/null } -Install_PackageKit(){ - echo "$echo_prefix_cockpit Install PackageKit(pkcon) and Cockpit repository" +Disable_PackageKit(){ + + echo "$echo_prefix_cockpit disable PackageKit(pkcon)" if command -v pkcon &> /dev/null; then echo "pkcon is at your system ..." - - elif command -v yum &> /dev/null; then - if [ "$(cat /etc/redhat-release)" = "Redhat7" ]; then - sudo subscription-manager repos --enable rhel-7-server-extras-rpms - fi - sudo yum install PackageKit -y - - elif command -v dnf &> /dev/null; then - sudo dnf install PackageKit -y - - elif command -v apt &> /dev/null; then - sudo apt update - sudo apt install packagekit -y - - else - echo "PackageKit not found, Cockpit cannot be installed" - exit 1 + sudo systemctl stop packagekit + sudo systemctl disable packagekit + fi } - Set_Repository() { echo "$echo_prefix_cockpit Set Cockpit deb repository" if command -v apt &> /dev/null; then @@ -398,7 +384,7 @@ Test_Cockpit # release package memory if systemctl cat packagekit > /dev/null 2>&1; then - sudo systemctl restart packagekit + Disable_PackageKit else echo "no packagekit" fi