install and packagekit

This commit is contained in:
qiaofeng1227 2024-01-31 13:59:46 +08:00
parent 9d04bc1ea2
commit 43b146db91
2 changed files with 16 additions and 29 deletions

View File

@ -460,27 +460,28 @@ install_systemd() {
#--------------- main----------------------------------------- #--------------- main-----------------------------------------
check_ports $http_port $https_port $port | tee -a $path/install.log log_path="$path/install.log"
install_tools | tee -a $path/install.log check_ports $http_port $https_port $port | tee -a $log_path
download_source | tee -a $path/install.log 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 if [ $? -ne 0 ]; then
echo "install_docker failed with error $?. Exiting." echo "install_docker failed with error $?. Exiting."
exit 1 exit 1
fi 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 if [ $? -ne 0 ]; then
echo "install_cockpit failed with error $?. Exiting." echo "install_cockpit failed with error $?. Exiting."
exit 1 exit 1
fi 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 if [ $? -ne 0 ]; then
echo "install_plugins failed with error $?. Exiting." echo "install_plugins failed with error $?. Exiting."
exit 1 exit 1

View File

@ -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 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(){ Disable_PackageKit(){
echo "$echo_prefix_cockpit Install PackageKit(pkcon) and Cockpit repository"
echo "$echo_prefix_cockpit disable PackageKit(pkcon)"
if command -v pkcon &> /dev/null; then if command -v pkcon &> /dev/null; then
echo "pkcon is at your system ..." echo "pkcon is at your system ..."
sudo systemctl stop packagekit
sudo systemctl disable packagekit
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
fi fi
} }
Set_Repository() { Set_Repository() {
echo "$echo_prefix_cockpit Set Cockpit deb repository" echo "$echo_prefix_cockpit Set Cockpit deb repository"
if command -v apt &> /dev/null; then if command -v apt &> /dev/null; then
@ -398,7 +384,7 @@ Test_Cockpit
# release package memory # release package memory
if systemctl cat packagekit > /dev/null 2>&1; then if systemctl cat packagekit > /dev/null 2>&1; then
sudo systemctl restart packagekit Disable_PackageKit
else else
echo "no packagekit" echo "no packagekit"
fi fi