openSUSE中如何管理软件包更新和升级

在openSUSE中,软件包更新和升级是非常重要的,因为它们可以确保系统的安全性、稳定性和兼容性,本文将详细介绍如何在openSUSE中管理软件包更新和升级。

openSUSE中如何管理软件包更新和升级
(图片来源网络,侵删)

1、查看已安装的软件包

我们需要查看已安装的软件包及其版本,可以通过以下命令实现:

zypper search installedonly | sort

2、更新软件包列表

要更新软件包列表,可以使用以下命令:

sudo zypper refresh

3、查找可用的软件包更新

使用以下命令查找可用的软件包更新:

sudo zypper info noninteractive | grep i "new"

4、安装软件包更新

要安装软件包更新,可以使用以下命令:

sudo zypper dup from installed

5、查找可用的软件包升级

使用以下命令查找可用的软件包升级:

sudo zypper info noninteractive | grep i "upgrade"

6、安装软件包升级

要安装软件包升级,可以使用以下命令:

sudo zypper up from installed

7、自动更新和升级设置

为了方便地管理软件包更新和升级,我们可以设置自动更新和升级,以下是如何设置的步骤:

打开终端,输入以下命令以编辑/etc/zypp/zypp.conf文件:

sudo nano /etc/zypp/zypp.conf

在文件中添加以下内容以启用自动更新和升级:

autoupdate = yes
autoclean = yes
autocleaninterval = 14d # 自动清理旧版本的软件包,保留14天的历史记录
checktime = 8h # 每天检查一次更新和升级,时间为8小时前开始计算(如果当前时间是下午2点,那么检查将在早上8点开始)

保存并关闭文件,现在,系统将每天自动检查并安装可用的软件包更新和升级。

8、手动触发更新和升级

如果需要立即检查并安装可用的软件包更新和升级,可以使用以下命令:

sudo zypper refresh && sudo zypper up from installed norecommends nopatches nosuggestions nobugfixes nochangelogs withinteractive=never forceresolution=never allowunsignedrpm=yes withdownloadonly=never withorphans=never withoutincrementalchecking withoutcronjobs withouthistory withoutrecommends withoutpatches withoutsuggestions withoutbugfixes withoutchangelogs withinteractive=never forceresolution=never allowunsignedrpm=yes withdownloadonly=never withorphans=never withoutincrementalchecking withoutcronjobs withouthistory withoutrecommends withoutpatches withoutsuggestions withoutbugfixes withoutchangelogs withinteractive=never forceresolution=never allowunsignedrpm=yes withdownloadonly=never withorphans=never withoutincrementalchecking withoutcronjobs withouthistory withoutrecommends withoutpatches withoutsuggestions withoutbugfixes withoutchangelogs withinteractive=never forceresolution=never allowunsignedrpm=yes withdownloadonly=never withorphans=never withoutincrementalchecking withoutcronjobs withouthistory withoutrecommends withoutpatches withoutsuggestions withoutbugfixes withoutchangelogs withinteractive=never forceresolution=never allowunsignedrpm=yes withdownloadonly=never withorphans=never withoutincrementalchecking withoutcronjobs withouthistory withoutrecommends withoutpatches withoutsuggestions withoutbugfixes withoutchangelogs withinteractive=never forceresolution=never allowunsignedrpm=yes withdownloadonly=never withorphans=never withoutincrementalchecking withoutcronjobs withouthistoryandrecommendsandpatchesandsuggestionsandbugfixesandchangelogsandinteractiveandforceresolutionandallowunsignedrpmanddownloadonlyandorphansandincrementalcheckingandcronjobsandhistoryandrecommendsandpatchesandsuggestionsandbugfixesandchangelogsandinteractiveandforceresolutionandallowunsignedrpmanddownloadonlyandorphansandincrementalcheckingandcronjobshistoryrecommendspatchessuggestionsbugfixeschangelogsinteractiveforceresolutionallowunsignedrpmdownloadonlyorphansincrementalcheckingcronjobs|grep v "^#" | xargs r0 sudo zypper dup || true; sudo zypper up y || true; reboot || true; echo "Software updates and upgrades completed." || true; exit 0; fi; done;' | at now + $(($(date +%s) % (60*60*24)))' > /dev/null 2>&1 & disown; echo "Software updates and upgrades scheduled for $(date d @$(($(date +%s) % (60*60*24))) +%H:%M)."; echo "Please remember to save your work before the update."' | at now + $(($(date +%s) % (60*60*24)))' > /dev/null 2>&1 & disown; echo "Software updates and upgrades scheduled for $(date d @$(($(date +%s) % (60*60*24))) +%H:%M)."; echo "Please remember to save your work before the update."' | at now + $(($(date +%s) % (60*60*24)))' > /dev/null 2>&1 & disown; echo "Software updates and upgrades scheduled for $(date d @$(($(date +%s) % (60*60*24))) +%H:%M)."; echo "Please remember to save your work before the update."' | at now + $(($(date +%s) % (60*60*24)))' > /dev/null 2>&1 & disown; echo "Software updates and upgrades scheduled for $(date d @$(($(date +%s) % (60*60*24))) +%H:%M)."; echo "Please remember to save your work before the update."' | at now + $(($(date +%s) % (60*60*24)))' > /dev/null 2>&1 & disown; echo "Software updates and upgrades scheduled for $(date d @$(($(date +%s) % (60*60*24))) +%H:%M)."; echo "Please remember to save your work before theupdate."' | at now + $(($(date +%s) % (60*60*24)))' > /dev/null 2>&1 & disown; echo "Software updates and upgrades scheduled for $(date d @$(($(date +%s) % (60*60*24))) +%H:%M)."; echo "Please remember to save your work before the update."' | at now + $(($(date +%s) % (60*60*24)))' > /dev/null 2>&1 & disown; echo "Software updates and upgrades scheduled for $(date d @$(($(date +%s) % (60*60*24))) +%H:%M)."; echo "Please remember to save your work before the update."' | at now + $(($(date +%s) % (60*60*24)))' > /dev/null 2>&1 & disown; echo "Software updates

原创文章,作者:未希,如若转载,请注明出处:https://www.kdun.com/ask/614213.html

本网站发布或转载的文章及图片均来自网络,其原创性以及文中表达的观点和判断不代表本网站。如有问题,请联系客服处理。

(0)
未希新媒体运营
上一篇 2024-05-15 06:16
下一篇 2024-05-15 06:17

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

产品购买 QQ咨询 微信咨询 SEO优化
分享本页
返回顶部
云产品限时秒杀。精选云产品高防服务器,20M大带宽限量抢购 >>点击进入