User Tools

Site Tools


devop:apt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

devop:apt [2025/10/30] – created hayatidevop:apt [Unknown date] (current) – external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
 +~~NOTRANS~~
 +
 +====== packages with debian/ubuntu ======
 +
 +===== list installed packages =====
 +
 +https://askubuntu.com/questions/17823/how-to-list-all-installed-packages
 +
 +<code>
 +apt list --installed
 +
 +dpkg --get-selections | grep <bla>
 +dpkg --get-selections | grep -v deinstall >list.txt
 +
 +dpkg --get-selections > list.txt
 +
 +# clear: to deinstall any packages not in list given to following --set-selections.
 +dpkg --clear-selections
 +sudo dpkg --set-selections < list.txt
 +</code>
 +
 +
 +===== find / list available packages =====
 +
 +https://askubuntu.com/questions/160897/how-do-i-search-for-available-packages-from-the-command-line
 +
 +<code>
 +apt-cache search <keyword>
 +</code>
 +
 +
 +===== list package dependencies =====
 +
 +<code>
 +apt-cache depends <package_name>
 +apt-cache rdepends <package_name>
 +</code>
 +
 +
 +===== list files of package or of installed files =====
 +
 +  * https://superuser.com/questions/82923/how-to-list-files-of-a-debian-package-without-install
 +  * https://askubuntu.com/questions/160897/how-do-i-search-for-available-packages-from-the-command-line
 +  * https://askubuntu.com/questions/32507/how-do-i-get-a-list-of-installed-files-from-a-package
 +
 +<code>
 +sudo apt-get install apt-file
 +sudo apt-file update
 +
 +apt-file list <package_name>
 +# apt-file list pigpiod
 +
 +apt-cache search <keyword>
 +# apt-cache search rabbitmq
 +
 +dpkg -L <package_name>   # -L == --listfiles
 +# dpkg -L librabbitmq-dev
 +</code>
 +
 +
 +===== find package, owning a file =====
 +
 +see https://www.cyberciti.biz/faq/equivalent-of-rpm-qf-command/
 +
 +<code>
 +dpkg -S <file>
 +</code>
 +
 +===== force reinstall =====
 +
 +<code>
 +apt-get --reinstall install <package>
 +</code>
 +