From e2c5b71575079530f4cf2d51875bacea276e2cac Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Mon, 30 Jan 2023 12:59:09 +0100 Subject: [PATCH] Added how to reconfigure a package --- knowledge base/apt.md | 24 +++++++++++++++++++++++- knowledge base/dpkg.md | 3 +++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/knowledge base/apt.md b/knowledge base/apt.md index 02516aa..c286317 100644 --- a/knowledge base/apt.md +++ b/knowledge base/apt.md @@ -51,6 +51,7 @@ sudo apt-mark auto $(sudo apt-mark showmanual) # Reconfigure packages. sudo dpkg-reconfigure 'mariadb-server' +sudo dpkg-reconfigure -p 'low' 'unattended-upgrades' ``` ## Automate security upgrades @@ -58,6 +59,9 @@ sudo dpkg-reconfigure 'mariadb-server' Leverage `unattended-upgrades` for this. ```sh +# Configure the packages to keep up to date. +sudo dpkg-reconfigure -p 'low' 'unattended-upgrades' + # Check what packages would be installed. sudo unattended-upgrade -d --dry-run @@ -65,6 +69,19 @@ sudo unattended-upgrade -d --dry-run sudo unattended-upgrade ``` +## Troubleshooting + +### Fix a "Problem with MergeList" or "status file could not be parsed" error + +> E: Encountered a section with no Package: header +> E: Problem with MergeList /var/lib/apt/lists/deb.debian.org_debian_dists_bullseye_main_i18n_Translation-en +> E: The package lists or status file could not be parsed or opened. + +```sh +sudo rm -vrf '/var/lib/apt/lists/'* +sudo apt update +``` + ## Further readings - [Apt configuration] @@ -72,8 +89,13 @@ sudo unattended-upgrade - [Unattended Upgrades] - [cheat.sh] +## Sources + +- [Fix a "Problem with MergeList" or "status file could not be parsed" error] + [apt configuration]: https://wiki.debian.org/AptConfiguration [configuring apt sources]: https://wiki.debian.org/SourcesList [unattended upgrades]: https://wiki.debian.org/UnattendedUpgrades -[cheat.sh]: +[cheat.sh]: https://cheat.sh/apt +[fix a "problem with mergelist" or "status file could not be parsed" error]: https://askubuntu.com/questions/30072/how-do-i-fix-a-problem-with-mergelist-or-status-file-could-not-be-parsed-err#30199 diff --git a/knowledge base/dpkg.md b/knowledge base/dpkg.md index c0d0354..d27d38f 100644 --- a/knowledge base/dpkg.md +++ b/knowledge base/dpkg.md @@ -3,6 +3,9 @@ ## TL;DR ```sh +# Reconfigure a package. +dpkg-reconfigure --priority low unattended-upgrades + # add an extra architecture dpkg --add-architecture i386