CompTIA Linux+ XK0-005 – Unit 05 – Application Management Part 2

  1. Installed Software

Now, after you install software, if you want to see a list of what you have, you can use your GUI to be able to look at all of the installed programs, or you can use some of those same command line package manager programs to show you the list of what’s been installed. As an example, with the Apt you can use the cache option, cache being what has been installed with the show command to see what’s there. You can do a Dashl with some of the package managers. The Rpm has a Qi or QA to show you the installed software. This is again just letting you know what’s been installed by these package managers on your Linux system here. The GUI might be an easier method of looking at all the installed packages so that you see it in one command, one list. You can deal with the list, probably sort them some things that make that a little easier, but it’s just to let you know what’s been put on to this particular Linux box.

  1. Demo – Gathering Information about Installed Software

All right, we’re going to take a look at seeing what kind of packages are already installed and how to get more information about a particular package. And we’re going to use both the GUI and the command line. So let’s start off by taking a look at the packages installed with that Synaptic. Let me try it again. Synaptic Package Manager now, the thing about this, remember, is that this program we have here on Debian, it’s not going to be found on on every single distro that you have, but you’ll find something similar to it. So you may want to in particular find out what that is. Now what I’m going to do is make sure I’m on the status option down here. The status shows me those things that are installed. And here we see all of these packages that are installed, including one I did in an earlier demo, which is this Abi Word or Abbey Word. And I’m going to now close this down and we’re going to use the command line to see if we can’t find some more about that particular product or package.

So I’m going to put in the Apt Cache, show me Abby Word, type it to the More command because it’s going to be probably quite verbose. And there it tells me the priority, the package name, the editors, the installed size, the maintainer architecture for the I 386 version platform, what it replaced, and then a bunch of library information. If I hit the spacebar, it continues on down to the description additional plugins and gives us quite a bit of information about that particular package. So that’s a nice way to get probably a little more information than you would have gotten through the GUI about one particular option. Don’t forget that you can also use Apt Cache to search for these things if you don’t know where they are. And there it tells you about some of the options as far as the different types of packages that started with Abi Word or Abby Word, as I keep liking to say.

But anyway abi word. There it is. And there was a help some plug in for grammar, Matthew Office so it’s pretty straightforward that you are searching for this term and it found me all matching terms, which is also helpful when things aren’t working as well as you would like. And of course, you could also try to look at the packages that were installed through the L for the list. Again, the More is a nice place to pipe that information into so I can look at all of these packages as I hit the spacebar. And you can see that it would be probably in my best interest to have a little more room on this console so that I’m not seeing some line wrapping going on. Anyway, I’m going to hit Q for quit and that’s a very quick and easy way to confirm the packages that are installed both command line and GUI and how to look up information about a specific package that I think was a little more comprehensive on the command line than you got on the GUI.

  1. Removing Software

Now, at some point, you might find software that you just don’t like, or it’s not behaving the way you expect, or worse yet, causing conflicts with something else in that system. You can remove software pretty much as easily as you put it in. Again, through some sort of graphical user interface, selecting the program and saying, get rid of it. Or with the command line. Again, many of the command lines have a dash R for remove or might have a remove command. RPM’s option is E for getting rid of your programs. Again, back to what I’ve said before every one of these package installers has a different set of options. They weren’t made by the same company, they weren’t made by the same people, so they have their own flags and options. Just use the help commands, use the manpage pages that they’re there, look at those commands and see how they work. Gui’s, at least in this case, give you a little more universal feel and look and feel about this process. But removing software is as easy as it was to install it.

  1. Demo – Removing Software

All right, now we’re going to talk about using the command line in this case to remove some of these packages. I think after what we saw with the Snaptic package manager, that’s a piece of cake. Verifying that I’m the route to do this and app to get in this case, I’m going to use the word remove, and it’s going to go against that nice little package I installed earlier on a different print option. And it says, do I want to continue? It tells me even how much I’m going to free up as far as the information. And you know what I’m going to say, no, don’t delete it. And you’re probably wondering, well, what on earth is that all about? Well, let’s look at that command line just a bit more. Let’s do the apptget, but let’s do auto remove. That means, I hope, anyway, that you don’t need to talk to me about doing this. So I’m going to hit through there. Do I want to continue? It tells me yes. I’m going to say yes, take it all out, and it’s going to read the database.

