Tuesday, September 27, 2011

Removing "RC" packages on Debian/Ubuntu

If you do "dpkg -l", sometimes you will get to see a long list of packages with the following details:
  • rc  package-name  0.4-3  package-details
Note the "rc" status at the beginning of the package description. Some packages will show up in the "dpkg -l" output even after removing them. The reason behind this is - packages with "rc" status indicate that the packages have been removed but some configuration files for those packages are left on the system.

To remove these packages, do the following:
  • sudo dpkg --purge package-name
For a list of packages, run the following:
  • dpkg -l | grep ^rc | cut -d ' ' -f3 | xargs sudo dpkg --purge








Friday, September 2, 2011

Forcing Vim's syntax highlighting (for odd file extensions)

I often tend to keep backup copies of my C/C++ source files with odd extensions (i.e. something that does not end with CC or C). If these files are opened with Vim, they wouldn't be recognized as they should, which means my CTAGS extension and colored syntax highlighting would both refrain to work. The quick solution to this problem is to tell Vim explicitly about the file type. Here is how one can do it:
:setfiletype c
More information on it, as always:
:help setfiletype