[SOLVED] Error ‘dpkg: error processing (–unpack) trying to overwrite…

Recently I got this error after installing VLC on Ubuntu 10.10 Maverick Meerkat. Not really remembering what caused the error to be triggered in the first place, it became very difficult to find a solution for it.
When I executed sudo apt-get upgrade to upgrade my packages, it told me there was some issues and I needed to execute sudo apt-get -f install to fix them. I did as advised but it produced the following error:

Reading package lists… Done
Building dependency tree
Reading state information… Done
Correcting dependencies… Done
The following extra packages will be installed:
vlc vlc-nox
Suggested packages:
mozilla-plugin-vlc videolan-doc
The following packages will be upgraded:
vlc vlc-nox
2 upgraded, 0 newly installed, 0 to remove and 198 not upgraded.
66 not fully installed or removed.
Need to get 0B/5,258kB of archives.
After this operation, 229kB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
vlc vlc-nox
Install these packages without verification [y/N]? y
(Reading database … 206759 files and directories currently installed.)
Preparing to replace vlc 1.1.0-1~ppa1~maverick (using …/vlc_1.1.0-1ubuntu1_i386.deb) …
Unpacking replacement vlc …
dpkg: error processing /var/cache/apt/archives/vlc_1.1.0-1ubuntu1_i386.deb (–unpack):
trying to overwrite ‘/usr/lib/vlc/plugins/access/libxcb_screen_plugin.so’, which is also in package vlc-nox 1.1.0-1~ppa1~maverick
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Preparing to replace vlc-nox 1.1.0-1~ppa1~maverick (using …/vlc-nox_1.1.0-1ubuntu1_i386.deb) …
Unpacking replacement vlc-nox …
dpkg: error processing /var/cache/apt/archives/vlc-nox_1.1.0-1ubuntu1_i386.deb (–unpack):
trying to overwrite ‘/usr/lib/vlc/lua/playlist/anevia_streams.luac’, which is also in package vlc 1.1.0-1~ppa1~maverick
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/vlc_1.1.0-1ubuntu1_i386.deb
/var/cache/apt/archives/vlc-nox_1.1.0-1ubuntu1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

After some time of googling and head-scratching, I finally found a solution and it wasn’t that difficult either.
To fix it just note down the path of files which are causing the trouble. From the above mentioned error, we can clearly see that there are these two files causing the error:

/var/cache/apt/archives/vlc_1.1.0-1ubuntu1_i386.deb
and
/var/cache/apt/archives/vlc-nox_1.1.0-1ubuntu1_i386.deb

You just forcefully overwrite them using the following command:

sudo dpkg -i –force-overwrite <filename>
sudo apt-get -f install

For the above two files you’d execute:

sudo dpkg -i –force-overwrite /var/cache/apt/archives/vlc_1.1.0-1ubuntu1_i386.deb
sudo dpkg -i –force-overwrite /var/cache/apt/archives/vlc-nox_1.1.0-1ubuntu1_i386.deb
sudo apt-get -f install

This fixed the error for me and I hope this fixes it for you too.

Cheers!

[HOWTO] Download youtube video from command-line

Linux is awesome and so is the terminal. Things become a lot more easy if you can just type in few commands and get your work done. Downloading youtube video has always been messy with GUI downloaders, browser extensions and web services which claim to give you the download link to that video. Now, you can download it from the terminal using youtube-dl in ubuntu. You can also download and install it in other flavors of linux. The script is written in python.

Install youtube-dl from the official repository in Ubuntu:

sudo apt-get install youtube-dl

To download a video execute the following:

youtube-dl <url>

Example screenshot:


More options and switches:

-b            Best quality
-m            Mobile version
-d            High Definition
-g            Don’t download, just show the url
-c            Resume download of a video which was interrupted before
-w            Don’t overwrite existing file

For complete list of switches execute man youtube-dl in terminal.

Cheers!

[Solved] Unable to update .ICEauthority error on booting

I received this error after installing updates and restarting the computer. It was nothing but a file-permission issue. You can easily fix it.

To solve it, type the follow these instructions:

Go to Application menu->Accessories->Terminal or press Alt+F2 and type gnome-terminal and press enter.

In terminal, type:

sudo chown username:username .ICEauthority

sudo chmod 0644 .ICEauthority

Replace username with your own username.

Restart your computer to check that the problem has been fixed.

Cheers!

[SOLVED] Error “undefined reference to `libiconv_open’” while compiling

I was trying to compile sphinx server from source but I go the following errors on executing make

undefined reference to `libiconv_open’
undefined reference to `libiconv’
undefined reference to `libiconv_close’

