Thursday, May 2, 2024
24
rated 0 times [  24] [ 0]  / answers: 1 / hits: 6770  / 2 Years ago, fri, december 24, 2021, 2:56:49

I already use apt-get for most of my package management. Yet, there are times when I occasionally need to use Synaptic to do certain things. I would like to learn the equivalent commands for doing the following things in Synaptic:




  • Check a package's dependencies / dependent packages. (This can be done in Synaptic by viewing the properties of a package).

  • Browse available packages

  • Search (in package names as well as the details/descriptions) for some key. (The search function at the top of synaptic)

  • Check if a package is installed or not



Also, is there a way to find packages that are no longer necessary (e.g. a package no longer in use because I removed a dependency). I have a feeling my system is terribly bloated because I removed certain programs and not all the dependencies went with them.


More From » command-line

 Answers
6

  • Check a package's dependencies / dependent packages. (This can be done in Synaptic by viewing the properties of a package):



    apt-cache depend 'package-name'
    apt-cache rdepend 'package-name'

  • Browse available packages



    apt-cache pkgnames
    apt-cache search '.*'
    apt-cache show 'package-name'

  • Search (in package names as well as the details/descriptions) for some key. (The search function at the top of synaptic)



    apt-cache search pattern
    apt-cache --names-only search pattern

  • Check if a package is installed or not



    dpkg -l | grep package-name



The last one could not give the desired result, because when the terminal width is narrow the columns are truncated. Safer alternatives are



dpkg-query -Wf '${Package}
' | grep pkg
dpkg --get-selections | grep pkg

[#43125] Saturday, December 25, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
iedncommon

Total Points: 200
Total Questions: 95
Total Answers: 132

Location: Tonga
Member since Mon, Aug 2, 2021
3 Years ago
iedncommon questions
Sat, Jun 4, 22, 18:20, 2 Years ago
Mon, Apr 4, 22, 08:10, 2 Years ago
Tue, Jul 6, 21, 15:11, 3 Years ago
;