Posts Tagged ‘ArchLinux’

Pacman and cleaning out old packages

Tuesday, May 1st, 2012

Just found this out, and thought it may benefit someone else, so here you go :)

In my netbook install of Archlinux I was running out of disk space on / because the package cache (/var/cache/pacman/pkg/) was always filling up with old versions of packages. The reason for this obviously being that whenever I would upgrade a package, it wouldn’t be until next reboot I’d know if something was amiss or not, so pacman -Sc wasn’t really an option. And at next reboot, did I remember to run pacman -Sc? Of course not.

But, as it has been said before, and will be said again countless times: the arch wiki is fantastic!

Take for instance the pacman page, where it gives a hint that if you don’t really like pacman -Sc, you could try cacheclean (found in the AUR).

It takes at least one parameter, or, I guess, two at the most. The required one is a number, indicating how many previous versions you wish to keep. And on top of that you could add -p for preview, in which case it will only simulate removing the packages, and instead printing their names, so you have a chance to spot any mistake you might have made. With -v, cacheclean will perform the task, and tell you what it has done.

Since it will operate on /var/ you’ll need to execute it as root.

Simple as that. The only gotcha is that it is a python3 script, but since that is the standard in arch these days anyway, it shouldn’t make much of a difference anyhow.


My Software Stack 2011 edition

Saturday, December 31st, 2011

I realize that I haven’t written my customary “software stack” post for this year yet. But hey, from where I’m sitting, I still have … 36 minutes to spare ;)

I’ll be using the same categories as last year; system, communications, web, development, office suite, server, organization, and entertainment.


The OS of choice is still Archlinux, my window manager is still wmii, my terminal emulator is rxvt-unicode, upgraded by also installing urxvt-tabbedex.

My shell is still bash, my cron daemon is still fcron, and my network manager is wicd.

To this configuration I’ve added the terminal multiplexer tmux, and have lately found out just how useful mc can be. Oh, and qmv from the renameutils package is now a given part of the stack.


Not much change here, Thunderbird for email, Pidgin for instant messaging, irssi for IRC.

