วิธีแสดงทั้งหมด apt-get Dpkg :: Options และค่าปัจจุบันของพวกมัน


8

นั่นคือ

apt-get -o Dpkg::Options::="--force-confnew"

และ

apt-get -o Dpkg::Options::="--force-confold"

และอื่น ๆ อีกมากมาย.

ฉันจะรับรายการค่าทั้งหมดDpkg::Optionsและค่าที่ตั้งไว้ในปัจจุบันได้อย่างไร

คำตอบ:


14

น่าเสียดายที่apt-config dumpไม่แสดงรายการตัวเลือก dpkg ที่คุณต้องการ man dpkgช่วยฉันค้นหาคำสั่งนี้--force-helpซึ่งเฉพาะเจาะจงมากขึ้นกับforceตัวเลือกdpkg เฉพาะที่คุณสนใจ แต่ไม่ใช่รายการตัวเลือกที่ครอบคลุม:

$ dpkg --force-help
dpkg forcing options - control behaviour when problems found:
  warn but continue:  --force-<thing>,<thing>,...
  stop with error:    --refuse-<thing>,<thing>,... | --no-force-<thing>,...
 Forcing things:
  [!] all                Set all force options
  [*] downgrade          Replace a package with a lower version
      configure-any      Configure any package which may help this one
      hold               Process incidental packages even when on hold
      not-root           Try to (de)install things even when not root
      bad-path           PATH is missing important programs, problems likely
      bad-verify         Install a package even if it fails authenticity check
      bad-version        Process even packages with wrong versions
      overwrite          Overwrite a file from one package with another
      overwrite-diverted Overwrite a diverted file with an undiverted version
  [!] overwrite-dir      Overwrite one package's directory with another's file
  [!] unsafe-io          Do not perform safe I/O operations when unpacking
  [!] confnew            Always use the new config files, don't prompt
  [!] confold            Always use the old config files, don't prompt
  [!] confdef            Use the default option for new config files if one
                         is available, don't prompt. If no default can be found,
                         you will be prompted unless one of the confold or
                         confnew options is also given
  [!] confmiss           Always install missing config files
  [!] confask            Offer to replace config files with no new versions
  [!] architecture       Process even packages with wrong or no architecture
  [!] breaks             Install even if it would break another package
  [!] conflicts          Allow installation of conflicting packages
  [!] depends            Turn all dependency problems into warnings
  [!] depends-version    Turn dependency version problems into warnings
  [!] remove-reinstreq   Remove packages which require installation
  [!] remove-essential   Remove an essential package

WARNING - use of options marked [!] can seriously damage your installation.
Forcing options marked [*] are enabled by default.

สิ่งนี้มีประโยชน์เช่นเดียวกับlinux.die.net/man/1/dpkg (ดูใน--force-*things*ส่วน) แต่ไม่แสดงค่าชุดปัจจุบันตามที่ร้องขอโดย OP
thom_nic

ฉันควรจะกล่าวถึงว่าapt-config dump จะมีรายการDpkg::Optionsแต่ถ้ามีการตั้งค่าบางอย่างเช่น/etc/apt/apt.conf.d/มา Sa askubuntu.com/a/104912/399010
thom_nic


0

คำตอบสั้น ๆ : dpkg --force-help

ฉันไม่เห็นด้วยกับคำตอบที่ยอมรับ แม้ว่าดั๊มพ์การกำหนดค่า apt-config จะมีประโยชน์สำหรับการดูตัวเลือกที่เปิดใช้งานในปัจจุบัน - ตัวเลือกหลายตัวที่มีประโยชน์โดยทั่วไปสำหรับการใช้งาน apt อย่างง่าย - มันไม่แสดงตัวเลือกทั้งหมดสำหรับการกระทำ dpkg ได้แก่ ตัวเลือก "บังคับ" คำถามเดิมหมายถึง สำหรับการดูที่ตัวเลือกเพิ่มเติมเหล่านี้มีการใช้งานโดยค่าเริ่มต้นเช่นเดียวกับตัวเลือกที่ควรจะมีการเปลี่ยนแปลงเมื่อมีความจำเป็นอย่างสมบูรณ์โดยผู้ใช้สันทัดกรณีหนึ่งต้องใช้ความช่วยเหลือที่ให้ไว้ (จาก CLI) dpkg --force-helpโดย man page สำหรับ dpkg จัดเตรียมคำอธิบายแบบย่อของเอาต์พุตของแฟล็กนี้ภายใต้ส่วนที่อธิบาย--force-*things*แฟล็กสำหรับdpkgคำสั่ง หน้าคนนี้สามารถดูได้ทางออนไลน์: http://man7.org/linux/man-pages/man1/dpkg.1.html https://linux.die.net/man/1/dpkg (เหล่านี้เป็นเพียงสถานที่สองสามแห่ง)

โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.