lkubuntu

A listing of useful software, tips, tweaks and hacks for Ubuntu

Easy way to fix ‘unable to open file ‘/var/lib/dpkg/tmp.ci//.svn’: Is a directory’

Did you ever have an error message similar to ‘unable to open file ‘/var/lib/dpkg/tmp.ci//.svn’: Is a directory’?

Here is a way to fix it:

Open up a Terminal window, and type in it:

export DEBPATH=path/to/bad/debfile.deb

Then copy and paste this into it:

sudo apt-add-repository ppa:lkjoel/deb-extract
sudo apt-get update
sudo apt-get install deb-extract dpkg-dev
sudo deb-extract $DEBPATH `basename $DEBPATH .deb`
cd `basename $DEBPATH .deb`
cat < svnemfix.sh
#!/bin/bash
# SVN Emergency Fix
function rdirls() {
for i in $1/*
do
if [ -d "$i" ]
then
echo $i
rm -rf $i/.svn
rdirls $i
else
echo "NOT $i" > /dev/null 2>&1
fi
done
}
if [ -d "$1" ]
then
echo $1
rm -rf $1/.svn
rdirls $1
fi
EOF
chmod +x svnemfix.sh
./svnemfix.sh .
rm -f svnemfix.sh
cd ..
sudo dpkg-deb -b `basename $DEBPATH .deb`

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 71 other followers