Ubuntu Tip: Removing All Packages Installed from a PPA

PPAs (Personal Package Archives) are a popular way to install pre-built packages that for some reason are not (yet) available in Ubuntu’s standard package repositories. Some common examples that come to my mind:

  • installing the newest release of Emacs
  • installing the newest GPU drivers

Eventually, if you’re lucky1 you might not need the packages from the PPA anymore, so this brings us to the question of today’s article - how can you quickly remove everything you installed from a PPA? If you installed only a single package that’s not a big deal, but you might have installed dozens of packages from one PPA. A good example would be oibaf/graphics-drivers. Once you no longer need the newest drivers (e.g. after a distro upgrade) you can remove all of them like this:

$ sudo apt install ppa-purge
$ sudo ppa-purge ppa:oibaf/graphics-drivers

This will remove all packages installed from the PPA. Depending on whether the packages exist in other enabled repos or not that might result in downgrade or complete removal of those packages. In the specific example I’ve given we’d just downgrade all video driver packages to their versions available in Ubuntu’s own repos.

That’s all I have for you today. Keep hacking!

  1. Or unlucky - imagine some snapshot versions crashing constantly. 

Meta Redux

This site was my first attempt to write. I failed miserably and I produced some pretty crappy content, but I also learned a lot in the process.

Over the course of a decade the blog saw quite a few transformations and shifts in my focus and interests. For a few years it was named DevCraft1 and it was hosted on wordpress.com. Afterwards I adopted the (think) title and switched to Jekyll, Octopress and then again to Jekyll. Originally I was writing mostly tutorials on topics like Linux, Java, Emacs and Ruby, but eventually I started writing some essays as well (my favorite type of posts). As my OSS portfolio grew it started to gain significant coverage in my blog as well. (think) was a bit messy and without a clear direction, but I guess it was a somewhat accurate reflection of myself as well.

I’ve thought at times about deleting some of my lame articles and heavily copy-editing the rest to make them fit my current beliefs and standards of quality, but this approach felt like cheating to me. I was who I was and I wrote what I wrote. To me that certainly has a lot of value. I’ve been thinking lately that being (very) critical of your old work is a good indicator that you’re moving in the right direction. We can always do better, but we need to reach a certain level of experience to see that.

For various reasons (mostly a combination of frustration with Octopress and my (immense) laziness), I didn’t write anything between 2015 and 2018 and when I finally mustered the will to return to writing I decided to go with a clean slate and a new blog.2

These days most of my writing happens at Meta Redux, but I still plan to post here things that are worth sharing, but don’t fit the overall idea of Meta Redux (where my primary focus is my OSS work and essay-like articles).3

I guess I’ll still be writing here on programming-related topics, but who knows… Knowing me there’s a high chance I won’t actually write anything at all! There’s a good chance this will be final (think) article.

At any rate - it’s still a lot of fun to be re-reading my old articles (especially the rants) and comparing the person I used to be with the person I am today. I’m starting to think that’s the biggest value of running a personal blog - it’s a written account of our evolution as human beings.

  1. I used to be a huge StarCraft fan. 

  2. I also wanted a blog with a cool (for some definition of cool) name this time around. 

  3. I still write the occasional short Emacs article at https://emacsredux.com

Going Rogue

For many years I’ve enjoyed listening to programming podcasts - it’s the perfect way to make a commute a bit more fun and educational.1 RubyRogues was always one of my favourite Ruby shows and I find it very amusing that recently I ended up being their guest. I certainly didn’t see this coming! Seems that a lot has changed since the days I followed it actively, but it was still fun to make an appearance there.

If you’d like to listen to our conversation about RuboCop, Emacs and the future of Ruby be sure to check out this episode.

Until next time!

  1. Since I started working remotely I practically stopped listening to any podcasts. One of the few donwsides of remote work. 

If I Could Turn Back (Git) Time

If only there was an easy way to find the first commit in a Git repository… A bit of Googling unveils some pretty hard to remember incantations like:

$ git rev-list --max-parents=0 HEAD
91938b105b3e4ed86ba96602785123ffb1c0d1eb

That returns the SHA-1 hash of the first commit in the repo and you can use git show to actually see the commit details like this:

$ git show 91938b105b3e4ed86ba96602785123ffb1c0d1eb

Or you can simply combine the commands:

$ git show `git rev-list --max-parents=0 HEAD`

This gets the job done, but it’s kind of ugly and in practice you need to map it to some Git alias or a shell alias to be able to use it effectively. Here’s the shell alias approach:

alias git-first="git show `git rev-list --max-parents=0 HEAD`"

At this point it’s time for the twist it our story. Turns out there’s a much simpler way to get to the beginning of your history:

$ git log --reverse

Simple and sweet!

Migrating from Octopress to Jekyll

After dreading the migration of this site from Octopress 2 to Jekyll for years, I finally found the will to do it today. The process was actually very straight-forward and took me just a couple of hours (most of which I spent trying to find new a theme for the site and tweaking it afterwards).

More …