To fix the error, you can compile without iconv (multiple encoding support) support. Use the following commands to compile. You can add more parameters as per your requirements.

./configure --without-iconv
make CFLAGS=-liconv
make install

I hope that helps

[SOLVED] kernel_thread_helper+0x7/0x10 during Ubuntu boot process

Recently, I tried installing Ubuntu on my friend’s computer. I used Maverick’s Live CD but the boot process stuck at kernel_thread_helper+0x7/0x10. I noticed a huge list of acpi errors above this message and figured it was somehow related to ACPI. To solve the problem I simply turned of ACPI.

Solving the problem in Live CD:
Insert live cd, and before the Ubuntu tries to boot into it press Esc repeatedly until you get to Ubuntu menu. Press F6 and select acpi=off and press enter. You can now press Esc again to close this sub-menu and press ‘Enter’ to boot into Live CD. This time your boot process should complete without any errors.

Solving the problem in installed system:
(Once you install Ubuntu using Live CD, you have to follow the following steps to fix this problem in your installation.)
1. In the grub menu, press ‘e’. Search for ‘quiet splash’ and add ‘acpi=off’ (without quotes) after that to make it look like ‘quiet splash acpi=off’. You’ll be able to boot in now.
2. Go to Applications->Accessories->Terminal
3. Execute:

sudo gedit /etc/default/grub

4. Find the line which says GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash” and change it to the following:
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash acpi=off”
5. Exit gedit.
6. Execute:

sudo update-grub

7. Restart. This time you don’t have to edit anything. Ubuntu should boot without any issues.

Comments and suggestions are more than welcome.

[HowTo] Use locate command and updatedb to search all partitions

Updatedb command by default does not include /media path for updating its database. You can change the settings in /etc/updatedb.conf so that it starts indexing other partitions too.

sudo gedit /etc/updatedb.conf

In the PRUNEPATHS setting, remove /media. Save the file and run

sudo updatedb

This will index all your files from /media folder. Make sure the partitions are mounted.

Cheers!

[HowTo] Suspend Ubuntu from terminal or keyboard shortcuts

When learning to make bash scripts, at one point or other you’d like to know how to suspend your computer from terminal. Well, there are quite some methods available for Ubuntu. You can choose whatever suits your needs. I prefer method 3 (look below).

Method 1:

sudo sh /etc/acpi/sleep.sh force

Method 2:

sudo pm-suspend

This command might not be available in older versions of Ubuntu. It works perfectly fine on Lucid and Maverick.

Method 3:

This command does not require sudo so it might come in handy. For example, you can map it to a keyboard shortcut for easy access.

dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend

One thing to notice here is none of the commands I mentioned here will ask your password on resuming. For that you’ll have to lock your computer before suspending. You’ll have to use gnome-screensaver-command –lock before suspending to lock the computer

Create a suspend script:

Open a new file in gedit:

sudo gedit /usr/bin/suspend-comp

Copy and paste the following code and save it:

#!/bin/sh 
sleep $1;
dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend

If you want the script to ask for a password on resuming, copy-paste this code instead:

#!/bin/sh 
sleep $1;
gnome-screensaver-command --lock
dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend

Add the executable bit:

sudo chmod +x /usr/bin/suspend-comp

Now suspend-comp time-in-seconds can be used in terminal. For example, if I want to have my computer suspended after 20 seconds I can simply type:

suspend-comp 20

Mapping it to keyboard shortcut for easy access:

Go to System->Preferences->Keyboard Shortcuts. Click Add. Type Suspend for Name and suspend-comp 0 in Command field. Click Apply.

Now scroll to the bottom of the list to find Suspend. Click on ‘Disabled’ on the right to ‘Suspend’. Now press any key combination to map the command to it. I used Ctrl+Alt+Shift+s.

Now simply pressing Ctrl+Alt+Shift+s will suspend your computer.

Cheers!

[Solved] apt-get “is to be installed” errors in Ubuntu

This class of error means the dependency is of different version than required. I tried to install deluge-console but it gave me the following error:

deluge-console : Depends: deluge-common (= 1.3.0-0ubuntu1) but 1.3.0-1~getdeb1 is to be installed

The error is not that self-explanatory. Here the deluge-common version required by deluge-console is 1.3.0-0 but 1.3.0-1 is installed. This means that I have newer version of a dependency required by the application I am trying to install.

Fortunately, you can force the version in apt-get:

sudo apt-get install deluge-common=1.3.0-0ubuntu1

I forced an older version, downgrading the package. This fixed the error for me and I could successfully install deluge-console after that.

This method can be applied to fix problems in other applications as well.

Cheers!