Find Out If A Package Is Installed In Debian

Today we’ll have a quick and easy article where we find out if a package is installed in Debian. There are times when you’re unsure of which packages are already installed. Today’s article looks to help with that, letting you know how to find out if a package is already installed.

Depending on where you live, yesterday was a holiday. A nice and easy article seems like a good idea. It’s actually a holiday as I write this, but that’s okay. I’d probably have written it ahead of time but Mother Nature was having her way with me and my neighbors. So, this is being written on Christmas Day. That’s another good reason to keep this short.

If you’re unaware, Debian is a Linux distro. Debian is one of the elders among distros, having just turned 30 not long before writing this article. It’s a very popular distro that has stood the test of time.

Debian also has a whole lot of derivatives. Then, there are derivatives of Debian derivatives. For example, there’s Ubuntu (and all the flavors) which has many derivatives, such as Linux Mint. While less common, there are probably derivatives of derivatives. By now someone has probably at least made a derivative of Linux Mint! (I did not look.)

That means that today’s article will apply to almost all of them. There’s bound to be an outlier, but anything still using apt or dpkg is good to go and will be able to use the information in this article. You won’t need to install anything, but you will need an open terminal.

Find Out If A Package Is Installed In Debian

Today’s article will involve the terminal. You can easily use a GUI for this. Just open your software manager to search for the package name. In this case, we’ll use a terminal and you can usually open your terminal by pressing CTRL + ALT + T.

You won’t need to install anything to determine if a package is installed in Debian. Everything you need, all the tools you’ll need, should be preinstalled. The tools you’ll be using:

dpkg:

You can use dpkg as one tool for this job. Given my preferences, this is the tool I’ll use for this job, simply because I like the output better. If you check the man page, you’ll see dpkg is described like so:

dpkg – package manager for Debian

That’s a pretty good-sounding description for the task. After all, we want to find out if a package is installed in Debian.

The syntax to do this with dpkg is quite simple:

For example (in Mint):

As you can see, Firefox is indeed installed. You should also remember that this operation is case-sensitive. This generally means you want lowercase letters.

apt:

You can also use apt to find out if a package is installed in Debian. If you don’t already know, apt is one of the tools you can use to manage packages in Debian. Think of apt (and apt-get, the stable cousin) as a front-end for Debian’s dpkg. The man page isn’t all that descriptive at first:

apt – command-line interface

But, if you look a little further, you’ll see:

apt provides a high-level commandline interface for the package management system.

So, apt is another fine tool to use for finding out if a package is installed in Debian. It too has a rather simple syntax and it looks like this:

For example (in Mint):

In this case, you can safely ignore the warning. Again, this is case-sensitive and you’ll almost certainly want lowercase letters in your command.

Closure:

See? A nice and easy article for you. It’s not all that difficult to find out if a package is installed in Debian. This is something you can do quite quickly with an open terminal emulator. It’s something easy enough to remember, as well.

Today’s article was nothing too taxing and is something that can come in handy because, if you’re like me, you can’t possibly remember all the packages you’ve installed. Then, when you do install packages, you’re often installing dependencies.

Keeping track of all of those packages manually would be a tedious process! Just a little bit of terminal knowledge makes quick work of this and the commands are easy enough to memorize. Try them a few times and you might just remember them by rote.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Upgrade Linux Mint In The Termanal

If you have chosen Linux Mint as your distro then you have a handy GUI way to upgrade, but today we’ll upgrade Linux Mint in the terminal. This won’t be entirely pointless, as we’ll be doing things the GUI method of upgrading doesn’t do. By the end of this article, you should be comfortable upgrading your system in the terminal.

Additionally, this is going to work for other related distros. This article will apply to you if you use Debian, Ubuntu, an official Ubuntu flavor, and many other distros. More specifically, if you have access to apt, this will apply to your computer.

There are a few confusing terms here. I’ll do what I can to explain.

We often use ‘update’ and ‘upgrade’ interchangeably. I do that myself. In the sense of this article, an update means you’re refreshing the software available to you and then you’d upgrade to the newest versions of that software. So, in the sense of the commands used, they’re not interchangeable.

We’ll be using apt for this article. APT is short for Advanced Package Manager. This is the most common method of managing packages in the terminal, at least for those distributions that use apt. If you check the man page, you’ll see:

apt – command-line interface

And that’s not too descriptive. If we read on, we’ll see:

apt provides a high-level commandline interface for the package
management system.

That’s a bit more promising, as updating and upgrading is indeed managing packages. So, that’s what we’ll be using and you won’t need to install anything if you’re using Linux Mint.

Upgrade Linux Mint In The Terminal:

As you can see, I mentioned that this is to be done in the terminal. That means you need an open terminal. Just press CTRL + ALT + T and your default terminal should open.

With your terminal now open, let’s update the database to see what new software is available for your system. That’s an easy command:

The output will tell you to do so, but you can check the available upgrades with the following command:

You could update them manually, one by one, but you can just use this command:

That will install all of your available updates without asking you for permission to proceed. If the updates do require manual input, it will stop to ask you for your input.

Now, there’s another tool. We can clean up after ourselves, removing software that doesn’t need to be installed anymore. This happens and happens with some regularity. You can run the following command:

If you’d like, you can combine all these commands into a single command:

You can alias that, or leave it in your Bash history, and run that regularly to keep your system updated with the latest (and most secure, generally speaking) software.

Closure:

Yup… It was still a weekend when I wrote this. I also have guests that will be here for a while. So, it’s a fairly short article – but it’s a useful article for those who are running Linux Mint. After all, it’s not all that challenging to upgrade Linux Mint from the terminal and that’s something all Linux Mint users may wish to learn. If you’re in that group, this article is for you…

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Reinstall A Package In Ubuntu

There may come a time when your software has gone awry and you’ll want to know how to reinstall a package in Ubuntu. This article will cover this because it seems like a fine (and short) article and this is indeed a weekend article.

While this is specific to Ubuntu, it’s going to work in any distro out there that uses apt or apt-get. Technically, I’m doing this in Lubuntu, but Ubuntu is a more widely searched term. That’s why I’m going with this one.

So, what are we doing?

Well, we’re going to reinstall a package, that is software, in Ubuntu. We’ll be doing so from the terminal and it’s a very easy process. We will be using the terminal, so open your default terminal by pressing CTRL + ALT + T.

The tools… You won’t need to install anything new!

apt:

If you’ve installed software in the terminal, you’ve probably used apt (Advanced Package Tool). If you do some digging, you’ll see that it’s a front end for apt-get (which is in itself a front end for dpkg, more or less). Apt is the less-stable binary compatible with apt-get. If you want something long-term, use apt-get. If you’re writing an article for this moment in time, feel free to use apt.

When you check the man page, you’ll see apt is described like so:

apt – command-line interface

That’s not particularly helpful. Let’s check the real description:

apt provides a high-level commandline interface for the package management system. It is intended as an end user interface and enables some options better suited for interactive usage by default compared to more specialized APT tools like apt-get(8) and apt-cache(8).

So, as you can now see, this is the correct tool for the job. We’ll definitely be doing stuff in the ‘package management’ category.

apt-get:

I’ll be including apt-get commands by default. Why? For the sake of completeness. It’s not that much effort to add them and the article would be shorter without them. So, I’m using them. Let’s check the man page…

apt-get – APT package handling utility — command-line interface

That’s descriptive enough. You can see that apt-get is a package handling utility and that’s what we’ll be doing. We’ll be handling (managing, if you prefer) packages. 

These sorts of tools are installed by default on Ubuntu. They’re also installed by default on Lubuntu, Mint, ElementaryOS, Debian, and many more Debian derivatives. As I said, you won’t have to install anything new for the sake of this article.

Reinstall A Package In Ubuntu:

Let’s say you have some software that’s not behaving quite right. One of the steps you might take is reinstalling the software. Bits may go awry and sometimes things get messed up as you tinker. For whatever reason, you may want to know how to reinstall a package in Ubuntu. Again, that’s what this article covers. (So many people skip the intro!)

I’ve already told you how to open a terminal. This is done in the terminal.

First, we want to talk about how you reinstall a package. The syntax is simple:

You can do the same thing with apt-get.

That will reinstall an application, all nice and easy. It will only reinstall the application. Many applications don’t stand alone but have dependencies.

