Thursday, August 29, 2013

E: Sub-process /usr/bin/dpkg returned an error code (1)

E: Sub-process /usr/bin/dpkg returned an error code (1)

If you are installing any package in Ubuntu or Debian and it gives above error

Solution : 1
Run following command in terminal
sudo dpkg --configure -a
Now try to install your package again.

Solution : 2
Run following command in terminal
sudo apt-get -f install
Now try to install your package again.

Solution : 3
Open file /var/lib/dpkg/status and remove the whole block of corrupted packages.
Now try to install your package again.

Format USB pen drive using command line on Linux


Format USB pen drive on Linux

First find the device path of the USB device using following command
fdisk -l
Output looks like this.

Now you can find the device path of the USB drive.
Suppose it is /dev/sdb1

Format pen drive in fat32 filesystem, Run following command
mkdosfs -F32 -v -n "" /dev/sdb1

Format pen drive in NTFS filesystem, Run following command
mkntfs -Q -v -L "" /dev/sdb1

Format pen drive in ext4 filesystem, Run following command
mkfs.ext4 -j -O extent -L "" /dev/sdb1

Format pen drive in ext3 filesystem, Run following command
mkfs.ext3 -L "" /dev/sdb1

Format pen drive in ext2 filesystem, Run following command
mkfs.ext2 -L "" /dev/sdb1

Format pen drive in fat16 filesystem, Run following command
mkdosfs -F16 -v -n "" /dev/sdb1

Note :
Change /dev/sdb1 with your device path.

Install Netbeans IDE on Ubuntu in three easy steps

Install Netbeans IDE on Ubuntu :

Step -1
Download sh file of Netbeans IDE from here according to your requirement.
If you want it for JAVA SE / EE or C/C++ or PHP or all. They have all options.
Download your desired sh file.

Step-2
Install openjdk on Ubuntu. Run following command.
sudo apt-get install openjdk-6-jdk

or
sudo apt-get install openjdk-7-jdk

Step-3
Now execute the downloaded sh file of Netbeans IDE.
sh /path/of/downloaded/sh-file.sh

Complete the wizard.

Note :
If third step gives you permission denied error, it means your downloaded sh file is not executable, make it executable using
chmod a+x /path/of/downloaded/sh-file.sh


Configure: error: xml2-config not found. Please check your libxml2 installation

Configure: error: xml2-config not found. Please check your libxml2 installation

If you find this error in CentOS, Fedora or RHEL,  Run
# yum install libxml2-devel

If you find this error in Ubuntu or Debian, Run
# apt-get install libxml2-dev


configure: error: Please reinstall the BZip2 distribution

configure: error: Please reinstall the BZip2 distribution

If you find this error in CentOS, Fedora or RHEL, Run
# yum install bzip2-devel

If you find this error in Ubuntu or Debian, Run
# apt-get install libbz2-dev