Let’s Play With ‘apt-cache’ Some More!

People use apt, and apt-get, all the time. We use it for the most basic things. We use apt to install, remove, and purge software. However, there’s apt-cache and it’s pretty handy.

A couple of days ago, I published an article about using apt-cache to find the official project homepages of your installed software. Today, I’m going to quickly cover some of the other things you can do with apt-cache. Obviously, if you don’t have apt and apt-cache then this article will do you exactly no good.

So, where to begin? Let’s just assume you’ve already installed inxi and you know how to open the terminal by pressing CTRL + ALT + T on your keyboard.

Done? Good, let’s get started!

First, if you want to display a bunch of generic information, you can use the following:

That will show you a bunch of information about a package. You don’t even have to have it installed. For this one, you will have to have the complete package name for it to be successful. In the next command, that’s not really required.

For example, you could type in ‘inx’ and it will find inxi, among other things. You can use that command with the ‘–full’ switch, and get a ton of information, like so:

Anyhow, you don’t even have to use an application name with the search. You can search for keywords and find applications that way. If you wanted to see what text editors you might have available (you’ll need to weed through them carefully) then you’d use this command:

Go ahead and give it a try. You might be surprised at the vast number of results you’ll get with that command. Seriously, it’s a lot of results. There’s probably some text editors you’ve never heard of before hidden among those results!

Next on the list is checking the policy. This way you can see what version is installed, what version is available, and you can even see what repository was the source for the application. It’s just as easy as the rest.

Among this giant, perhaps overwhelming, source of data are a couple of other neat things you can do. You can easily see both the dependencies and the reverse dependencies.

For clarity sake, the dependencies are the extra software that needs to be installed for the package in question to function. The reverse dependencies are what packages require the installation of the package in question in order to be fully functional.

To find the dependencies:

And the reverse dependencies:

And, there you have it. Those are the most common ways you’re going to use apt-cache. There are other ways and there is more information available, but those are pretty much all the ways you can expect to use it in the normal course of activities. If you want to know more, you can always check the man page. To do that, it’s just:

And, there’s one bonus round! There’s pretty much no good reason to run this, other than curiosity, but you can actually get some pretty cool stats about how many packages are available, how many are real packages, how many are virtual packages, and things like that. It’s a pretty simple command.

See? Another lovely way to use the terminal to gather information. I use the terminal nearly exclusively to manage my installed software.

Smash a Button
[Total: 0 Average: 0]
About Me: I'm just some retired dude with a little bit more free time on my hands. If you want to support the site, why not help yourself out too by ordering some inexpensive web hosting so that you can start your own site?


How To: Use ‘apt-cache’ to Find Homepage for Your Installed Apps

It can come in pretty handy to know for certain the homepage for the applications you have installed. You can do this with ‘apt-cache’. I’ll show you how. This is a pretty easy article to follow and just another tool to add to your toolbox.

NOTE: This is only valid for systems that use apt. As the title indicates, it requires ‘apt-cache’. Without apt-cache, this page will do you no good. None good. That’s how much it will do you. None!

Why would you want to know the homepage – and, more so, the preferred homepage? For starters, in the days of GitHub and everyone forking, and awkward application names that aren’t easily searched for, it’s hard to know which site is the correct one.

Maybe you want to report a bug? Maybe you want to request a feature? Maybe you want to make a donation? Maybe you just want to thank the author for writing such awesome software? Maybe you want to know where the homepage is because you need support and you’re not sure where to turn to?

There are all sorts of reasons why you might want to know the homepage of a piece of software. It’s actually something that’s important. It’s also something your system already knows and will happily show you if you know the proper magical incantation. 

Like many other articles, you’re gonna want the terminal for this. Let’s go ahead and get that opened by using your keyboard and pressing CTRL + ALT + T

Got your terminal emulator open? Good! Let’s start with the command.

If you do not have ‘inxi’ installed, feel free to use a different application. Note that you do not need to use sudo for this. Not all apt commands require sudo. You only need sudo when you’re actually doing administrative tasks. See? I saved you some typing!

Anyhow, in the text output from the above command you’ll see a line that starts with “Homepage:”. If you hadn’t already guessed it, that’s the line that tells you the authors homepage. This, of course, only works on installed applications. For sanity and space sake, it’s not like your system has all that information downloaded for all the possible packages. Thus, it works on naught but the apps you have already installed.

So, let’s go ahead and make the command a little more precise. We’ll pipe the output through grep and get rid of the cruft we don’t actually need. In that same terminal, go ahead and enter:

NOTE: The command contains a capitalized letter H because Linux is often case-sensitive and is certainly case-sensitive in this case. If you don’t believe me, try it with a lowercase h!

But wait, there’s more!

Not only is there homepage information in there, there’s sometimes some useful nuggets of information in there. If you have LibreOffice installed, go ahead and check (skip the pipe and grepping) to see what the output is. Inside, it has a ton of additional information, including listing ways that you can extend LibreOffice by installing more software.

And there you have it. You can now easily find the homepage for the applications you have installed. Should you need to contact the author, check for information, or just see if they did anything else, you now know how to do that. It’s a little hidden nugget that most folks don’t seem to know. Well, now they do…

Yay! You made it all the way to the bottom. You deserve a treat. Seeing as you’ve already got the terminal open, and seeing as we’re dealing with apt-cache, let’s just get some pretty neat stats with:

That’s it and thanks for reading. I appreciate the audience and am happy that I finally am putting some effort into this project. I’ve been meaning to do this for years, but something always got in the way. If you want to get notified when new articles are posted, just scroll up and sign up for the newsletter. I promise not to send you any commercial emails and I won’t give any of your private data away.

Smash a Button
[Total: 1 Average: 5]
About Me: I'm just some retired dude with a little bit more free time on my hands. If you want to support the site, why not help yourself out too by ordering some inexpensive web hosting so that you can start your own site?


Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.
SITEMAP