You get a bonus - 1 coin for daily activity. Now you have 1 coin

Debian / Ubuntu: Searching for Packages and Package Information with apt and aptitude

Practice



In new versions of Ubuntu and Kubuntu, and probably in upcoming Debian releases as well, the legacy aptitude system is no longer installed by default. You can, of course, bring it back via apt-get — and the aptitude command will be available again — but it's better to learn how to use the modern apt.

Here I'll show you how to search for packages and display information about them using apt.


Searching for packages

Via apt:
# apt-cache search myPacket
# apt-cache search "package name"
where instead of myPacket and package name, specify the name or part of the name of the package (program) you need.

Via aptitude (deprecated):
# aptitude search myPacket
# aptitude search "package name"


Displaying information

Via apt:
# apt-cache show myPacket
# apt-cache show -v myPacket
if you use the -v flag, additional data will be shown, including all versions available for installation.

Via aptitude (deprecated):
# aptitude show myPacket
# aptitude show -v myPacket


As you can see, the search and show syntax from aptitude simply carried over to apt-cache.

Installing and removing packages is done as usual — via apt-get install and apt-get purge.

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "LINUX operating system"

Terms: LINUX operating system