Ubuntu – Getting error message Package operation failed


while installing any softwere or update i am getting this error

installArchives() failed: dpkg: error: parsing file '/var/lib/dpkg/available' near line 0:

 field name `/usr/share/gnome/help-langpack/gedit/sl/gedit-plugins-modelines.page' must be followed by colon

Best Answer

For some reasons the file /var/lib/dpkg/available is damaged.

Move it away, for example with

sudo mv /var/lib/dpkg/available /var/lib/dpkg/available.bak

If there is a file /var/lib/dpkg/available-old try if this one works:

sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available

If installing software works now you are done.

If it still doesn't work run

sudo rm /var/lib/dpkg/available 
sudo sudo touch /var/lib/dpkg/available  
sudo sh -c 'for i in /var/lib/apt/lists/*_Packages; do dpkg --merge-avail "$i"; done'

to create a new file.

Related Question