From 43b056b04db85a00e16421b162ce67cf0073a88d Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Sun, 17 Apr 2022 23:55:08 +0200 Subject: [PATCH] Added dpkg notes to the knowledge base --- knowledge base/linux/debian linux.md | 2 ++ knowledge base/linux/dkpg.md | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 knowledge base/linux/dkpg.md diff --git a/knowledge base/linux/debian linux.md b/knowledge base/linux/debian linux.md index 6bd7cea..feb8d2a 100644 --- a/knowledge base/linux/debian linux.md +++ b/knowledge base/linux/debian linux.md @@ -3,8 +3,10 @@ ## Further readings - The [APT] package manager +- [Dpkg] - [Advice for new users on not breaking their Debian system] [apt]: apt.md +[dpkg]: dpkg.md [advice for new users on not breaking their debian system]: https://wiki.debian.org/DontBreakDebian diff --git a/knowledge base/linux/dkpg.md b/knowledge base/linux/dkpg.md new file mode 100644 index 0000000..539044f --- /dev/null +++ b/knowledge base/linux/dkpg.md @@ -0,0 +1,27 @@ +# Dpkg + +## TL;DR + +```shell +# add an extra architecture +dpkg --add-architecture i386 + +# list extra architectures +dpkg --print-foreign-architectures + +# list available extra architectures +dpkg-architecture --list-known + +#list all installed packages of the i386 architecture +dpkg --get-selections | grep i386 | awk '{print $1}' + +# remove the i386 architecture +apt-get purge $(dpkg --get-selections | grep --color=never i386 | awk '{print $1}') +dpkg --remove-architecture i386 +``` + +## Further readings + +- [How to check if dpkg-architecture --list has all the architectures?] + +[how to check if dpkg-architecture --list has all the architectures?]: https://askubuntu.com/questions/852115/how-to-check-if-dpkg-architecture-list-has-all-the-architectures#852120