find all the libraries that it needs to go through, and it’s going to hopefully just blow it all up for us very quickly. All right. And then that looks like it pretty much said, okay, that’s all said and gone. All right, so that was through our command line. Let me clear off our screen. We can look at the Synaptic package manager just one last time. Now on this tool, we’re going to go to the status, of course, and look at the installed. And as you go through this list of installed options, you could probably see that I could pick on almost any one of these like this. Let’s not pick on something that might affect our future needs for some help. So it’s so hard looking at these packages just fragging out who I might want to get rid of. I know. Let’s go find let’s search for the K Asteroids. A lot easier to find it. There we go. I can now mark this thing. I can say mark for removal or for complete removal.

Just say mark for removal. And if I click apply, then just like that, it’s going to destroy that game that I didn’t even get a chance to play. It says, okay, are you sure you want to remove it? I’m going to say apply again. And just like that, you can watch it. It’s going through the same steps. And I didn’t even have a chance to show you the details to see the command line. It was pretty quick at getting rid of that particular package. So Asteroids is gone. I’ll go back up to sections, and you can do that over and over and over again. But do be careful. If you’re not sure what a package is, you shouldn’t be removing them because you’re worried about not having enough drive space. You should be removing them based on something more legitimate. Like it’s perhaps being replaced by a newer package, a different software. It’s got some sort of vulnerability or something other than I need some more room. Because you might just delete something that’s crucial to the operating system.

  1. Repositories

Now, earlier I made this mention about having a repository for your packages. The repository is just a storage location for the package. It could be local, it could be network accessible. It’s just a place where the package is going to be found. That means it could be public, it can be private. But I have to have access to it if I’m going to run any of my installation programs that are depending on that package. Now, I can select the repositories that I define.In fact, you can define and make your own repositories or use those that may already exist to make them or to select them. You can do it through the GUI, you can do it through the command line. The idea is that you have a repository designed as a storage location so you can put your packages there, put your upgrades there, whatever it is, and you can have multiple packages. The goal is that when you do the installation, you tell me where the package is so I can find it in the repository and do that installation.

  1. Synaptic – Software Sources

Now, as an example, in talking about repositories, synaptic has a Gui that you can use called Software sources. And what it does is it basically asks you to fill in questions about where I can go to download the software. For instance, you might have stuff that’s downloadable from the Internet, and you might choose stuff that’s officially supported. Or maybe I want the source code. Maybe it’s thirdparty software or it’s an update. You might have to include authentication information to log into the repository. These are just things that we use to say, here’s the repository, here’s where I want you to go. Here’s what I want you to set up so I can have access to whatever package you’re trying to get to.

  1. Demo – Managing Repositories

All right. Now we are going to look at these things called repositories. And I got to tell you, you got to kind of be careful with this, especially when using virtual machines. And let me tell you why as I go through this little story. So what I did is I installed originally this debian on a platform, a different platform than the one I’m running it on now. And I copied the VMware machine over to although it was a copy. But there were subtle differences that dealt with the repository that was causing me issues and trying to even install a package. And basically here’s what we’re going to see is that our goal here once we have this thing open is to go to settings and to repositories and the repository is basically going to be here in this third party software, the location of the installation CDROM. It was just different in the two machines. And so I was having problems with this thing giving me any option to go out there and do the work I wanted to do.

So what I did is I removed all the references that were out there and I’m going to leave these Http references around and said let’s click on Add CDROM. And I said go ahead, I have a point to the ISO file. So I said okay, search for it and it puts it in as a repository location, gives me the name and it basically fixed the links that I was having. So I’m telling you that should you decide to do things like I have, which is to actually go out there and do this virtual machine stuff until you actually put it into the actual CDROM and actually have the CD or DVD in that CDROM and go through that manner I was pointing to an ISO file. And that was what was causing me some problems. Anyway, I’m letting you know, kind of learn from my experience the problems I had there.

