Showing posts with label apt-get. Show all posts
Showing posts with label apt-get. Show all posts

Saturday, February 28, 2009

Installing mediainfo on Ubuntu

There's no single ready made package for mediainfo as far as I can see, so no apt-get install, but the required .deb packages are available and so can be installed using dpkg.

Pick the appropriate packages for your system from the mediainfo sourceforge download page, then install in the correct order using dpkg -i.

To install the CLI version on my fit-pc Ubuntu 8.10 server, I did
$ wget http://downloads.sourceforge.net/mediainfo/mediainfo_0.7.11-1_i386.Debian_5.0.deb
$ wget http://downloads.sourceforge.net/mediainfo/libmediainfo0_0.7.11-1_i386.Debian_5.0.deb
$ wget http://downloads.sourceforge.net/zenlib/libzen0_0.3.8-1_i386.Debian_5.0.deb
$ sudo dpkg -i libzen0_0.3.8-1_i386.Debian_5.0.deb
$ sudo dpkg -i libmediainfo0_0.7.11-1_i386.Debian_5.0.deb
$ sudo dpkg -i mediainfo_0.7.11-1_i386.Debian_5.0.deb
Then it's good to go.

Saturday, November 22, 2008

When apt-get fails to reinstall a package

While experimenting with the Moin Moin Wiki, I got into some bother attempting to uninstall and reinstall it. The problem originated from me manually removing some configuration files. apt-get subsequently refused to reinstall those files. I eventually resolved by using dpkg.

I had initially followed the installation steps for Moin Moin on the Ubuntu Server Guide. So I had installed by doing
$ sudo apt-get install python-moinmoin
So to uninstall, I did
$ sudo apt-get remove python-moinmoin
I now know that that did not uninstall a base package, moinmoin-common, on which it depends. But I didn't notice that at first. All I saw was that some configuration files were still present in /etc/moin, so I rm -rf them.

And there began my trouble, because thereafter I could not get apt-get to delete or reinstall the configuration files to that dir.

I did various iterations of apt-get install, apt-get remove and apt-get purge for the moinmoin-common and python-moinmoin packages. But the remove operations never removed /etc/moin and the installs never installed the missing files.

I used dpkg-deb to inspect the moinmoin-common archive file in /var/cache/apt/archives. I could see the to files I wanted were in the archive. But I could not get them to unpack to /etc/moin.

A temporary workaround was to use dpkg-deb to extract the archive file to /tmp, which unpacked everything, and then manually copy the uninstallable files from there to /etc/moin. But I wanted to find the proper solution.

I found a thread on the Ubuntu Forums outlining an equivalent problem with an apache2 installation. The advice there was to use Synaptic to remove the package. I don't have that option as I am running a headless server and Synaptic is a GUI tool. But at least there was the suggestion of a solution. If it can be done in a Debian/Ubuntu GUI, then be sure it can be done on the command line too.

Then I found a good article at Linux.com which explained how you can escalate from apt-get to dpkg to resolve package management problems.

So the happy ending was to do
$ sudo dpkg --purge moinmoin-common
This removed the troublesome files and the references to them that the package manager was evidently keeping. After that, I was able to cleanly reinstall Moin Moin.