6

Recently , i tried to install google earth from Ubuntu tweak . the programme asked me to add the repository of google earth . well,after i do the command i found that an error message that told me that i couldn't add the source and the system can't build packages tree.i run in terminal sudo apt-get update and i found following Errors:

Fetched 143 kB in 3min 43s (637 B/s)                                           
Reading package lists... Error!
W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures were invalid: BADSIG 6AF0E1940624A220 Launchpad PPA for TualatriX
W: GPG error: http://eg.archive.ubuntu.com trusty-backports Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/eg.archive.ubuntu.com_ubuntu_dists_trusty_multiverse_i18n_Translation-en%5fUS
E: The package lists or status file could not be parsed or opened.

I can't launch Ubuntu software center.and a minus mark appear in bar at the top of the screen . please tell me what should i do in steps please.i have Ubuntu 14.04 trusty tahr.

Pandya
  • 35,771
  • 44
  • 128
  • 188
user297975
  • 83
  • 1
  • 6

2 Answers2

7

For the GPG errors, run sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6AF0E1940624A220 40976EAF437D05B5 to import the keys.

For the MergeList problem, run sudo rm /var/lib/apt/lists/*.

Finally, run sudo apt-get update.

saiarcot895
  • 10,757
  • 2
  • 36
  • 39
  • grasias amigo,i ran apt-get update after i do what you say. first i met a little error,i ran it again and every thing is ok.ubuntu center worked again and the red mark has gone away. – user297975 Jul 25 '14 at 09:04
  • i get this:E: GPG error: http://archive.canonical.com trusty InRelease: Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?) – user297975 Jul 25 '14 at 09:37
  • and this:W: GPG error: http://eg.archive.ubuntu.com trusty-backports Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key ftpmaster@ubuntu.com – user297975 Jul 25 '14 at 09:38
  • do they the same solution or not? – user297975 Jul 25 '14 at 09:40
  • take that too W: Failed to fetch http://eg.archive.ubuntu.com/ubuntu/dists/trusty/multiverse/i18n/Translation-en_US Connection failed [IP: 91.189.91.13 80] – user297975 Jul 25 '14 at 12:13
  • @user297975: The GPG warning about the invalid signature should have been gone. For the failed to fetch warning, you can ignore that, since it's just a translation file. For the NODATA error, see here for a possible answer. – saiarcot895 Jul 25 '14 at 12:27
  • thanks,but if i face another GpG error ,i should type the same command or i should change something.failed to fetch warning does it have any bad effects on the system i face it alot. – user297975 Jul 25 '14 at 13:15
  • sorry i have tired you. but the problem back again the red mark back ,ubuntu center doesnot work 'apt-get update'output is 'W: Failed to fetch gzip:/var/lib/apt/lists/partial/security.ubuntu.com_ubuntu_dists_trusty-security_main_source_Sources Hash Sum mismatch'sorryyy again for Disturbance – user297975 Jul 25 '14 at 13:30
  • gpg error again. it seems to be disease. – user297975 Jul 25 '14 at 13:36
  • the command about mergelist problem output this'rm: cannot remove ‘/var/lib/apt/lists/eg.archive.ubuntu.com_ubuntu_dists_trusty_multiverse_i18n_Translation-en%5fUS’: No such file or directory'after doing the first command on your answer – user297975 Jul 25 '14 at 13:39
  • help me anybody. – user297975 Jul 25 '14 at 13:41
  • 1
    For the GPG missing publickey/BADSIG error, try sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys followed by whatever keys appear. For the mergelist problem, run sudo rm /var/lib/apt/lists* instead. – saiarcot895 Jul 25 '14 at 14:00
  • it doesn't work in terminal .i went to apt and found a file named lists should i remove all files on it. i can by giving the file the permission from this command chmod 0777 the directory i should remove files which written on html or remove any thing on this file – user297975 Jul 26 '14 at 08:25
  • i found this in terminal rm: cannot remove ‘/var/lib/apt/lists/partial’: Is a directory – user297975 Jul 26 '14 at 08:32
  • 1
    @user297975: First off, don't change permissions of directories unless you know why you're doing it and that you really need to do it. Second, I had a slight typo in the command I posted in my comment; it should be sudo rm /var/lib/apt/lists/*. Third, the error message is fine; the partial directory can stay. – saiarcot895 Jul 26 '14 at 11:23
  • thanks , i gave up i install the system again.thanks again for your patience . – user297975 Jul 26 '14 at 11:31
  • Does downloading the gpg key without checking it open you up to man in the middle attacks? What sort of checking should be performed to be sure that the key you're adding is what it's supposed to be? – mc0e Jan 28 '16 at 11:55
  • @mc0e: It might, under certain circumstances. If you specify only the last 8 hex characters of the key, and there happens to be a collision, you might get the wrong key. But even then, though, the repo will still be considered untrusted because the key you downloaded is a different key. I'm not a security expert, so take what I said with a grain of salt. Also, you might be better off asking/searching over on Information Security. – saiarcot895 Jan 28 '16 at 13:50
1

To summarise the instructions from saiarcot895 :

For an error like this

W: GPG error: http://archive.ubuntu.com trusty Release:
The following signatures were invalid: BADSIG [ some_number ] 
Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>

do this - preferably one instruction at a time -

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys [ some_number ]
cd /var/lib/apt
ls -la
sudo mv lists lists_bak
sudo mkdir -p lists/partial
apt-get update

which is roughly

  1. call gpg via apt-key via apt-get, to download a new key
  2. go to where apt keeps its data
  3. look at the data that apt has at the moment
  4. rename the apt cache directory to both back it up and clear the cache
  5. make a new apt cache directory
  6. update the cache of packages that apt knows about
WillC
  • 1,718