Obviously you can click Add and you can add your own Apt line if you want to, which should be something like this Http location. Now again, Apt is from the command line that we were using. You’ll notice if I go to updates that we can check for automatic updates. A lot of options with most of what we do, trusted software providers. So if you are getting updates or getting packages, the question is do you trust the sources that are sending you these packages and that they’re not something that’s been manipulated or altered to cause you to be downloading some sort of malware. And of course the very beginning one was what I want to download from the Internet. If I want officially supported issues with licensed software that’s free or not free download source code where I want to download it from, where I can choose the different organizations or if I click other.

then I can choose based on the language pack the different mirror sites that I might do these downloads from. All right, so this is just, again, putting up information about the types of locations, types of places where these packages that you’re installing are going to be installed from. So as I make choices, then that’s what it’s doing. It’s saying, okay, you chose to install this package. I’ve got to have a repository that says wherever it’s going to be. And yes, I know I changed it. I kept it the same, but I deleted and recreated it. So I’ll click on Close, and that’s what you need to know, is that you need to set up these repositories settings, repositories so that your package manager has the idea of where to go to install, to download and then install the packages that you ask for.

  1. Topic B: Source Code Software

All right. Now, it’s one of my favorite topics, source code software. The reason I like this is that it’s so easy to be able to say, hey, I’ve got a new application. I got this cool new program. Here you go. I’m going to hand you a bunch of text files. It’s nothing difficult at all. It makes for the download of programs to be very quick. I don’t have to have these big Bloated install packages. I just need the source code. I can download it. I will look to see if I have the right libraries to add in to be able to make it run onmy system, but it’s up to me to do it.

Now, this can cause a lot of people stress, because there are times when you’re going to have issues in trying to do the compilation, meaning you might not have the right software libraries that have the right instructions or actual code that you need to make this thing run. That means you have to download some more pieces, kind of figure out what’s cryptic. So this has scared a lot of people from the Linux environment. I think it’s one of the strengths. But that’s just me, because this is where I started in my world of high tech back in the days of computers in the early 80s, is with this type of an option with source code.

  1. Installing from Source Code

All right, so source code means uncompiled programs. Now you’re going to go through a couple of steps. First, to be able to make anything from source code to something you can actually use, you’re going to go through separate stages. First, you have to have the source code. That’s the uncompiled stuff. You’re going to compile it to start beginning to create what we call a binary. Now, that also includes linking. Now, what do I mean by linking? One of the benefits of creating a program is that you can utilize these other libraries of code to be able to make your program work. In other words, I don’t need to recreate the connection to send something to a monitor screen when there’s already code created that says if you send me the input, I’ll put it on the screen.

So we have libraries that deal with the inputs and the outputs and all of these different types of options for us. And that’s a rudimentary example of what I mean by that. But what I’m saying is that we really are trying to write our code as efficiently as we can and utilizing other libraries that are included with most Linux systems to handle the other stuff where I can just say this needs to be drawn on the screen. And there’s already a library that says oh, okay. I’ll draw this thing the way you said. So we have to link those into our binary as well. Now there may be some things that are specific to our operating system and our hardware platform that we have to account for. And that’s where some of the issues might come in, is that we may have in our operating system some different names of some of those functions that you need.

Worst case scenario is you have to change the source code to reference these new sub procedures and functions that are inside of your libraries. That’s the worst case and that’s only for the very experienced programmer. Most of the time, it’s not going to be that hard for us at all because there’s a lot of like I said, in common. All right, so that’s the part that, like I said, makes most people say, I like Windows. This is easy to do. Once you play with this, I think you’re going to like it because man, there is source code everywhere that you can download for almost any type of game. You if you just want to play games on your operating system, programs, applications, just cool stuff. Download it, compile it, link it to the right libraries, make sure that it has everything you need for your operating system, your hardware platform, and you’re good to go.

So what are the stages then? You download the source code. Now, it’s probably going to be in what we call a tarball. It might even be compressed to make it even easier to download. So you extract it out of the archive, you uncompress it, then you compile, compile and link. Once you’ve done that and it’s successful, then you can create the installation file, which is basically creating the file that you’re going to run and execute later on. And of course, clean up all that temporary stuff that’s going to be made through the compilation, the compilation and the installation process. And you’re done. Those stages really don’t sound as bad as they might sound for some of you. And you’ll see, what I mean is especially if you look and watch some of the examples of showing you how to actually do this.

img