Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I sat down at Starbucks this afternoon to do some work (Ubuntu 12.04 Desktop x64), and got the red-circle-with-white-line error icon in the systray notifying of a package error. Also, apt, aptitude, update-manager, and synaptic were all failing to even start up because of this.

Took a closer look, and the error was:

> sudo aptitude install mmv
[sudo] password for kurtosis: 
[ ERR] Reading package lists
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/linux.dropbox.com_ubuntu_dists_precise_main_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.
[ ERR] Reading package lists
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/linux.dropbox.com_ubuntu_dists_precise_main_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.

So opened up the culprit, /var/lib/apt/lists/linux.dropbox.com_ubuntu_dists_precise_main_binary-i386_Packages, and lo and behold, the entire file has been overwritten by the html source for Starbuck's ATT wifi terms and conditions page, that you have to agree to by checking the checkbox the first time you log onto their free wifi (first few lines below).

This is extremely bizarre and bit disconcerting, since some random internet site has managed to overwrite a file that should only be modifiable by root. Any idea what happened?

Solved by deleting /var/lib/apt/lists and regenerating with this command:

$ sudo -i
# apt-get clean
# cd /var/lib/apt
# mv lists lists.old
# mkdir -p lists/partial
# apt-get clean
# apt-get update

Starbucks ATT wifi homepage source:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
  <title>AT&T Wi-Fi Service @ Starbucks</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link rel="shortcut icon" type="image/ico" href="/favicon.ico" />
  <script type="text/javascript" language="javascript" src="/dhtml/master.js"></script>
  <script type="text/javascript" language="javascript" src="/dhtml/x_core.js"></script>
  <script type="text/javascript" language="javascript" src="/dhtml/x_event.js"></script>
  <script type="text/javascript" language="javascript" src="/dhtml/x_xhr.js"></script>
  <script type="text/javascript" src="/dhtml/aws/dhtml.js"></script>
  <script type="text/javascript" src="/dhtml/jquery/jquery-1.3.2.js"></script>
  <script type="text/javascript" language="javascript" src="/dhtml/jquery/aws_jclock_2.2.0.js"></script>
  <script type="text/javascript" language="javascript">
$(function($) {
        var options = {
                format: '%i:%M<span class="clock_ampm">%P</span>'
        }
        $('.jclock').jclock(options);
});
  </script> 

  <link rel="stylesheet" type="text/css" href="/css/att/themes/sbux/laptop_free_v3.css"/>
  <link rel="stylesheet" type="text/css" href="/css/att/themes/sbux/sbux_auto_addl_v2.css"/>

 </head>
 <body>
  <div id="free_wrap">
   <div id="topblock">
  <div id="topmid">
         <div id="free_sbux_mainform">
          <div id="iframe_free">
          <iframe id="sbux_iframe" src="http://www.starbucks.com/coffeehouse/wi-fi-landing" scrolling="no">
                                </iframe>
          </div id="iframe_free">
          <div id="free_sbux_logo"><a href="http://www.starbucks.com"></a></div id="free_sbux_logo">
         <div id="free_sbux_location"><div id="location_city">PALO ALTO, CA</div id="id="location_city"></div id="free_sbux_location">
          <div id="inline_free_form">
          <div id="free_text_line">Starbucks is pleased to offer complimentary Wi-Fi <b>including the premium content of the Starbucks Digital Network</b> to customers who are enjoying our food and beverages.</div>
...
share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

Here's what happened.

  • A sudo apt-get update was either performed manually or it was triggered automatically ( Remember the automatic updates from update manager? ) and attempted to refresh the lists.
  • You happened to be connected to the wifi, but did not accept the licence or whatever yet.
  • The wifi was bad enough to send probably a HTTP 301/302 status (redirect) instead of something more appropriate, and apt obediently followed it, dumping the response page in the lists file.
  • It looks perfectly normal, and is due to a misconfiguration of the wifi. Ideally, when you are not yet allowed access, a error code is to be returned so that similar things won't happen. Just for an anology, if you had a script or alternate setup to resume a download whenever you connect to internet, and it starts working when you connect to this wifi and you have not yet accepted the agreement, the tool will dutifully dump the same page and declare that the file has been downloaded, potentially overwriting any previous part of the original file.

If you are connected to internet, It should be perfectly safe to delete the entire folder /var/lib/apt/lists and do a update. That will fix this. To be on the safe side, you may choose to backup instead of delete.

sudo mv /var/lib/apt/lists ~;sudo apt-get update

should do the trick, and if it doesn't, revert back with sudo mv ~/lists /var/lib/apt

share|improve this answer
    
Thanks for the info. The solution I found was a tad more elaborate, is sudo apt-get clean not necessary here? Also, is this a security issue? Edge case for sure, but freaked me out a little when I saw how that file had been overwritten. –  Kurtosis Aug 27 '12 at 6:22
    
In my Opinion, apt-get clean is not necessary. This is not necessarily a security issue, since that file will only contain the details of what packages are available, and what packages depend on what, and so at best, I can possibly screw up your dependencies, by crafting some special file. –  Mahesh Aug 27 '12 at 18:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.