linux – 哪个apt选项可以安全地自动更新

前端之家收集整理的这篇文章主要介绍了linux – 哪个apt选项可以安全地自动更新前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
与我的 previous question相关,升级包时应该使用哪些apt选项,以便:

>如果升级后其他包将被删除,apt将停止而不触及任何内容
>如果由于升级而安装新软件包,并且它们不会导致任何冲突或删除,则apt会安装它们
>如果其他套餐升级,我宁愿停下来

在此先感谢您的帮助

解决方法

我对man手册进行了一些研究,特别是在man apt.conf和man apt-get中,发现了以下内容.如果您认为我忘了什么,请评论.

>使用选项–only-upgrade,或将apt配置项APT :: Get :: Only-Upgrade设置为true
> apt配置项APT :: Get :: force-yes设置为false
>使用选项–no-remove,或将apt配置项APT :: Get :: Remove设置为false

不确定–trivial-only / APT :: Get :: Trivial-Only在这里有帮助,需要更好地调查它.

有了aptitude,相关的部分似乎是:

>使用带有–no-new-installs选项的safe-upgrade命令
>将Aptitude :: Delete-Unused设置为false,以便不会自动删除未使用的包(我可能不同意aptitude关于未使用的内容……)
>添加-R / – 无需建议可能有所帮助,需要更多调查

更新
我在旧系统上做了一些测试:

# grep ^Ubuntu /etc/motd
Ubuntu 10.04.4 LTS

apt-get看起来更加谨慎,并且正常的apt-get升级和apt-get -o之间的结果没有区别APT :: Get :: Only-Upgrade = true –no-remove -o APT :: Get: :force-yes = false升级.

天赋似乎更具侵略性,而“安全选择”似乎也起到了作用.标准升级(它实际上运行安全升级)

# aptitude -s -y upgrade
W: The "upgrade" command is deprecated; use "safe-upgrade" instead.
Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze   
Lettura informazioni sullo stato... Fatto
Reading extended state information   
Initializing package states... Fatto
Resolving dependencies...
The following NEW packages will be installed:
  linux-image-2.6.32-55-generic-pae{a}
The following packages will be upgraded:
  linux-generic-pae linux-image-generic-pae linux-image-server linux-libc-dev linux-server
5 packages upgraded,1 newly installed,0 to remove and 0 not upgraded.
Need to get 0B/32.8MB of archives. After unpacking 98.2MB will be used.
Would download/install/remove packages.

现在有了“安全”选项:

# aptitude -s -y --no-new-installs -R -o Aptitude::Delete-Unused=false safe-upgrade 
Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze   
Lettura informazioni sullo stato... Fatto
Reading extended state information   
Initializing package states... Fatto
Resolving dependencies...
The following packages have been kept back:
  linux-generic-pae linux-image-generic-pae
The following packages will be upgraded:
  linux-image-server linux-libc-dev linux-server
3 packages upgraded,0 newly installed,0 to remove and 2 not upgraded.
Need to get 0B/878kB of archives. After unpacking 0B will be used.
Would download/install/remove packages.

与我想要的更相似.

不幸的是,当使用install命令而不是升级/安全升级时,两个集合都不会阻止安装新软件包或升级其他软件包,所以我有点回到原点:我无法接受-get / aptitude当它会进行潜在的,偏执的不安全操作时停止.从某种意义上说,我有一个更好的安全网,但我没有被阻止倒下.

原文链接:/linux/396923.html

猜你在找的Linux相关文章