ubuntuusers.de

Einrichten von unattended-upgrades per Script funktioniert nicht

Status: Gelöst | Ubuntu-Version: Ubuntu 20.04 (Focal Fossa)
Antworten |

dragnod0

Anmeldungsdatum:
28. April 2008

Beiträge: 63

EDIT: Ich habe den Fehler selbst gefunden ... ich habe hinter den Einträgen je ein Gänsefüßchen zu viel gehabt. Jetzt geht es. Manchmal sieht man den Wald vor lauter Bäumen nicht mehr xD

Hallo zusammen. ich habe mir einen Script gebastelt den ich nach einer Installation ausführe um mir einiges an Einrichtungsarbeit zu ersparen. Da ich nicht jedes mal unattended-upgrades neu einrichten will habe ich versucht das den Script machen zu lassen. Leider meldet APT danach einen Syntaxfehler.

Syntaxfehler /etc/apt/apt.conf.d/50unattended-upgrades:3: Missgestaltete Markierung

Hier ist der teil meines Scriptes das die Config neu schreibt:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
echo -e "\033[32m\033[1m>>>>> Automatische Updates werden eingerichtet <<<<<\033[0m"
sudo rm /etc/apt/apt.conf.d/10periodic
sudo touch /etc/apt/apt.conf.d/10periodic
sudo echo 'APT::Periodic::Update-Package-Lists "1";' >> /etc/apt/apt.conf.d/10periodic
sudo echo 'APT::Periodic::Download-Upgradeable-Packages "1";' >> /etc/apt/apt.conf.d/10periodic
sudo echo 'APT::Periodic::Unattended-Upgrade "1";' >> /etc/apt/apt.conf.d/10periodic
sudo echo 'APT::Periodic::AotocleanInterval "3";' >> /etc/apt/apt.conf.d/10periodic
sudo rm /etc/apt/apt.conf.d/50unattended-upgrades
sudo touch /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo "Unattended-Upgrade::Allowed-Origins {" >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo '	"${distro_id}:${distro_codename}";"' >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo '	"${distro_id}:${distro_codename}-security";"' >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo '	"${distro_id}ESMApps:${distro_codename}-apps-security";"' >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo '	"${distro_id}ESM:${distro_codename}-infra-security";"' >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo '	"${distro_id}:${distro_codename}-updates";"' >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo '	"${distro_id}:${distro_codename}-proposed";"' >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo '	"${distro_id}:${distro_codename}-backports";"' >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo '	"*;*"' >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo "};" >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo "Unattended-Upgrade::Package-Blacklist {" >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo "};" >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo 'Unattended-Upgrade::DevRelease "auto";' >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo 'Unattended-Upgrade::AutoFixInterruptedDpkg "true";' >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo 'Unattended-Upgrade::MinimalSteps "true";' >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo 'Unattended-Upgrade::InstallOnShutdown "true";' >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo 'Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";' >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo 'Unattended-Upgrade::Remove-New-Unused-Dependencies "true";' >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo 'Unattended-Upgrade::Remove-Unused-Dependencies "true";' >> /etc/apt/apt.conf.d/50unattended-upgrades
sudo echo " " >>  /etc/apt/apt.conf.d/50unattended-upgrades
sudo rm -f /etc/apt/apt.conf.d/local
sudo touch /etc/apt/apt.conf.d/local
sudo echo 'Dpkg::Options {' >> /etc/apt/apt.conf.d/local
sudo echo '   "--force-confdef";' >> /etc/apt/apt.conf.d/local
sudo echo '   "--force-confold";' >> /etc/apt/apt.conf.d/local
sudo echo '}' >> /etc/apt/apt.conf.d/local

Die 50unattended-upgrades sieht dann so aus:

Unattended-Upgrade::Allowed-Origins {
	"${distro_id}:${distro_codename}";"
	"${distro_id}:${distro_codename}-security";"
	"${distro_id}ESMApps:${distro_codename}-apps-security";"
	"${distro_id}ESM:${distro_codename}-infra-security";"
	"${distro_id}:${distro_codename}-updates";"
	"${distro_id}:${distro_codename}-proposed";"
	"${distro_id}:${distro_codename}-backports";"
	"*;*"
};
Unattended-Upgrade::Package-Blacklist {
};
Unattended-Upgrade::DevRelease "auto";
Unattended-Upgrade::AutoFixInterruptedDpkg "true";
Unattended-Upgrade::MinimalSteps "true";
Unattended-Upgrade::InstallOnShutdown "true";
Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";
Unattended-Upgrade::Remove-New-Unused-Dependencies "true";
Unattended-Upgrade::Remove-Unused-Dependencies "true";
 

Im Prinzip ist es also nur das was in der Original Datei steht nur ohne das was eh auskommentiert ist. Was übersehe ich? Ich wäre dankbar wenn jemand eine Lösung hätte.

Antworten |