gentoo linux的包维护(portage)和系统管理
jw.emerge_update的Python项目详细描述
这是gentoo的portage包管理器中用于包更新和一般系统管理的脚本。目的是 尽可能直接地自动化系统更新和维护。有很多命令要运行 保持gentoo linux系统的健康和整洁。单独出现并没有多大作用。这就是剧本的用武之地。
emerge_update做什么?
运行以下任务:
- 运行qcheck --badonly--all检查属于emerge安装的包的已更改文件。有几个 例外情况不应修改任何文件。这是一种检测恶意活动的简单方法,例如由入侵者检测。[1]
- 运行eix-sync-q更新包存储库
- 备份(参见Backups)
- 运行emerge @world。提供了许多选项,请参见Emerge Options
- 如果检测到包的自动取消屏蔽,则运行etc-update--automode=-5 /etc/portage进行更改 由〈cite〉提出,浮现〈cite〉永久。如果甲骨文的jdk应该下载,它就会下载。然后,emerge @world再次运行。
- 运行emerge --depclean以删除不必要的包
- 运行revdep-rebuild--ignore重新生成由于最后一个emerge而导致共享库依赖关系中断的包。
- 运行emerge @preserved-rebuild。修复损坏的库依赖项的另一个措施。Gentoo推荐跑步 revdep rebuild和preserved rebuild都是。
- 如果检测到python的更新,则运行python-updater。
- 运行perl-cleaner--all
- 运行cfg-update--update--automatic-only更新所有可以自动更新的配置文件。
- 运行cfg-update--index为下一次运行cfg update创建更新索引。
- 运行prelink --all以预链接所有二进制文件以加快加载速度。
- 备份(见Backups)。如果这个目录被破坏了,您就陷入了最严重的麻烦。
- 运行qcheck --all--update为下次运行更新校验和。
- 运行emaint -c all检查潜在的问题或改进点。这不能修复任何东西。你可以跑 emaint -f ...例如emaint -f all来修复问题。
使用emerge_update
选项
-h, --help | show the help |
--dry-run, -n | don’t execute commands, just print them |
--verbose, -v | print commands as they are executed |
--version, -V | show program’s version number and exit |
--output OUTPUT, -o OUTPUT | |
specify output file | |
--append, -a | append to output file instead of overwriting |
要测试脚本,请使用emerge_update --dry-run运行它。这样,它只显示将要做什么。
提示
使用--verbose--output /var/log/emerge_update --append运行脚本,以便对发生的情况有一个很好的日志。
提示
使用nice -19和ionice -c3运行脚本,以避免使系统承受太多负载。
备份
备份是通过重命名和硬链接目标~/.local/share/applications/mimeapps.list(如果可能)来完成的。这 但不适用于装入点。作为挂载点的目录作为tar文件备份到 备份目录(默认情况下,/var/lib/emerge_update)。如有必要,将创建备份目录。
注意
您应该通过删除旧备份来维护备份目录(通常是/var/lib/emerge_update)。你可以的 这是一个带有tmpwatch的包。移动和链接备份保留8代。
出现选项
Emerge使用以下选项运行:
--nospinner | This is not desirable in automated runs of emerge |
--update | Only update packages |
--newuse | Update packages when the USE configuration changes |
--deep | Consider updating dependencies |
--keep-going | Continue in case of error to update as much as possible |
--autounmask y | Unmask required packages |
--autounmask-write y | |
Make unmasking permanent | |
--jobs n | where ^{tt22}$ = 4. This runs a maximum of 4 parallel emerge jobs |
--load-average n | |
where ^{tt22}$ is the number of processors on-line in the system or 3 if this number cannot be determined. This prevents creating new emerge jobs if the load average if above n |