1

When I try to install some pre-install apps like m4, csh,g++,gfortran on Ubuntu 12.04 (64 bit) before installing WRF model , I face with this problem:

sudo apt-get install m4
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/ppa.launchpad.net_sun-java-community-team_sun-java6_ubuntu_dists_precise_main_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.

What should I do ? How can I install these apps? I also, couldn't install gfortran.

I'll be thankful if you help me.

Fern Moss
  • 8,785
motti
  • 13

1 Answers1

0

You seriously need to get rid of that extremely outdated, insecure, unmaintained ppa. Open a terminal and execute the following commands:

sudo rm /etc/apt/sources.list.d/sun*
sudo apt-get clean
sudo apt-get autoclean
sudo apt-get update
sudo apt-get install --reinstall m4 csh g++ gfortran

If you would like to have an up to date sun java ppa I suggest this installer.


EDIT

Yes, you should fix that. First, run:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.save
sudo nano /etc/apt/sources.list

press CTRL + W and type:

extras.ubuntu

and press ENTER.

Now, the two lines should read exactly:

deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main

When you are done press CTRL + o and then press ENTER to save the file. Press CTRL + X to exit nano.

Now, run the following commands to update your package list and to apply recent security updates and bug fixes:

sudo apt-get update
sudo apt-get upgrade

Please post any errors, thanks.

mchid
  • 43,546
  • 8
  • 97
  • 150
  • thank you. I tried sudo apt-get update and I face with this error:W:" Failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/Release

    W: Some index files failed to download. They have been ignored, or old ones used instead". Is it important? however, I can install m4 ,csh ,g++ ,and gfortran.

    – motti Jun 05 '15 at 20:42
  • @motti I have updated the answer, yes, it's pretty important to always make sure apt-get downloads all needed files. – mchid Jun 06 '15 at 03:26
  • mchid, thank you so much for your sincerely help. I renamed the precise into trusty in line two and save it. After this, all following commands are worked. Now, update and upgrate commands are worked. Thanks a lot. – motti Jun 06 '15 at 08:34
  • @motti awesome, you can accept this solution by clicking the icon on the left to mark the question as answered. – mchid Jun 06 '15 at 08:46