Heybuddy has been replaced by identicurse as my micro-blogging ( client. Heybuddy is very nice, but I can use identicurse from the commandline, and it has vim-like bindings.

For Pidgin I use OTR to encrypt conversations. For Thunderbird I use the enigmail addon along with GnuPG.

This means that Thunderbird still hasn’t been replaced by the “mutt-stack” (mutt, msmtp, offlineimap and mairix) and this is mostly due to me not having the energy to learn how to configure mutt.

I also considered trying to replace Pidgin with irssi and bitlbee but Pidgin + OTR works so well, and I have no idea about how well OTR works with bitlbee/irssi (well, actually, I’ve found irssi + OTR to be flaky at best.


Not much changed here either, Firefox dominates, and I haven’t looked further into uzbl although that is still on the TODO list, for some day.

I do some times also use w3m, elinks, wget, curl and perl-libwww.

My Firefox is customized with NoScript, RequestPolicy, some other stuff, and Pentadactyl.

Privoxy is nowadays also part of the loadout, to filter out ads and other undesirable web “resources”.


In this category there has actually been some changes:

  • gvim has been completely dropped
  • eclipse has been dropped, using vim instead
  • mercurial has been replaced by git

Thanks in no small part to my job, I have gotten more intimate knowledge of awk and expect, as well as beginning to learn Perl.

I still do some Python hacking, a whole lot of shell scripting, and for many of these hacks, SQLite is a faithful companion.

Doh! I completely forgot that I’ve been dabbling around with Erlang as well, and that mscgen has been immensely helpful in helping me visualize communication paths between various modules.

“Office suite”

I still use LaTeX for PDF creation (sorry hook, still haven’t gotten around to checking out ConTeXt), I haven’t really used sc at all, it was just too hard to learn the controls, and I had too few spreadsheets in need of creating. I use qalculate almost on a weekly basis, but for shell scripts I’ve started using bc instead.

A potential replacement for sc could be teapot, but again, I usually don’t create spreadsheets…


Since I’ve dropped mercurial, and since the mercurial-server package suddenly stopped working after a system update, I couldn’t be bothered to fix it, and it is now dropped.

screen and irssi is of course always a winning combination.

nginx and uwsgi has not been used to any extent, I haven’t tried setting up a VPN service, but I have a couple of ideas for the coming year (mumble, some VPN service, some nginx + Python/Perl thingies, bitlbee) and maybe replace the Ubuntu installation with Debian.


I still use both vimwiki and vim outliner, and my Important Dates Notifier script.

Still no TaskJuggler, and I haven’t gotten much use out of abook.

remind has completely replaced when, while I haven’t gotten any use what so ever out of wyrd.


For consuming stuff I use evince (PDF), mplayer (video), while for music, moc has had to step down from the throne, to leave place for mpd and ncmpcpp.

eog along with gthumb (replacing geeqie) handles viewing images.

For manipulation/creation needs I use LaTeX, or possibly Scribus, ffmpeg, audacity, imagemagick, inkscape, and gimp.

Bonus: Security

I thought I’d add another category, security, since I finally have something worthwhile to report here.

I’ve begun encrypting selected parts of my hard drive (mostly my email directory) using EncFS, and I use my passtore script for password management.

And sometimes (this was mostly relevant for when debugging passtore after having begun actively using it) when I have a sensitive file which I for a session need to store on the hard drive, in clear text, I use quixand to create an encrypted directory with a session key only stored in RAM. So once the session has ended, there is little chance of retrieving the key and decrypting the encrypted directory.

Ending notes

That’s about it. Some new stuff, mostly old stuff, only a few things getting kicked off the list. My stack is pretty stable for now. I wonder what cool stuff I will find in 2012 :D


rkhunter and pacman on arch

Tuesday, May 31st, 2011

I read a notice, or a post, somewhere the other week, and it planted a seed in my head, so today I installed chkrootkit and rkhunter.

chkrootkit revealed nothing of interest, while rkhunter did find potential problems.

At first I found it rather unsettling. rkhunter pointed at specific files which it obviously didn’t think should be there.

On my desktop that was /usr/lib/libtty.a which could be a part of a rootkit named “fuck `it“. Cleverly putting that grave accent in the name of the rootkit, the original authors have effectively made it impossible to search for (at least using Google).

Resisting the urge to panic and do something rash (like formatting the system) I instead booted up my netbook as well, installing rkhunter and executing it there as well.

The two installs are almost identical, and if anything, the netbook, at times operating outside my own network, should run a higher risk of getting infected with stuff (or so my reasoning goes anyway).

The report on my netbook came back with other things, mostly sshd configuration stuff, but sshd is never running on the netbook (I edited the config options anyway as they were reasonable and would protect the system if the ssh daemon was ever started on the netbook), an entry in /etc/rc.local (which I know I put there), and a hidden compressed man-page which rkhunter had reported on the desktop as well.

Back to libtty.a. the good news was that I could list it, it wasn’t hiding, well the file was one amonst a plethora of files in /usr/lib/ but having pinpointed it, it didn’t try to hide from me.

So my next thought was: “It must have come from somewhere.”

There are few things I have installed from source, so the most obvious place to look was towards packages installed from AUR.

Which means that I could ask pacman which package this file belonged to.

pacman -Qo /usr/lib/libtty.a revealed that the package it came from was termrec, a packaged I had installed because I at one time or another had an idea.

termrec is used to record and replay a terminal session, but I never got around to trying it out.

It is entirely possible that the behaviour of termrec is close enough to that of a malware to be identified as such, but once I realized the connection I was a lot calmer.

Then again, I haven’t used termrec, and have no reason to keep it around, so I uninstalled it, and with it, /usr/lib/libtty.a disappeared as well, so I don’t believe there ever was a threat.

As for the hidden, compressed man-page, it turned out to belong to krb5, so I am pretty sure that is harmless as well.

All in all, it was a pretty nice experience, especially the fact that I was mindful enough to keep cool :)


My software stack revisted – Intro

Wednesday, December 22nd, 2010

A little more than a year and a half ago, I wrote a post with the title “My software stack”.

When I wrote that post I was still studying at the IT University, and the post was aimed at fellow students, attempting to distill what I had come to learn, what software I had come to use, which could be of use to others as well.

Time pass, things change, I’m no longer studying, so I thought it might be interesting to revisit the subject. To see what has changed, what has remained the same.

More than that, re-reading the original post, I see that I list many libraries that I’ve since only used once or twice. It’s not that these are useless in any way, far from it, I stand by my recommendations about them, it’s just that for the types of things I do, I have not found much use for them.

So I can’t really say that they’re a part of my software stack. And that is one thing I aim to improve this time around. Instead of writing about the software stack I wish I had, I will try to restrict myself to presenting the software I have used at least more than three times.

Instead of my usual style of writing (a great big wall of text) I’ll do this as a series of posts instead, and this first post will lay the foundation of my software stack: the operating system and relevant environment.

So without any further ado, the base software:

Operating system

I have now replaced Ubuntu with ArchLinux, as Ubuntu once replaced Windows XP. As with the switch from Windows to Ubuntu, I find I don’t have much to complain about in the predecessor, it is just that the successor is better.

Ubuntu is still a great distribution, and I would recommend it over ArchLinux for newcomers to the GNU/Linux world. It’s just that I don’t feel like a newcomer anymore.

Ubuntu is absolutely the easiest GNU/Linux distribution I have tested, with sane user-friendly default settings. And it works well as is.

But I have come to the point that I feel confident that I can do a better job at selecting what software I want installed in my system, than Canonical can do for me. And I’d rather spend the time assembling these, than uninstalling stuff from Ubuntu, and their dependencies, and their dependencies and… you get my point.

My second largest reason may well have evaporated now that Canonical seems to be making Ubuntu a rolling release as well. I’m happy about this, because Ubuntu isn’t completely out in the cold, but more on that later.

Window manager

Ever since pesa installed wmii on my old laptop, I was hooked. wmii is a tiling window manager which tries it damnedest to maximize the use of the available screen area. And it kicks ass at doing it.

Sadly I could never get it to work at all in Ubuntu (except for the one time when pesa installed it for me). In Arch it might have taken half an hour to get set up and configured. Small tweaking to get it just right took longer, but it was worth it.

If you, like me, try to spend as much time as possible in a terminal, you are bound to like wmii. GUI-applications work just as well, of course, but they seem to always claim more screen real estate than they need, so better to just stick them in a tag (virtual desktop for you non-wmii-users) on their own and let them occupy all the screen space they want.

Terminal and shell

Since all the cool kids these days are using rxvt-unicode I guess so am I ;)

And despite two attempts to make friends with zsh, I always end up coming back to bash.

I guess that’s all for now. The next post will be about (multi)media and entertainment.