How To: Add A PPA To Ubuntu

In this article, we’re going to discuss how to add a PPA to Ubuntu. A PPA is a Personal Package Archive, but we’ve come to use them much differently than they were ever intended. So, you might as well learn how to do this. You might as well learn how to add a PPA to Ubuntu.

Yes, we use PPAs in ways never intended. They are meant to be your own personal archive of packages. not a way of disseminating software to the masses. We’ve turned PPAs into a tool to widely distribute software more easily. If you want a piece of software that’s not in the official repositories, you do a quick search, add a PPA, update, and install your software! It’s how we’ve always done things! (Hint: No, it’s not how we’ve always done things.)

This is one of the main reasons Snap apps were created and why they are being pushed. During this time, people could also have used AppImages and Flatpaks, and some of us did.

Me? I’m among the worst of offenders. As it is, I still only use Snaps that came installed by default. I still reach for a PPA (when available) and install things in the ‘traditional’ manner. Well, it’s hardly traditional and it’s generally a bad idea.

In fact. let me sum up why it’s a bad idea with just one sentence…

When you add a PPA, you’re giving the PPA maintainer root-level access to your computer.

All they gotta do is push an update and you’ll have installed it with your next upgrade. No, don’t pretend you’re going to read the source and verify the integrity. You’re going to do it, just like you wanted to …

Add A PPA To Ubuntu:

Alright, let’s paint a simple picture:

There’s some software you want, but you can’t find it in your repositories and the GitHub page doesn’t release packaged binaries. You don’t want to have to deal with building it every time there’s a new version, so you take to the ‘nets in search of a fix.

Your first stop is at Launchpad.net to search for the application. You got lucky and found a PPA. In fact, you found a few of them. In this case, you want to look for the one who has most consistently published upgrades. First, you have to enable Ubuntu’s ‘universe’ PPA, which may already be enabled. If it isn’t, the command to run is:

When you find the proper repository’s name, you can add it with this command:

An example of that could be sudo add-apt-repository ppa:mozillateam/ppa. You could use that to use the more traditional Firefox. 

No matter… Once you’ve done all this,  you might still need to update your own local software database with this command:

There you have it. You can now add a PPA to Ubuntu. You can now use the software included in the newly added PPA. Modern/current Ubuntu flavors will run the apt update automatically, but older versions will still need to trigger the update manually.

BONUS: You can more easily remove the PPA through the GUI, but you can also do so in the terminal, it’s just the –remove flag, like this;

See? You can now do both. You can add a PPA to Ubuntu or you can remove a PPA from Ubuntu.

Closure:

Ah well… You can now add a PPA to Ubuntu. Removing a PPA is also now something you can do, assuming you didn’t already do so. On top of that, adding PPAs willy-nilly as  you’re essentially giving that PPA’s owner a key to your entire computer.

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 own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Extract An .rar File

Today, we’re going to learn how to extract an .rar file in Linux. You don’t see .rar files all that often with Linux, but sometimes they crop up. Today’s article will explain how to extract them.

You may recall .rar files from your Windows days, assuming you have a history with Windows – as many of us Linux users do. You’d probably be most familiar with the application known as ‘WinRAR‘. 

While the application is specifically for Windows (there’s a text-based WinRAR for Linux, perhaps a subject for another article), it produces files compressed with the .rar format. The .rar compression is much like any other compression, from .tar.gz to .zip. At some point, you may be faced with opening one while you’re using Linux.

Just because the files are often made with WinRAR doesn’t mean the files will only be opened in Windows. Once in a while, you’ll find something you need that’s in .rar format and you’re using Linux. Well, fear not, you can extract an .rar file easily enough. It’s just a simple terminal command away and you should be all set. While not a skill you’ll need often, it’s one you’ll maybe need and now is a good enough time to learn how.

Extract An .RAR File:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

Once you have the terminal open, you’ll need to install an application called ‘unrar’. If you’re using a major distro, it’s likely in your repository – though maybe under the name of ‘unrar-nonfree’. Search your repositories and you’ll find it.

If you’re using Debian/Ubuntu/similar then it’s easy enough – it’s called ‘unrar’ and you install it with:

With that installed, the next part is really quite easy:

That will extract the contents of the .rar file while preserving paths. If you don’t care about that sort of result, just use the ‘e’ flag like this (and it’ll extract everything to the current directory):

You can also extract password protected content easily enough, just read the man pages with man unrar to learn how. Anything you can do with a GUI you can do with the terminal. You just need to read the man page. This article only covers how to extract an .rar file without any complexity.

Closure:

That’s it. That’s today’s article. The goal was to learn how to extract an .rar file in Linux and now you know how to do so with unrar and the Linux terminal. ‘Snot all that complicated, really.

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 own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Backup Optical Media To .iso

In today’s article, we’re going to learn how to backup optical media to .iso. If you have optical disks you want to backup, this is an easy way to go about it. It will not work with all disks, especially those encumbered with DRM.

This is useful for data disks, for example. It’s also useful for music CDs. It’s less likely to be good for things like game DVDs or movies. Those use various methods to stop you from copying your discs. While there are ways to backup some of them, this article won’t be getting into it.

Instead, we’ll just be using ‘dd’ for this exercise. If you’re unfamiliar with ‘dd’, it stands for:

convert and copy a file

If you’re unfamiliar with the command, you should pay extra attention to the way it is used in this article. It’s a powerful tool and using it with just the slightest error can (and will) make you run for your backups.

So, with all those things in mind, let’s learn how to …

Backup Optical Media To .iso:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

With your terminal now open, we should probably figure out where your optical disk is. One way to find your optical media drive is with this command:

Inside the results of that command you’ll find something like “[sr0] scsi3-mmc” from which you can glean that /dev/sr0 would be your optical drive. With that information at hand, you’ll fun this command:

Be really sure that the path to save is correct, though this command is less likely to harm you than other ‘dd’ commands.

Anyhow, you can verify the integrity of the file created. That’s an easy enough step to take and looks a bit like this:

That should spit out two numbers. Those numbers should match. If they don’t, then something has gone wrong and you might want to try it again.

Closure:

There you go… Another quick and easy article. This one teaches you how to backup optical media to .iso, a handy skill if you want to preserve the data on the disks before they get worn out, broken, or lost. 

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 own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Let’s Reduce The Size Of .png Files

In today’s article, we’re going to learn how to reduce the size of .png files. PNG stands for Portable Network Graphics and they can be pretty large. They are raster image format files using lossless image compression. So, today we’ll be doing just that, compressing .png files, in the terminal.

As stated, PNG stands for Portable Network Graphics. Some folks will say that it stands for “PNG’s Not GIF” but they’re incorrect – but are correct about the motive. The .png format was developed to be a free-of-patent alternative to .gif files – some 25 years ago, as of the time this article is published. You can read more about the file format at the PNG Wikipedia Page.

The tool we’ll be using is known as ‘pngquant‘, which should be available in most default repositories. You can check the man page, but it defines itself as:

pngquant — PNG converter and lossy image compressor

You’ll note that it says ‘lossy’ and that means you can lose some image quality with this compression – but from my testing it spits out a perfectly usable image, even while compressing it a great deal. It’s pretty handy. I haven’t tested it as a batch process on a bunch of files, but I have tested it on some files. In each case, I got a perfectly usable image that spit out the other side.

So, with that, let’s move on into the meat of the article, where we’ll learn to …

Reduce The Size Of .png Files:

As pngquant is a terminal-based application, it stands to reason that you’re gonna need an open terminal. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

I’ll give you the installation instructions for Debian/Ubuntu/Mint, but you should be able to find the package in most default repositories. To install in those particular distros:

Once ‘pngquant’ has been installed, navigate to a directory where you have some .png files waiting to be compressed. Once you’re there, run this command:

That’ll tell you the size of the .png in question. Now, you’re going to compress it with the following command:

By default, ‘pngquant’ will retain the original file and create a new file that has appended – fs8 to the file name. So, foo.png becomes foo-fs8.png. You can change that behavior with the --ext flag. 

Here’s an example where an already small .png file was reduced even further by way of pngquant:

pngquant in action - reducing the size of .png files
As you can see, it reduced the file size by about half. The resulting quality was fine.

You can find GUI software that will do this for you, but this is a quick and easy way to reduce the size of .png files in the terminal. While not opensource, there’s XnViewMP and I’m pretty sure XnConvert works with Linux as well. If not, XnViewMP does and has batch conversion as an option – while the latter is specifically for batch conversion.

Closure:

And there you have it… You have a way to reduce the size of .png files in your terminal. Just what you always wanted! I don’t see my average reader doing a whole lot of this, but it’s an option if you want. I use a service that switches my images to WebP as it’s faster and lighter. It’s done by my CDN for me, which is nice and one of the reasons the site loads quickly.

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 own site. The first person to read this sentence should contact me and I’ll donate five dollars to their favorite charity that accepts PayPal. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Convert Disk Image Formats To .ISO

Today’s article will teach you how to convert disk image formats to .iso. It’s a pretty handy tool to have in your toolbox. This is going to be a pretty easy article to follow, so it shouldn’t be all that long.

In case you don’t know, there are all sorts of disk image formats. The .bin and .cue are the two you are most likely to be familiar with (beyond the .iso, which is the most common in the Linux world).

There are .B5I .BIN, CDI, CUE, .MDF, MDE, and .NRG. There may be more, but that’s all the tool we’ll be using handles. As I mentioned, you may well already be familiar with the .BIN and .CUE disk image formats. You see those from time to time and now you no longer have to ignore them – you’ll have just the tool you need to convert them to .ISO (which many programs expect – and work with, while not working with other formats).

The tool we’ll be using is known as iat and it’s actually just a tiny command-line application. The man page defines it as such:

iat – converts many CD-ROM image formats to iso9660

The latter part is probably important to note. That means that it only converts to .ISO format and nothing else. If you want to convert to a different format, or in the opposite direction, this is not the correct tool the job.

So then, let’s take a few minutes to use iat and learn how to …

Convert Disk Image Formats:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

With your terminal now open, the rest is easy. It’s almost certainly in your default repositories, and unlikely to be installed by default. You can install it in your usual manner – but I’ll show you how to do it in Debian/Ubuntu/Mint derivatives:

It’ll be just as easy to install in any major distro. To use it, it’s REALLY simple… It’s just this easy:

Sure, you can check out man iat, but it’s not really all that complicated. This is pretty much the easiest tool you’ll find to convert disk image formats to .iso. Tell it which file you want to convert, tell it what you want to name the output file, and then you just pound the enter button on your keyboard and wait. The output is a handy .iso that you can use just like you would any other .iso.

Closure:

There you have it! You have a new article that teaches you how to convert disk image formats to .iso – which can seriously come in handy when you need to burn a disk image and the software you’re using only accepts .iso as the input.

It’s also the first article I hadn’t obligated myself to do! This is now over a year since the first article was published, and one published every other day. I am absolutely NOT committing to maintaining the same publication schedules, but I just don’t think I can let the site sit here idle. So, we’ll see what happens.

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 own 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.