ich führe es apt-get
wie folgt aus:
rm -rf /var/lib/apt/lists/*'
apt-get clean
apt-get --option Acquire::Check-Valid-Until=false update
DEBIAN_FRONTEND=noninteractive apt-get --yes --option Dpkg::Options::="--force-confdef" --option Dpkg::Options::="--force-confold" upgrade
DEBIAN_FRONTEND=noninteractive apt-get --yes --option Dpkg::Options::="--force-confdef" --option Dpkg::Options::="--force-confold" dist-upgrade
apt-get autoremove --yes --force-yes
apt-get clean
ich möchte die Optionen aus einer Konfigurationsdatei entfernen, sodass /etc/apt/apt.conf.d/
die Befehle ohne Angabe dieser Optionen ausgeführt werden können und sie trotzdem berücksichtigt werden. Insbesondere möchte ich Folgendes entfernen:
--option Acquire::Check-Valid-Until=false
ausapt-get update
DEBIAN_FRONTEND=noninteractive
und--yes --option Dpkg::Options::="--force-confdef" --option Dpkg::Options::="--force-confold"
vonapt-get upgrade
undapt-get dist-upgrade
--yes --force-yes
ausapt-get autoremove
und obwohl ich mir dieHandbuchseiten, ich konnte nicht herausfinden, wie man es richtig macht.
ich würde mich über eine detaillierte Erklärung freuen, wie das erreicht werden kann.
falls nötig, hier ein paar Informationen zu meinem System:
$ cat /etc/*release* | grep -i dist
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"
$ dpkg -l | grep -i apt | head -n 1
ii apt 1.2.15ubuntu0.2 amd64 commandline package manager
Antwort1
--option
Sie können die Teile auch ohne =
zur Datei hinzufügen :
Acquire::Check-Valid-Until "false";
Dpkg::Options:: "--force-confdef";
Dpkg::Options:: "--force-confold";
--yes
Was und betrifft --force-yes
, dieapt-get
manpagesagt:
-y, --yes, --assume-yes
Automatic yes to prompts; assume "yes" as answer to all prompts and
run non-interactively. If an undesirable situation, such as
changing a held package, trying to install a unauthenticated
package or removing an essential package occurs then apt-get will
abort. Configuration Item: APT::Get::Assume-Yes.
--force-yes
Force yes; this is a dangerous option that will cause apt to
continue without prompting if it is doing something potentially
harmful. It should not be used except in very special situations.
Using force-yes can potentially destroy your system! Configuration
Item: APT::Get::force-yes. This is deprecated and replaced by
--allow-downgrades, --allow-remove-essential,
--allow-change-held-packages in 1.1.
Also:
APT::Get::Assume-Yes "true";
APT::Get::force-yes "true";
Die zweite Zeile sollten Sie durch Zeilen ersetzen APT::Get::allow-downgrades
, APT::Get::allow-remove-essential
die eine oder mehrere der folgenden Aussagen APT::Get::allow-change-held-packages
auf „true“ setzen.
DEBIAN_FRONTEND=noninteractive
ist eine Debconf-Einstellung und sollte in gesetzt werden debconf.conf
. Diemanpagehat Beispiele.
Ich empfehle Ihnen dringend, ein Skript zu schreiben, anstatt diese in Konfigurationsdateien festzulegen. Außerdem hat es keinen Sinn, upgrade
vor dem ein auszuführen dist-upgrade
– das dist-upgrade
allein reicht aus.