Monthly Archives: November 2011

How to extend the usefulness of RPM for Non-Geeks

I originally wrote this article for the same web site back on January 30th, 2008. Much of it still applies today.

Introduction

Linux has reached a graphical state where “ordinary desktop users” can use Linux for daily activities they might use other operating systems for. While it’s possible to install software using a graphical tool like pirut (Fedora Core/Red Hat) or yast (Novell SuSE) sometimes you want to know a bit more about what’s being installed on your system, what’s already on your system, or exactly what’s in the package you just installed. This is where the Redhat Package Manager (RPM) command-line tool comes in handy. Rpm is a pretty slick package management tool on its own, this article discusses extending the usefulness of rpm for doing more than just installing and removing packages, and why you might want to do it.

Step #1 – Get to know all your installed packages with query all

In a terminal session run the following 2 separate commands:

rpm -qa | sort > allfiles.txt

less allfiles.txt

The command(s) rpm -qa | sort > allfiles.txt has three parts worthy of noting. The -qa switch after the rpm queries all the packages installed (q = query, a = all). In English, this command on its own will list all the packages installed on your computer. Think of a package as a collection of programs that comprise one program, for example: the firefox web browser. The second part of this string is the sort command. The | symbol takes the output of the previous command (rpm -qa) and dishes it up to the next command, in this case sort; so our list of installed packages gets sorted alphabetically. The last part of this string of commands is the redirection pipe and filename allfiles.txt. The redirection > symbol takes the output from sort and redirects it into a file, in this case allfiles.txt. Now allfiles.txt can be read with any text editor or word processor (it’s just a text file after all). Some common text editors on Linux systems are: gedit, kate/kwrite, emacs, vim, nano, and pico.

Step #2 – List all files within a single package

Run the command:

rpm -ql aspell | less

If you get a return that says package aspell is not installed try running rpm -ql with one of the packages you viewed in step #1.

Remembering that the -q switch is query, we simply added the (-l) list switch. Why would you want to list all the files in a package? There are a couple of good reasons, one you might find documentation that provides useful information about a package (i.e. README.txt), two, sometimes a program gets installed to a non-standard location, such as /opt, and you need to know the location to run the program.

Step #3 – Find out information about a single package

Run the command:

rpm -qi aspell

Again, the -q switch queries the aspell package. The -i switch gives information about a package such as the package size (in bytes), the key it was signed with (to ensure it comes from a good source, for example the software package’s author), the home web page for the package, a description of what the package does, and other information about the build date, vendor, version, etc… you get the idea. Not all packages will necessarily have all information fields filled out, but most are maintained for Fedora/Red Hat or Mandriva should have good descriptions for the rpm packages.

Step #4 – Combine bash commands with rpm commands for more effect

We’ve already seen how bash commands like less and sort can extend the usefulness. Other commands like wc (word count) and grep can also be used to extend the usefulness of the rpm command. Using bash shell commands along with the commands’ switches can produce interesting results.

For example: to find out how many files are installed by all of the packages on your system use the command:

rpm -qal | wc -l

Remember the query, all, and list files switches (-qal) from our previous examples? We’ve added the word count (wc) bash shell command with the line (-l) switch to count the number of lines.

Grep is a tremendously useful bash command that lets you search for patterns within text. For example, if we wanted to find out of aspell had a README file in it we could run:

rpm -ql aspell | grep README

Of course, aspell must be installed to query it.

Tips

  1. It’s not necessary to be the root user to use rpm to query installed packages, but if you want to install software with rpm you do need to be root.
  2. The book Linux System Administration by Evi Nemeth, Garth Snyder and Trent R. Hein is an excellent resource for learning more. Of all the books on system administration, this one is perhaps my favorite.
  3. man rpm will display the manual page for rpm. Manual pages are great, but sometimes cryptic. The ones I find most helpful are those that include examples. When I can’t find an example in a manual page I google the command and ask for an example. For example, a search of Google with plus in front of rpm and example will search for pages that contain both the word rpm and example: +rpm +example.

 

Leave a Comment

Filed under Linux, Technology

68-pin SCSI hard drives available at The Working Centre’s Computer Recycling Project

68-pin SCSI Hard Drives

68-pin SCSI Hard Drives

We’ve been busy lately at The Working Centre’s Computer Recycling Project trying to clear out different items. Among those items are a variety of 68-pin UW (Ultra-Wide) SCSI hard drives. We’ve just finished overwriting a bunch of SCSI hard drives using Darik’s Boot and Nuke (DBAN.org) and are now making them available to any residents in the Kitchener/Waterloo region at a cost of $0.25/GB.

Most of the drives we have available are small, 9.1GB. We have a few larger SCSI drives that may not be on the list below, but are in the process of being overwritten. At this point we are not overwriting SCA (Sun Component Architecture) hard drives, but we could make some available if there was a strong interest from someone within the community.

At present we are need for both PATA and SATA hard drives above 80GB, so we don’t have any PATA or SATA hard drives larger than 30GB for sale.

I welcome contact through any of the social networking buttons on this site, via The Working Centre’s web site, email, or by calling phone (519)743-1151 x121 for donations. Please note that our not-for-profit project does not buy used equipment.

Here’s the list of what we currently have available in 68-pin UW-SCSI drives:

  1. 2 x Fujitsu MAP3367NP 36GB 10K RPM (Ultra 320) – $9.00CDN/each
  2. 2 x Fujitsu MAJ3091MP 9.1GB 10K RPM (Ultra 160) – $2.25CDN/each
  3. 1 x IBM DDYS-T18350 18.2GB 10K RPM (Ultra 160) – $4.50CDN
  4. 2 x IBM DNES-309170 9.1GB 7500 RPM – $2.25CDN/each
  5. 1 x Quantum Atlas TY18L461 18.4GB 10K RPM (Ultra 160) – $4.50CDN
  6. 1 x Seagate ST39175LW 9.1GB 7500 RPM – $2.25CDN
  7. 1 x Quantum Atlas IV KN09L462 9.1GB (Ultra 160) – $2.25CDN
  8. 1 x IBM DRVS IEC-950 9.1GB – $2.25CDN

Computer Recycling does not normally hold items, but in the case of specialty items like this we might make an exception; please contact me if you’re interested in one of these hard drives and cannot make it in right away.

Leave a Comment

Filed under Hardware, Technology

Allowing older episodes in flexget

Running flexget with the --disable-advancement switch

Running flexget with the --disable-advancement switch

I’ve mentioned flexget before in another post so I won’t go into detail about all of its options. It’s enough to say that it helps automate downloading .torrent files and can use regular expressions to filter out unwanted content.

One of the problems I ran into with flexget is a “feature” in which episodes that are past a certain date are automatically disqualified and not downloaded. So if you missed the start of a season of a show you might be out of luck unless you manually download the file. But like the Apple iPhone moniker there’s a “switch” for that:

flexget –disable-advancement

The feature is known as advancement and running flexget with the –disable-advancement should catch you up on most of the episodes you missed in the past.

Leave a Comment

Filed under Entertainment, Linux, Technology, XBMC