Fortunately, you can not just reinstall a package in Ubuntu – you can reinstall a package in Ubuntu and reinstall the dependencies. You just need to know what the dependencies are. For that, you’d run this command:

Once you have that information, you can combine the whole thing into a single command. All you need to do is add the package names to the commands. For example:

So, it’s pretty easy to reinstall a package in Ubuntu. 

Closure:

Technically, this was written on a Friday. It’ll be published on a Saturday. So, it’s a weekend article! That means it’s fairly short and fairly easy. I might as well have an easy day. Besides, I wrote another article already today. You won’t see it for a while, but it is written and scheduled for publication. I’m kind of ahead of the game in some regards.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Installing Applications With DPKG

If you are installing software via the terminal, you may want to learn more about installing applications with dpkg. It’s a simple process and I’ll also cover how to uninstall software with dpkg. It seems like the thing to do and it seems like a handy article to write, especially for new users.

You should probably know that apt is a frontend for dpkg and I’d suggest using apt to install software. That article does mention dpkg, but this article will be exclusively about installing (and removing) applications with dpkg.

The main reason I’d suggest using apt instead of dpkg is because apt will manage dependencies automatically. That’s a pretty handy feature. Still, you might as well learn to install applications with dpkg. You might as well also learn about uninstalling applications with dpkg.

This article only applies to distros that support dpkg as their package manager. That’d be distros like Debian, Ubuntu, Mint, and the many other Debian derivatives.

What is DPKG:

You won’t have to install anything. If your distro supports dpkg, it will be installed automatically. You can verify that dpkg is installed with the following command:

The reason for this being a Debian (and derivative) thing is obvious when you check the man page. If you do that, you’ll learn that dpkg is:

dpkg – package manager for Debian

Installing software is definitely managing packages. That means this is one of the correct tools for the job. There are graphical ways to do this and you can easily install software with gdebi.

Anyhow, you can even visit the dpkg homepage. That’s the tool we’ll be using to install software.

Installing Applications With DPKG:

This is one of those articles that requires an open terminal. That’s a fairly common thing around here and most of you know that you can open your default terminal simply by pressing CTRL + ALT + T.

With your terminal open, let’s all start on the same page…

In our example, we’ll use XnView MP. You can download that with this command:

If you’re using a 32-bit distro, there’s no current XnView MP available. They’ve stopped development, but you can download an older version.

Now that you have XnView MP downloaded, you can install applications with dpkg with the following syntax:

Or, in our case, we’d install XnView MP with this command:

(Don’t forget that you can use autocomplete.)

See? It’s fairly easy to install applications with dpkg. I picked this XnView Multiplatform because it doesn’t have any dependencies in my testing. That keeps it relatively simple.

If there were dependencies, you could install them manually with dpkg. You can do that, or you can just use apt (which, again, you probably should have used in the first place). To do that, it’s simple:

If you’re going to have to run an apt command after installing applications with dpkg, you might as well use apt in the first place. When you install packages with apt it will also resolve any dependencies (if those dependencies can be satisfied).

Removing Software with DPKG:

Yes, you will still need an open terminal if you want to remove software with dpkg. It only stands to reason. So, if you’re here for just this section of the article, open your terminal. There are directions above if you’re new to Linux.

The syntax to remove software with dpkg is also quite simple.

NOTE: The package name is going to have a different name than the installation package, lacking at least the .deb portion. You can find the name with this command:

So, in our example, we’d try a command like this:

Sure enough, it returns this:

So, we can see the application name is not the same as the package name. In this case, the name is ‘xnview’. That means we’d use this to remove the package:

That removes the application but it retains the configuration files. This means you can install the application at a later date and still have the same configuration you had before you removed the application.

See also: ‘sudo apt remove’ vs ‘sudo apt purge’

If you want to uninstall the application and remove the configuration files, you can just use the -P (purge) flag. The syntax follows:

If we use this command with our example application, it’s like this:

Now, if you want to pretend this article never happened, we can clean up after ourselves with the following command:

That will delete the .deb file, meaning we’ve left no evidence behind (assuming you purged the application). Of course, you no longer have that particular graphics viewing, organizing, and light editing application installed. That’s entirely up to you.

Closure:

Well, if you ever needed to know about installing applications with dpkg, this was the article for you. We even discussed the process of removing the application and cleaning up after yourself. Good times!

If we wanted to be ‘more correct’, we’d say that we started with a package and installed an application. I figured I’d aim at the more generic words in hopes that newer users find this information and find it relatable.

There’s a limit to what you can ‘optimize’ for (meaning ranking in search engines) so I do what I must. I work on SEO (search engine optimization) because the site’s pointless if it doesn’t help anyone.

The whole goal is to get my notes (and more) online so that the site becomes a resource. More specifically, the end goal is to make Linux more approachable. Now if I could just make the site break even…

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Monitor Your Linux System With NMON

There are times when you want to see what’s going on with your devices and you can monitor your Linux system with nmon. If you’ve never heard of nmon, that’s okay. You’ll find that nmon is a handy application that lets you monitor all sorts of aspects of your system. You’ll also find that nmon is an application that’s used in the terminal, so be prepared for that.

This nmon application is available for most Linux systems and I’ll let you know how to install nmon in this article. You’ll find that nmon stands for ‘Nigel’s Monitor’ and has been around since the early IBM AIX days. It has since been made available for Linux.

You can read about nmon on Wikipedia.
You can also visit the nmon project page.

If you check the man page, you’ll see nmon described as:

nmon – systems administrator, tuner, benchmark tool.

We won’t be doing much of that. We’ll just be using nmon to monitor the system. You can then take that information and use it to administrate, tune, and benchmark the system. We’ll be using nmon to monitor CPU, RAM, your network usage, and things of that nature.

You can also learn more about nmon from the man page because I’ll only be covering how to monitor your Linux system with nmon. There’s almost always so much more! It’s almost a shame that I try to limit many of my articles.

Installing nmon:

You can use your usual GUI tools to find and install nmon. It’ll be available for most distros. It’s also possible to install nmon in the terminal. We’ll cover that, so just press CTRL + ALT + T to open up your terminal.

With your terminal now open, we’re ready to install nmon.

Debian/Ubuntu/etc:

Arch/Mandrake:

RHEL/CentOS:

SUSE/OpenSUSE:

Gentoo:

I think that covers the vast majority of distros out there. If you don’t see your distro, or if I got one wrong, please let me know in the comments. I don’t always get this section right. I wasn’t even planning on writing this article today. But… Here we are!

Monitor Your Linux System With NMON:

You should have a terminal open already, from when you were installing nmon. This is going to sound strange, but you’re new to nmon – or you probably wouldn’t be reading this article. Because you’re new, open up a second terminal.

In the first terminal, enter this:

In the second terminal, enter this:

Now, do you see why I had you open two terminals?

In the first terminal, look at your settings and options. In your second terminal, apply them. See, once you apply them you can no longer trivially refer to the material in the first terminal.

You can apply the monitoring options in any order you’d like and in any combination that you like. The nmon application makes it easy. You press c to monitor the CPU, m to monitor memory, n to monitor the network, and things like that.

So, pick what you want to monitor from the first terminal and press the appropriate key in the second terminal. It might look a bit like this:

nmon monitoring options
There are quite a few options to pick from and it’s straightforward.

Then, your monitoring terminal could look a bit like this:

monitoring system processes with nmon
See? That’s monitoring CPU, memory, the network, and top processes – all in one screen.

Of course, once you know how nmon works and what you’d like to monitor in your Linux system, you won’t need to have the first terminal open. There are a lot of options, but you’ll find they’re easy to remember. You can also use ? instead of a separate terminal window. I find the two-terminal method to be easier for me because I don’t run nmon often enough to recollect the myriad options.

I suppose you want to know how to get out of nmon without closing the terminal window and leaving nmon running in the background. Well, that’s easy. Just press CTRL + C to quit nmon and return to your regular terminal prompt.

Closure: 

I didn’t plan on writing this article today, but I’d cracked open nmon for one reason or another and decided that I’d write about nmon when I was thinking about it. It’s another one of those articles that scratches my own itch, but it’s also something worth sharing.

It’s a pretty easy task to monitor your Linux system with nmon. I figure anyone can do it and I tried to make it easier for new nmon users by suggesting they use two distinct terminal windows. It seems like a reasonable way to get started.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

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