整理文档

This commit is contained in:
CallMeR
2023-10-29 10:28:30 +08:00
parent b84666a6b6
commit 9386f961d1
15 changed files with 611 additions and 513 deletions
+2 -2
View File
@@ -349,7 +349,7 @@ $ nano /etc/apt/apt.conf.d/50unattended-upgrades
- 自动重启时间:`02:30` - 自动重启时间:`02:30`
因为该配置文件很长,完整的配置文件可查看 [pve_50unattended_upgrades.conf](./src/pve_50unattended_upgrades.conf) 以便对比。 因为该配置文件很长,完整的配置文件可查看 [pve_50unattended_upgrades.conf](./src/pve/pve_50unattended_upgrades.conf) 以便对比。
```bash ```bash
## 删除以下行前面的注释符 // ,代表启用 ## 删除以下行前面的注释符 // ,代表启用
@@ -384,7 +384,7 @@ Unattended-Upgrade::Automatic-Reboot-Time "02:30";
系统自动更新配置文件修改完成后,需要重设自动更新定时器,执行以下命令。 系统自动更新配置文件修改完成后,需要重设自动更新定时器,执行以下命令。
完整的配置文件可查看 [pve_apt_daily_upgrade.conf](./src/pve_apt_daily_upgrade.conf) 以便对比。 完整的配置文件可查看 [pve_apt_daily_upgrade.conf](./src/pve/pve_apt_daily_upgrade.conf) 以便对比。
```bash ```bash
## 配置系统定时器 ## 配置系统定时器
+1 -1
View File
@@ -335,7 +335,7 @@ $ sudo nvim /etc/apt/apt.conf.d/50unattended-upgrades
根据 “注释” 中相关说明,调整配置文件。 根据 “注释” 中相关说明,调整配置文件。
因为该配置文件很长,完整的配置文件可查看 [debian_50unattended_upgrades.conf](./src/debian_50unattended_upgrades.conf) 以便对比。 因为该配置文件很长,完整的配置文件可查看 [debian_50unattended_upgrades.conf](./src/debian/debian_50unattended_upgrades.conf) 以便对比。
```bash ```bash
## 删除以下行前面的注释符 // ,代表启用 ## 删除以下行前面的注释符 // ,代表启用
@@ -1,177 +1,177 @@
// Unattended-Upgrade::Origins-Pattern controls which packages are // Unattended-Upgrade::Origins-Pattern controls which packages are
// upgraded. // upgraded.
// //
// Lines below have the format "keyword=value,...". A // Lines below have the format "keyword=value,...". A
// package will be upgraded only if the values in its metadata match // package will be upgraded only if the values in its metadata match
// all the supplied keywords in a line. (In other words, omitted // all the supplied keywords in a line. (In other words, omitted
// keywords are wild cards.) The keywords originate from the Release // keywords are wild cards.) The keywords originate from the Release
// file, but several aliases are accepted. The accepted keywords are: // file, but several aliases are accepted. The accepted keywords are:
// a,archive,suite (eg, "stable") // a,archive,suite (eg, "stable")
// c,component (eg, "main", "contrib", "non-free") // c,component (eg, "main", "contrib", "non-free")
// l,label (eg, "Debian", "Debian-Security") // l,label (eg, "Debian", "Debian-Security")
// o,origin (eg, "Debian", "Unofficial Multimedia Packages") // o,origin (eg, "Debian", "Unofficial Multimedia Packages")
// n,codename (eg, "jessie", "jessie-updates") // n,codename (eg, "jessie", "jessie-updates")
// site (eg, "http.debian.net") // site (eg, "http.debian.net")
// The available values on the system are printed by the command // The available values on the system are printed by the command
// "apt-cache policy", and can be debugged by running // "apt-cache policy", and can be debugged by running
// "unattended-upgrades -d" and looking at the log file. // "unattended-upgrades -d" and looking at the log file.
// //
// Within lines unattended-upgrades allows 2 macros whose values are // Within lines unattended-upgrades allows 2 macros whose values are
// derived from /etc/debian_version: // derived from /etc/debian_version:
// ${distro_id} Installed origin. // ${distro_id} Installed origin.
// ${distro_codename} Installed codename (eg, "buster") // ${distro_codename} Installed codename (eg, "buster")
Unattended-Upgrade::Origins-Pattern { Unattended-Upgrade::Origins-Pattern {
// Codename based matching: // Codename based matching:
// This will follow the migration of a release through different // This will follow the migration of a release through different
// archives (e.g. from testing to stable and later oldstable). // archives (e.g. from testing to stable and later oldstable).
// Software will be the latest available for the named release, // Software will be the latest available for the named release,
// but the Debian release itself will not be automatically upgraded. // but the Debian release itself will not be automatically upgraded.
"origin=Debian,codename=${distro_codename}-updates"; "origin=Debian,codename=${distro_codename}-updates";
// "origin=Debian,codename=${distro_codename}-proposed-updates"; // "origin=Debian,codename=${distro_codename}-proposed-updates";
"origin=Debian,codename=${distro_codename},label=Debian"; "origin=Debian,codename=${distro_codename},label=Debian";
"origin=Debian,codename=${distro_codename},label=Debian-Security"; "origin=Debian,codename=${distro_codename},label=Debian-Security";
"origin=Debian,codename=${distro_codename}-security,label=Debian-Security"; "origin=Debian,codename=${distro_codename}-security,label=Debian-Security";
// Archive or Suite based matching: // Archive or Suite based matching:
// Note that this will silently match a different release after // Note that this will silently match a different release after
// migration to the specified archive (e.g. testing becomes the // migration to the specified archive (e.g. testing becomes the
// new stable). // new stable).
// "o=Debian,a=stable"; // "o=Debian,a=stable";
// "o=Debian,a=stable-updates"; // "o=Debian,a=stable-updates";
// "o=Debian,a=proposed-updates"; // "o=Debian,a=proposed-updates";
// "o=Debian Backports,a=${distro_codename}-backports,l=Debian Backports"; // "o=Debian Backports,a=${distro_codename}-backports,l=Debian Backports";
}; };
// Python regular expressions, matching packages to exclude from upgrading // Python regular expressions, matching packages to exclude from upgrading
Unattended-Upgrade::Package-Blacklist { Unattended-Upgrade::Package-Blacklist {
// The following matches all packages starting with linux- // The following matches all packages starting with linux-
// "linux-"; // "linux-";
// Use $ to explicitely define the end of a package name. Without // Use $ to explicitely define the end of a package name. Without
// the $, "libc6" would match all of them. // the $, "libc6" would match all of them.
// "libc6$"; // "libc6$";
// "libc6-dev$"; // "libc6-dev$";
// "libc6-i686$"; // "libc6-i686$";
// Special characters need escaping // Special characters need escaping
// "libstdc\+\+6$"; // "libstdc\+\+6$";
// The following matches packages like xen-system-amd64, xen-utils-4.1, // The following matches packages like xen-system-amd64, xen-utils-4.1,
// xenstore-utils and libxenstore3.0 // xenstore-utils and libxenstore3.0
// "(lib)?xen(store)?"; // "(lib)?xen(store)?";
// For more information about Python regular expressions, see // For more information about Python regular expressions, see
// https://docs.python.org/3/howto/regex.html // https://docs.python.org/3/howto/regex.html
}; };
// This option allows you to control if on a unclean dpkg exit // This option allows you to control if on a unclean dpkg exit
// unattended-upgrades will automatically run // unattended-upgrades will automatically run
// dpkg --force-confold --configure -a // dpkg --force-confold --configure -a
// The default is true, to ensure updates keep getting installed // The default is true, to ensure updates keep getting installed
//Unattended-Upgrade::AutoFixInterruptedDpkg "true"; //Unattended-Upgrade::AutoFixInterruptedDpkg "true";
// Split the upgrade into the smallest possible chunks so that // Split the upgrade into the smallest possible chunks so that
// they can be interrupted with SIGTERM. This makes the upgrade // they can be interrupted with SIGTERM. This makes the upgrade
// a bit slower but it has the benefit that shutdown while a upgrade // a bit slower but it has the benefit that shutdown while a upgrade
// is running is possible (with a small delay) // is running is possible (with a small delay)
//Unattended-Upgrade::MinimalSteps "true"; //Unattended-Upgrade::MinimalSteps "true";
// Install all updates when the machine is shutting down // Install all updates when the machine is shutting down
// instead of doing it in the background while the machine is running. // instead of doing it in the background while the machine is running.
// This will (obviously) make shutdown slower. // This will (obviously) make shutdown slower.
// Unattended-upgrades increases logind's InhibitDelayMaxSec to 30s. // Unattended-upgrades increases logind's InhibitDelayMaxSec to 30s.
// This allows more time for unattended-upgrades to shut down gracefully // This allows more time for unattended-upgrades to shut down gracefully
// or even install a few packages in InstallOnShutdown mode, but is still a // or even install a few packages in InstallOnShutdown mode, but is still a
// big step back from the 30 minutes allowed for InstallOnShutdown previously. // big step back from the 30 minutes allowed for InstallOnShutdown previously.
// Users enabling InstallOnShutdown mode are advised to increase // Users enabling InstallOnShutdown mode are advised to increase
// InhibitDelayMaxSec even further, possibly to 30 minutes. // InhibitDelayMaxSec even further, possibly to 30 minutes.
//Unattended-Upgrade::InstallOnShutdown "false"; //Unattended-Upgrade::InstallOnShutdown "false";
// Send email to this address for problems or packages upgrades // Send email to this address for problems or packages upgrades
// If empty or unset then no email is sent, make sure that you // If empty or unset then no email is sent, make sure that you
// have a working mail setup on your system. A package that provides // have a working mail setup on your system. A package that provides
// 'mailx' must be installed. E.g. "user@example.com" // 'mailx' must be installed. E.g. "user@example.com"
//Unattended-Upgrade::Mail ""; //Unattended-Upgrade::Mail "";
// Set this value to one of: // Set this value to one of:
// "always", "only-on-error" or "on-change" // "always", "only-on-error" or "on-change"
// If this is not set, then any legacy MailOnlyOnError (boolean) value // If this is not set, then any legacy MailOnlyOnError (boolean) value
// is used to chose between "only-on-error" and "on-change" // is used to chose between "only-on-error" and "on-change"
//Unattended-Upgrade::MailReport "on-change"; //Unattended-Upgrade::MailReport "on-change";
// Remove unused automatically installed kernel-related packages // Remove unused automatically installed kernel-related packages
// (kernel images, kernel headers and kernel version locked tools). // (kernel images, kernel headers and kernel version locked tools).
//Unattended-Upgrade::Remove-Unused-Kernel-Packages "true"; //Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";
// Do automatic removal of newly unused dependencies after the upgrade // Do automatic removal of newly unused dependencies after the upgrade
//Unattended-Upgrade::Remove-New-Unused-Dependencies "true"; //Unattended-Upgrade::Remove-New-Unused-Dependencies "true";
// Do automatic removal of unused packages after the upgrade // Do automatic removal of unused packages after the upgrade
// (equivalent to apt-get autoremove) // (equivalent to apt-get autoremove)
//Unattended-Upgrade::Remove-Unused-Dependencies "false"; //Unattended-Upgrade::Remove-Unused-Dependencies "false";
// Automatically reboot *WITHOUT CONFIRMATION* if // Automatically reboot *WITHOUT CONFIRMATION* if
// the file /var/run/reboot-required is found after the upgrade // the file /var/run/reboot-required is found after the upgrade
//Unattended-Upgrade::Automatic-Reboot "false"; //Unattended-Upgrade::Automatic-Reboot "false";
// Automatically reboot even if there are users currently logged in // Automatically reboot even if there are users currently logged in
// when Unattended-Upgrade::Automatic-Reboot is set to true // when Unattended-Upgrade::Automatic-Reboot is set to true
//Unattended-Upgrade::Automatic-Reboot-WithUsers "true"; //Unattended-Upgrade::Automatic-Reboot-WithUsers "true";
// If automatic reboot is enabled and needed, reboot at the specific // If automatic reboot is enabled and needed, reboot at the specific
// time instead of immediately // time instead of immediately
// Default: "now" // Default: "now"
//Unattended-Upgrade::Automatic-Reboot-Time "02:00"; //Unattended-Upgrade::Automatic-Reboot-Time "02:00";
// Use apt bandwidth limit feature, this example limits the download // Use apt bandwidth limit feature, this example limits the download
// speed to 70kb/sec // speed to 70kb/sec
//Acquire::http::Dl-Limit "70"; //Acquire::http::Dl-Limit "70";
// Enable logging to syslog. Default is False // Enable logging to syslog. Default is False
// Unattended-Upgrade::SyslogEnable "false"; // Unattended-Upgrade::SyslogEnable "false";
// Specify syslog facility. Default is daemon // Specify syslog facility. Default is daemon
// Unattended-Upgrade::SyslogFacility "daemon"; // Unattended-Upgrade::SyslogFacility "daemon";
// Download and install upgrades only on AC power // Download and install upgrades only on AC power
// (i.e. skip or gracefully stop updates on battery) // (i.e. skip or gracefully stop updates on battery)
// Unattended-Upgrade::OnlyOnACPower "true"; // Unattended-Upgrade::OnlyOnACPower "true";
// Download and install upgrades only on non-metered connection // Download and install upgrades only on non-metered connection
// (i.e. skip or gracefully stop updates on a metered connection) // (i.e. skip or gracefully stop updates on a metered connection)
// Unattended-Upgrade::Skip-Updates-On-Metered-Connections "true"; // Unattended-Upgrade::Skip-Updates-On-Metered-Connections "true";
// Verbose logging // Verbose logging
// Unattended-Upgrade::Verbose "false"; // Unattended-Upgrade::Verbose "false";
// Print debugging information both in unattended-upgrades and // Print debugging information both in unattended-upgrades and
// in unattended-upgrade-shutdown // in unattended-upgrade-shutdown
// Unattended-Upgrade::Debug "false"; // Unattended-Upgrade::Debug "false";
// Allow package downgrade if Pin-Priority exceeds 1000 // Allow package downgrade if Pin-Priority exceeds 1000
// Unattended-Upgrade::Allow-downgrade "false"; // Unattended-Upgrade::Allow-downgrade "false";
// When APT fails to mark a package to be upgraded or installed try adjusting // When APT fails to mark a package to be upgraded or installed try adjusting
// candidates of related packages to help APT's resolver in finding a solution // candidates of related packages to help APT's resolver in finding a solution
// where the package can be upgraded or installed. // where the package can be upgraded or installed.
// This is a workaround until APT's resolver is fixed to always find a // This is a workaround until APT's resolver is fixed to always find a
// solution if it exists. (See Debian bug #711128.) // solution if it exists. (See Debian bug #711128.)
// The fallback is enabled by default, except on Debian's sid release because // The fallback is enabled by default, except on Debian's sid release because
// uninstallable packages are frequent there. // uninstallable packages are frequent there.
// Disabling the fallback speeds up unattended-upgrades when there are // Disabling the fallback speeds up unattended-upgrades when there are
// uninstallable packages at the expense of rarely keeping back packages which // uninstallable packages at the expense of rarely keeping back packages which
// could be upgraded or installed. // could be upgraded or installed.
// Unattended-Upgrade::Allow-APT-Mark-Fallback "true"; // Unattended-Upgrade::Allow-APT-Mark-Fallback "true";
Unattended-Upgrade::AutoFixInterruptedDpkg "true"; Unattended-Upgrade::AutoFixInterruptedDpkg "true";
Unattended-Upgrade::Remove-Unused-Kernel-Packages "true"; Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";
Unattended-Upgrade::Remove-New-Unused-Dependencies "true"; Unattended-Upgrade::Remove-New-Unused-Dependencies "true";
Unattended-Upgrade::Remove-Unused-Dependencies "true"; Unattended-Upgrade::Remove-Unused-Dependencies "true";
Unattended-Upgrade::Automatic-Reboot "true"; Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-Time "03:00"; Unattended-Upgrade::Automatic-Reboot-Time "03:00";
@@ -1,25 +1,25 @@
# This configuration file is customized by fox # This configuration file is customized by fox
# Optimize system parameters # Optimize system parameters
kernel.panic = 20 kernel.panic = 20
kernel.panic_on_oops = 1 kernel.panic_on_oops = 1
net.core.default_qdisc = fq net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr net.ipv4.tcp_congestion_control = bbr
# Other adjustable system parameters # Other adjustable system parameters
net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.all.log_martians = 1
net.ipv4.igmp_max_memberships = 100 net.ipv4.igmp_max_memberships = 100
net.ipv4.tcp_challenge_ack_limit = 1000 net.ipv4.tcp_challenge_ack_limit = 1000
net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 120 net.ipv4.tcp_keepalive_time = 120
net.ipv4.tcp_max_orphans = 4096 net.ipv4.tcp_max_orphans = 4096
net.ipv4.tcp_max_tw_buckets = 4096 net.ipv4.tcp_max_tw_buckets = 4096
net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_syncookies = 1
net.ipv6.conf.all.use_tempaddr = 0 net.ipv6.conf.all.use_tempaddr = 0
net.ipv6.conf.default.use_tempaddr = 0 net.ipv6.conf.default.use_tempaddr = 0
+46
View File
@@ -0,0 +1,46 @@
# This configuration file is customized by fox,
# Optimize dnsmasq parameters for local DNS server.
# Main Config
conf-file=/etc/dnsmasq.conf
log-facility=/var/log/dnsmasq.log
log-async=20
cache-size=1024
edns-packet-max=1232
rebind-domain-ok=/fox.home.arpa/
bind-dynamic
bogus-priv
domain-needed
expand-hosts
localise-queries
local-service
no-negcache
no-resolv
rebind-localhost-ok
stop-dns-rebind
# DNS Filter
server=/alt/
server=/home.arpa/
server=/ipv4only.arpa/
server=/resolver.arpa/
server=/example/
server=/bind/
server=/invalid/
server=/local/
server=/localhost/
server=/onion/
server=/test/
# DNS Server
server=/fox.home.arpa/172.16.1.1
server=/fox.home.arpa/fdac::1
server=127.0.0.1#8053
server=::1#8053
+52
View File
@@ -0,0 +1,52 @@
# This configuration file is customized by fox,
# Optimize SmartDNS parameters for local DNS server.
#
# For use common DNS server as upstream DNS server,
# please modify 'server' parameter according to
# your network environment.
#
# eg:
# server 119.29.29.29
# server 223.5.5.5
# server 114.114.114.114
# server 2402:4e00::
# server 2400:3200::1
conf-file /etc/smartdns/anti-ad-smartdns.conf
cache-file /tmp/smartdns.cache
bind [::]:8053@lo
bind-tcp [::]:8053@lo
serve-expired yes
serve-expired-ttl 57600
serve-expired-reply-ttl 3
prefetch-domain yes
serve-expired-prefetch-time 28800
speed-check-mode ping,tcp:80,tcp:443
force-qtype-SOA 65
log-level notice
server-tcp 119.29.29.29 -group dnspod -exclude-default-group
server-tcp 2402:4e00:: -group dnspod -exclude-default-group
nameserver /doh.pub/dnspod
nameserver /dot.pub/dnspod
server-tcp 223.5.5.5 -group alidns -exclude-default-group
server-tcp 2400:3200::1 -group alidns -exclude-default-group
nameserver /dns.alidns.com/alidns
server 172.16.1.1 -group intranet -exclude-default-group
server fdac::1 -group intranet -exclude-default-group
nameserver /fox.home.arpa/intranet
domain-rules /fox.home.arpa/ -speed-check-mode none -no-cache
server-tls dot.pub
server-tls dns.alidns.com
server-https https://doh.pub/dns-query
server-https https://dns.alidns.com/dns-query
@@ -1,5 +1,5 @@
APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "5"; APT::Periodic::Unattended-Upgrade "5";
APT::Periodic::AutocleanInterval "1"; APT::Periodic::AutocleanInterval "1";
APT::Periodic::CleanInterval "1"; APT::Periodic::CleanInterval "1";
@@ -1,179 +1,179 @@
// Unattended-Upgrade::Origins-Pattern controls which packages are // Unattended-Upgrade::Origins-Pattern controls which packages are
// upgraded. // upgraded.
// //
// Lines below have the format "keyword=value,...". A // Lines below have the format "keyword=value,...". A
// package will be upgraded only if the values in its metadata match // package will be upgraded only if the values in its metadata match
// all the supplied keywords in a line. (In other words, omitted // all the supplied keywords in a line. (In other words, omitted
// keywords are wild cards.) The keywords originate from the Release // keywords are wild cards.) The keywords originate from the Release
// file, but several aliases are accepted. The accepted keywords are: // file, but several aliases are accepted. The accepted keywords are:
// a,archive,suite (eg, "stable") // a,archive,suite (eg, "stable")
// c,component (eg, "main", "contrib", "non-free") // c,component (eg, "main", "contrib", "non-free")
// l,label (eg, "Debian", "Debian-Security") // l,label (eg, "Debian", "Debian-Security")
// o,origin (eg, "Debian", "Unofficial Multimedia Packages") // o,origin (eg, "Debian", "Unofficial Multimedia Packages")
// n,codename (eg, "jessie", "jessie-updates") // n,codename (eg, "jessie", "jessie-updates")
// site (eg, "http.debian.net") // site (eg, "http.debian.net")
// The available values on the system are printed by the command // The available values on the system are printed by the command
// "apt-cache policy", and can be debugged by running // "apt-cache policy", and can be debugged by running
// "unattended-upgrades -d" and looking at the log file. // "unattended-upgrades -d" and looking at the log file.
// //
// Within lines unattended-upgrades allows 2 macros whose values are // Within lines unattended-upgrades allows 2 macros whose values are
// derived from /etc/debian_version: // derived from /etc/debian_version:
// ${distro_id} Installed origin. // ${distro_id} Installed origin.
// ${distro_codename} Installed codename (eg, "buster") // ${distro_codename} Installed codename (eg, "buster")
Unattended-Upgrade::Origins-Pattern { Unattended-Upgrade::Origins-Pattern {
// Codename based matching: // Codename based matching:
// This will follow the migration of a release through different // This will follow the migration of a release through different
// archives (e.g. from testing to stable and later oldstable). // archives (e.g. from testing to stable and later oldstable).
// Software will be the latest available for the named release, // Software will be the latest available for the named release,
// but the Debian release itself will not be automatically upgraded. // but the Debian release itself will not be automatically upgraded.
"origin=Debian,codename=${distro_codename}-updates"; "origin=Debian,codename=${distro_codename}-updates";
// "origin=Debian,codename=${distro_codename}-proposed-updates"; // "origin=Debian,codename=${distro_codename}-proposed-updates";
"origin=Debian,codename=${distro_codename},label=Debian"; "origin=Debian,codename=${distro_codename},label=Debian";
"origin=Debian,codename=${distro_codename},label=Debian-Security"; "origin=Debian,codename=${distro_codename},label=Debian-Security";
"origin=Debian,codename=${distro_codename}-security,label=Debian-Security"; "origin=Debian,codename=${distro_codename}-security,label=Debian-Security";
"origin=Proxmox,codename=${distro_codename},label=Proxmox Debian Repository"; "origin=Proxmox,codename=${distro_codename},label=Proxmox Debian Repository";
// "origin=Proxmox,codename=${distro_codename},label=Proxmox Ceph Debian Repository"; // "origin=Proxmox,codename=${distro_codename},label=Proxmox Ceph Debian Repository";
// Archive or Suite based matching: // Archive or Suite based matching:
// Note that this will silently match a different release after // Note that this will silently match a different release after
// migration to the specified archive (e.g. testing becomes the // migration to the specified archive (e.g. testing becomes the
// new stable). // new stable).
// "o=Debian,a=stable"; // "o=Debian,a=stable";
// "o=Debian,a=stable-updates"; // "o=Debian,a=stable-updates";
// "o=Debian,a=proposed-updates"; // "o=Debian,a=proposed-updates";
// "o=Debian Backports,a=${distro_codename}-backports,l=Debian Backports"; // "o=Debian Backports,a=${distro_codename}-backports,l=Debian Backports";
}; };
// Python regular expressions, matching packages to exclude from upgrading // Python regular expressions, matching packages to exclude from upgrading
Unattended-Upgrade::Package-Blacklist { Unattended-Upgrade::Package-Blacklist {
// The following matches all packages starting with linux- // The following matches all packages starting with linux-
// "linux-"; // "linux-";
// Use $ to explicitely define the end of a package name. Without // Use $ to explicitely define the end of a package name. Without
// the $, "libc6" would match all of them. // the $, "libc6" would match all of them.
// "libc6$"; // "libc6$";
// "libc6-dev$"; // "libc6-dev$";
// "libc6-i686$"; // "libc6-i686$";
// Special characters need escaping // Special characters need escaping
// "libstdc\+\+6$"; // "libstdc\+\+6$";
// The following matches packages like xen-system-amd64, xen-utils-4.1, // The following matches packages like xen-system-amd64, xen-utils-4.1,
// xenstore-utils and libxenstore3.0 // xenstore-utils and libxenstore3.0
// "(lib)?xen(store)?"; // "(lib)?xen(store)?";
// For more information about Python regular expressions, see // For more information about Python regular expressions, see
// https://docs.python.org/3/howto/regex.html // https://docs.python.org/3/howto/regex.html
}; };
// This option allows you to control if on a unclean dpkg exit // This option allows you to control if on a unclean dpkg exit
// unattended-upgrades will automatically run // unattended-upgrades will automatically run
// dpkg --force-confold --configure -a // dpkg --force-confold --configure -a
// The default is true, to ensure updates keep getting installed // The default is true, to ensure updates keep getting installed
//Unattended-Upgrade::AutoFixInterruptedDpkg "true"; //Unattended-Upgrade::AutoFixInterruptedDpkg "true";
// Split the upgrade into the smallest possible chunks so that // Split the upgrade into the smallest possible chunks so that
// they can be interrupted with SIGTERM. This makes the upgrade // they can be interrupted with SIGTERM. This makes the upgrade
// a bit slower but it has the benefit that shutdown while a upgrade // a bit slower but it has the benefit that shutdown while a upgrade
// is running is possible (with a small delay) // is running is possible (with a small delay)
//Unattended-Upgrade::MinimalSteps "true"; //Unattended-Upgrade::MinimalSteps "true";
// Install all updates when the machine is shutting down // Install all updates when the machine is shutting down
// instead of doing it in the background while the machine is running. // instead of doing it in the background while the machine is running.
// This will (obviously) make shutdown slower. // This will (obviously) make shutdown slower.
// Unattended-upgrades increases logind's InhibitDelayMaxSec to 30s. // Unattended-upgrades increases logind's InhibitDelayMaxSec to 30s.
// This allows more time for unattended-upgrades to shut down gracefully // This allows more time for unattended-upgrades to shut down gracefully
// or even install a few packages in InstallOnShutdown mode, but is still a // or even install a few packages in InstallOnShutdown mode, but is still a
// big step back from the 30 minutes allowed for InstallOnShutdown previously. // big step back from the 30 minutes allowed for InstallOnShutdown previously.
// Users enabling InstallOnShutdown mode are advised to increase // Users enabling InstallOnShutdown mode are advised to increase
// InhibitDelayMaxSec even further, possibly to 30 minutes. // InhibitDelayMaxSec even further, possibly to 30 minutes.
//Unattended-Upgrade::InstallOnShutdown "false"; //Unattended-Upgrade::InstallOnShutdown "false";
// Send email to this address for problems or packages upgrades // Send email to this address for problems or packages upgrades
// If empty or unset then no email is sent, make sure that you // If empty or unset then no email is sent, make sure that you
// have a working mail setup on your system. A package that provides // have a working mail setup on your system. A package that provides
// 'mailx' must be installed. E.g. "user@example.com" // 'mailx' must be installed. E.g. "user@example.com"
//Unattended-Upgrade::Mail ""; //Unattended-Upgrade::Mail "";
// Set this value to one of: // Set this value to one of:
// "always", "only-on-error" or "on-change" // "always", "only-on-error" or "on-change"
// If this is not set, then any legacy MailOnlyOnError (boolean) value // If this is not set, then any legacy MailOnlyOnError (boolean) value
// is used to chose between "only-on-error" and "on-change" // is used to chose between "only-on-error" and "on-change"
//Unattended-Upgrade::MailReport "on-change"; //Unattended-Upgrade::MailReport "on-change";
// Remove unused automatically installed kernel-related packages // Remove unused automatically installed kernel-related packages
// (kernel images, kernel headers and kernel version locked tools). // (kernel images, kernel headers and kernel version locked tools).
//Unattended-Upgrade::Remove-Unused-Kernel-Packages "true"; //Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";
// Do automatic removal of newly unused dependencies after the upgrade // Do automatic removal of newly unused dependencies after the upgrade
//Unattended-Upgrade::Remove-New-Unused-Dependencies "true"; //Unattended-Upgrade::Remove-New-Unused-Dependencies "true";
// Do automatic removal of unused packages after the upgrade // Do automatic removal of unused packages after the upgrade
// (equivalent to apt-get autoremove) // (equivalent to apt-get autoremove)
//Unattended-Upgrade::Remove-Unused-Dependencies "false"; //Unattended-Upgrade::Remove-Unused-Dependencies "false";
// Automatically reboot *WITHOUT CONFIRMATION* if // Automatically reboot *WITHOUT CONFIRMATION* if
// the file /var/run/reboot-required is found after the upgrade // the file /var/run/reboot-required is found after the upgrade
//Unattended-Upgrade::Automatic-Reboot "false"; //Unattended-Upgrade::Automatic-Reboot "false";
// Automatically reboot even if there are users currently logged in // Automatically reboot even if there are users currently logged in
// when Unattended-Upgrade::Automatic-Reboot is set to true // when Unattended-Upgrade::Automatic-Reboot is set to true
//Unattended-Upgrade::Automatic-Reboot-WithUsers "true"; //Unattended-Upgrade::Automatic-Reboot-WithUsers "true";
// If automatic reboot is enabled and needed, reboot at the specific // If automatic reboot is enabled and needed, reboot at the specific
// time instead of immediately // time instead of immediately
// Default: "now" // Default: "now"
//Unattended-Upgrade::Automatic-Reboot-Time "02:00"; //Unattended-Upgrade::Automatic-Reboot-Time "02:00";
// Use apt bandwidth limit feature, this example limits the download // Use apt bandwidth limit feature, this example limits the download
// speed to 70kb/sec // speed to 70kb/sec
//Acquire::http::Dl-Limit "70"; //Acquire::http::Dl-Limit "70";
// Enable logging to syslog. Default is False // Enable logging to syslog. Default is False
// Unattended-Upgrade::SyslogEnable "false"; // Unattended-Upgrade::SyslogEnable "false";
// Specify syslog facility. Default is daemon // Specify syslog facility. Default is daemon
// Unattended-Upgrade::SyslogFacility "daemon"; // Unattended-Upgrade::SyslogFacility "daemon";
// Download and install upgrades only on AC power // Download and install upgrades only on AC power
// (i.e. skip or gracefully stop updates on battery) // (i.e. skip or gracefully stop updates on battery)
// Unattended-Upgrade::OnlyOnACPower "true"; // Unattended-Upgrade::OnlyOnACPower "true";
// Download and install upgrades only on non-metered connection // Download and install upgrades only on non-metered connection
// (i.e. skip or gracefully stop updates on a metered connection) // (i.e. skip or gracefully stop updates on a metered connection)
// Unattended-Upgrade::Skip-Updates-On-Metered-Connections "true"; // Unattended-Upgrade::Skip-Updates-On-Metered-Connections "true";
// Verbose logging // Verbose logging
// Unattended-Upgrade::Verbose "false"; // Unattended-Upgrade::Verbose "false";
// Print debugging information both in unattended-upgrades and // Print debugging information both in unattended-upgrades and
// in unattended-upgrade-shutdown // in unattended-upgrade-shutdown
// Unattended-Upgrade::Debug "false"; // Unattended-Upgrade::Debug "false";
// Allow package downgrade if Pin-Priority exceeds 1000 // Allow package downgrade if Pin-Priority exceeds 1000
// Unattended-Upgrade::Allow-downgrade "false"; // Unattended-Upgrade::Allow-downgrade "false";
// When APT fails to mark a package to be upgraded or installed try adjusting // When APT fails to mark a package to be upgraded or installed try adjusting
// candidates of related packages to help APT's resolver in finding a solution // candidates of related packages to help APT's resolver in finding a solution
// where the package can be upgraded or installed. // where the package can be upgraded or installed.
// This is a workaround until APT's resolver is fixed to always find a // This is a workaround until APT's resolver is fixed to always find a
// solution if it exists. (See Debian bug #711128.) // solution if it exists. (See Debian bug #711128.)
// The fallback is enabled by default, except on Debian's sid release because // The fallback is enabled by default, except on Debian's sid release because
// uninstallable packages are frequent there. // uninstallable packages are frequent there.
// Disabling the fallback speeds up unattended-upgrades when there are // Disabling the fallback speeds up unattended-upgrades when there are
// uninstallable packages at the expense of rarely keeping back packages which // uninstallable packages at the expense of rarely keeping back packages which
// could be upgraded or installed. // could be upgraded or installed.
// Unattended-Upgrade::Allow-APT-Mark-Fallback "true"; // Unattended-Upgrade::Allow-APT-Mark-Fallback "true";
Unattended-Upgrade::AutoFixInterruptedDpkg "true"; Unattended-Upgrade::AutoFixInterruptedDpkg "true";
Unattended-Upgrade::Remove-Unused-Kernel-Packages "true"; Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";
Unattended-Upgrade::Remove-New-Unused-Dependencies "true"; Unattended-Upgrade::Remove-New-Unused-Dependencies "true";
Unattended-Upgrade::Remove-Unused-Dependencies "true"; Unattended-Upgrade::Remove-Unused-Dependencies "true";
Unattended-Upgrade::Automatic-Reboot "true"; Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-Time "02:30"; Unattended-Upgrade::Automatic-Reboot-Time "02:30";
@@ -1,23 +1,23 @@
### Editing /etc/systemd/system/apt-daily-upgrade.timer.d/override.conf ### Editing /etc/systemd/system/apt-daily-upgrade.timer.d/override.conf
### Anything between here and the comment below will become the new contents of the file ### Anything between here and the comment below will become the new contents of the file
[Timer] [Timer]
OnCalendar= OnCalendar=
OnCalendar=01:30 OnCalendar=01:30
RandomizedDelaySec=0 RandomizedDelaySec=0
### Lines below this comment will be discarded ### Lines below this comment will be discarded
### /lib/systemd/system/apt-daily-upgrade.timer ### /lib/systemd/system/apt-daily-upgrade.timer
# [Unit] # [Unit]
# Description=Daily apt upgrade and clean activities # Description=Daily apt upgrade and clean activities
# After=apt-daily.timer # After=apt-daily.timer
# #
# [Timer] # [Timer]
# OnCalendar=*-*-* 6:00 # OnCalendar=*-*-* 6:00
# RandomizedDelaySec=60m # RandomizedDelaySec=60m
# Persistent=true # Persistent=true
# #
# [Install] # [Install]
# WantedBy=timers.target # WantedBy=timers.target
@@ -1,101 +1,101 @@
#!/bin/sh #!/bin/sh
### BEGIN INIT INFO ### BEGIN INIT INFO
# Provides: cpufrequtils # Provides: cpufrequtils
# Required-Start: $remote_fs loadcpufreq # Required-Start: $remote_fs loadcpufreq
# Required-Stop: # Required-Stop:
# Default-Start: 2 3 4 5 # Default-Start: 2 3 4 5
# Default-Stop: # Default-Stop:
# Short-Description: set CPUFreq kernel parameters # Short-Description: set CPUFreq kernel parameters
# Description: utilities to deal with CPUFreq Linux # Description: utilities to deal with CPUFreq Linux
# kernel support # kernel support
### END INIT INFO ### END INIT INFO
# #
DESC="CPUFreq Utilities" DESC="CPUFreq Utilities"
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
CPUFREQ_SET=/usr/bin/cpufreq-set CPUFREQ_SET=/usr/bin/cpufreq-set
CPUFREQ_INFO=/usr/bin/cpufreq-info CPUFREQ_INFO=/usr/bin/cpufreq-info
CPUFREQ_OPTIONS="" CPUFREQ_OPTIONS=""
# use lsb-base # use lsb-base
. /lib/lsb/init-functions . /lib/lsb/init-functions
# Which governor to use. Must be one of the governors listed in: # Which governor to use. Must be one of the governors listed in:
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
# #
# and which limits to set. Both MIN_SPEED and MAX_SPEED must be values # and which limits to set. Both MIN_SPEED and MAX_SPEED must be values
# listed in: # listed in:
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
# a value of 0 for any of the two variables will disabling the use of # a value of 0 for any of the two variables will disabling the use of
# that limit variable. # that limit variable.
# #
# WARNING: the correct kernel module must already be loaded or compiled in. # WARNING: the correct kernel module must already be loaded or compiled in.
# #
# Set ENABLE to "true" to let the script run at boot time. # Set ENABLE to "true" to let the script run at boot time.
# #
# eg: ENABLE="true" # eg: ENABLE="true"
# GOVERNOR="ondemand" # GOVERNOR="ondemand"
# MAX_SPEED=1000 # MAX_SPEED=1000
# MIN_SPEED=500 # MIN_SPEED=500
ENABLE="true" ENABLE="true"
GOVERNOR="powersave" GOVERNOR="powersave"
MAX_SPEED="0" MAX_SPEED="0"
MIN_SPEED="0" MIN_SPEED="0"
check_governor_avail() { check_governor_avail() {
info="/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors" info="/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors"
if [ -f $info ] && grep -q "\<$GOVERNOR\>" $info ; then if [ -f $info ] && grep -q "\<$GOVERNOR\>" $info ; then
return 0; return 0;
fi fi
return 1; return 1;
} }
[ -x $CPUFREQ_SET ] || exit 0 [ -x $CPUFREQ_SET ] || exit 0
if [ -f /etc/default/cpufrequtils ] ; then if [ -f /etc/default/cpufrequtils ] ; then
. /etc/default/cpufrequtils . /etc/default/cpufrequtils
fi fi
# if not enabled then exit gracefully # if not enabled then exit gracefully
[ "$ENABLE" = "true" ] || exit 0 [ "$ENABLE" = "true" ] || exit 0
if [ -n "$MAX_SPEED" ] && [ $MAX_SPEED != "0" ] ; then if [ -n "$MAX_SPEED" ] && [ $MAX_SPEED != "0" ] ; then
CPUFREQ_OPTIONS="$CPUFREQ_OPTIONS --max $MAX_SPEED" CPUFREQ_OPTIONS="$CPUFREQ_OPTIONS --max $MAX_SPEED"
fi fi
if [ -n "$MIN_SPEED" ] && [ $MIN_SPEED != "0" ] ; then if [ -n "$MIN_SPEED" ] && [ $MIN_SPEED != "0" ] ; then
CPUFREQ_OPTIONS="$CPUFREQ_OPTIONS --min $MIN_SPEED" CPUFREQ_OPTIONS="$CPUFREQ_OPTIONS --min $MIN_SPEED"
fi fi
if [ -n "$GOVERNOR" ] ; then if [ -n "$GOVERNOR" ] ; then
CPUFREQ_OPTIONS="$CPUFREQ_OPTIONS --governor $GOVERNOR" CPUFREQ_OPTIONS="$CPUFREQ_OPTIONS --governor $GOVERNOR"
fi fi
CPUS=$(cat /proc/stat|sed -ne 's/^cpu\([[:digit:]]\+\).*/\1/p') CPUS=$(cat /proc/stat|sed -ne 's/^cpu\([[:digit:]]\+\).*/\1/p')
RETVAL=0 RETVAL=0
case "$1" in case "$1" in
start|force-reload|restart|reload) start|force-reload|restart|reload)
log_action_begin_msg "$DESC: Setting $GOVERNOR CPUFreq governor" log_action_begin_msg "$DESC: Setting $GOVERNOR CPUFreq governor"
if check_governor_avail ; then if check_governor_avail ; then
for cpu in $CPUS ; do for cpu in $CPUS ; do
log_action_cont_msg "CPU${cpu}" log_action_cont_msg "CPU${cpu}"
$CPUFREQ_SET --cpu $cpu $CPUFREQ_OPTIONS 2>&1 > /dev/null || \ $CPUFREQ_SET --cpu $cpu $CPUFREQ_OPTIONS 2>&1 > /dev/null || \
RETVAL=$? RETVAL=$?
done done
log_action_end_msg $RETVAL "" log_action_end_msg $RETVAL ""
else else
log_action_cont_msg "disabled, governor not available" log_action_cont_msg "disabled, governor not available"
log_action_end_msg $RETVAL log_action_end_msg $RETVAL
fi fi
;; ;;
stop) stop)
;; ;;
*) *)
echo "Usage: $0 {start|stop|restart|reload|force-reload}" echo "Usage: $0 {start|stop|restart|reload|force-reload}"
exit 1 exit 1
esac esac
exit 0 exit 0