How do I fix a âProblem with MergeListâ or âstatus file could not be parsedâ error when trying to do an update?
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
341
down vote
favorite
The computer gave me this output in a window:
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_natty_main_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.
How can I fix this?
apt
add a comment |Â
up vote
341
down vote
favorite
The computer gave me this output in a window:
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_natty_main_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.
How can I fix this?
apt
6
It keeps baffling me how awkwardly this operating system handles its updates, even now, that this and similar things are required after no special misuse by the user.
â matt
Apr 4 '16 at 20:41
add a comment |Â
up vote
341
down vote
favorite
up vote
341
down vote
favorite
The computer gave me this output in a window:
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_natty_main_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.
How can I fix this?
apt
The computer gave me this output in a window:
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_natty_main_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.
How can I fix this?
apt
edited Nov 18 '15 at 0:54
Braiam
49.7k20130212
49.7k20130212
asked Mar 12 '11 at 17:13
user12250
6
It keeps baffling me how awkwardly this operating system handles its updates, even now, that this and similar things are required after no special misuse by the user.
â matt
Apr 4 '16 at 20:41
add a comment |Â
6
It keeps baffling me how awkwardly this operating system handles its updates, even now, that this and similar things are required after no special misuse by the user.
â matt
Apr 4 '16 at 20:41
6
6
It keeps baffling me how awkwardly this operating system handles its updates, even now, that this and similar things are required after no special misuse by the user.
â matt
Apr 4 '16 at 20:41
It keeps baffling me how awkwardly this operating system handles its updates, even now, that this and similar things are required after no special misuse by the user.
â matt
Apr 4 '16 at 20:41
add a comment |Â
8 Answers
8
active
oldest
votes
up vote
472
down vote
accepted
These terminal commands should solve your problem:
First remove the Merge List by opening a terminal (Press Ctrl+Alt+T to launch) and run this command*:
sudo rm -vf /var/lib/apt/lists/*
Next, generate a new one by running a simple update:
sudo apt-get update
Here is the bug report (and another) for this problem, which is now fixed so it shouldn't create new malformed files, however if you already have the malformed files you need to remove them as explained in this post.
*The options used for rm are -v
verbose
-v, --verbose
explain what is being done
and -f
force
-f, --force
ignore nonexistent files and arguments, never prompt
If you are ever unsure about a command line or the options being used always refer to the manual page for the command. These can be accessed on the internet by searching for man and the command for example man rm
or you can access the same information by typing exactly the same command in the terminal for example man rm
instructions for quitting the page will be at the bottom of the terminal like this
8
One individual found he had to do these two steps multiple times, but that it worked eventually.
â John S Gruber
Sep 9 '12 at 5:24
5
It's odd to put the-vf
at the end of therm
command.
â Keith Thompson
Jun 9 '14 at 5:50
5
It didn't solve the issue for me. update still shows me that error.
â marines
Jul 4 '14 at 9:01
1
This is a recurring problem. It keeps happening once in a while. Is anybody aware of the cause of this problem?
â Rushil
Mar 3 '15 at 8:58
1
I have edited the answer for understand ability @jasser
â Allan
Aug 21 '15 at 18:45
 |Â
show 5 more comments
up vote
80
down vote
Open a Terminal and run the following commands one at a time:
sudo rm /var/lib/apt/lists/* -vf
sudo apt-get update
See also:
- https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure
1
what does the -vf do?
â speedox
Feb 2 '13 at 15:42
5
@speedox, according toman rm
,-v
means 'verbose', and-f
means 'force'. In other words, remove all designated files without prompting and tell the user what it is doing.
â fouric
Apr 10 '13 at 0:21
In my case, just doing thesudo apt-get update
fixed the problem. I think Allan mentioned newer versions of apt correct this automatically, so maybe try just the update first.
â ThorSummoner
Sep 3 '15 at 22:22
add a comment |Â
up vote
23
down vote
You screwed up when you edited /var/lib/dpkg/status
. Restore it from the backup that you made before editing it. Of course, you made a backup, right?
Since you didn't make a backup, edit it again, carefully. Try not to cause more damage.
You can use /var/lib/dpkg/status.old
as a reference point. This is a backup of the status
file from before the last time dpkg
was run. Run
diff /var/lib/dpkg/status.old /var/lib/dpkg/status
to see the differences. Undo the changes that you made manually, and keep the changes that were made by the last dpkg
run.
If you really can't manage to repair the file, copy /var/lib/dpkg/status.old
over /var/lib/dpkg/status
. You will get a well-formed, but out-of-date package database.
You never need to edit /var/lib/dpkg/status
in normal operation. Even whe things go seriously wrong, /var/lib/dpkg/status
is not something that tends to require administrator intervention. Whatever your problems with crossplatformui
were, there is probably a better way of solving them. The only time I've ever needed to edit /var/lib/dpkg/status
was when an upstream Packages
file was broken.
I would also like to know the better way you mentioned to remove crossplatformui if you could help coz i tried every possible way to remove it and tried finding many solutions but only the one i've mentioned has worked...
â Nirmik
May 13 '12 at 15:58
1
@Nirmik No idea aboutcrossplatformui
. Ask that as a separate question. I can tell you that in over a decade of usingdpkg
, including many unofficial sources, I've very very rarely needed to edit thestatus
file, and only when there was a broken third-party repository.
â Gilles
May 13 '12 at 16:01
Okay...Thanx a lot once again....as you suggest i'll post it as a new question :) also as you seem a very advanced user i would like to ask you if you know anything about making non functioning HOT-KTEYS work?? (my wireless key doesent work)
â Nirmik
May 13 '12 at 16:08
Tried to put the old in place of the new, did not fix for me. :-(
â Stéphane Gourichon
Nov 26 '15 at 11:22
1
re: You screwed up when you edited /var/lib/dpkg/status as for me - no, I'm not, I haven't touched this file :) However this is only solution that do solve the problem in my case. Thank you.
â ruslo
Nov 8 '16 at 10:30
add a comment |Â
up vote
18
down vote
I did
sudo apt-get clean
sudo apt-get update
and it worked.
1
Did not fix for me. :-(
â Stéphane Gourichon
Nov 26 '15 at 11:22
add a comment |Â
up vote
16
down vote
Following steps 2-5 in the Package Manager Troubleshooting Procedure usually solves this problem.
For step 2, disable all your PPAs. You can uncheck all of them in Software Sources the same way you'd uncheck just one; see How to disable a particular PPA?. You can re-enable them later.
For step 3, close any open programs you can. It's probably safe to keep your web browser open so you have your instructions in front of you. But it's particularly important to make sure any package managers are not running. This include the Software Center, the Software Updater (Update Manager in older versions of Ubuntu), Synaptic, and Gdebi. It also includes command-line package management utilities like apt-get
, dpkg
, and aptitude
.
Note that if other users are logged on at the same time, they should log off if possible.
For step 4, open a terminal window. One way to do this that works no matter what desktop environment you use, is to press Ctrl+Alt+T.
For step 5, run these commands in the terminal window:
ubuntu-support-status
sudo grep -R proxy /etc/apt/*
grep proxy /etc/environment
echo $http_proxy
echo $ftp_proxy
grep proxy /etc/bash.bashrc
grep proxy ~/.bashrc
cat /etc/apt/apt.conf
sudo fuser -vvv /var/lib/dpkg/lock
sudo fuser -vvv /var/cache/apt/archives/lock
cat /etc/lsb-release
uname -a
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status || sudo cp /var/backups/apt.extended_states.0 /var/lib/dpkg/status
sudo mv /var/lib/dpkg/available /var/lib/dpkg/available-bad
sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists
sudo rm /var/cache/apt/*.bin
sudo mkdir /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists/partial
LANG=C;sudo apt-get clean
LANG=C;sudo apt-get autoclean
LANG=C;sudo apt-get --purge autoremove
LANG=C;sudo apt-get --fix-missing update -o APT::Cache-Limit=100000000
sudo dpkg --configure -a
sudo dpkg --clear-avail
LANG=C;sudo apt-get -f install
LANG=C;sudo apt-get --fix-missing install
LANG=C;sudo apt-get update -o APT::Cache-Limit=100000000 && sudo apt-get dist-upgrade
find /etc/apt -name '*.list' -exec bash -c 'echo -e "n$1n"; cat -n "$1"' _ '' ;
I copied that verbatim from PackageManagementTroubleshoootingProcedure on 2 March 2014. Those commands have evolved in the past and the recommended commands in that article may be changed or expanded on again in the future. So you may want to work from step 5 there. (That article, created/edited by "Contributors to the Ubuntu documentation wiki"--especially Mark Rijckenberg--is licensed CC-BY-SA 3.0, which allows inclusion here with proper attribution.)
Some of those commands attempt to fix the problem (and also may show diagnostic information); others display valuable information about the problem that you can include in your question or otherwise provide to someone helping you. (Or, depending on your skills, may enable you to diagnose and solve it.)
Often this fixes it but when it doesn't it often gives enough information to fix it.
You don't have to manually type those commands; you can copy and paste them. I recommend pasting and running each one separately, though. This makes it clearer what output is from which commands.
I copied the whole block and paste instead of running one-by-one. Although several commands in this are useless and some failed, but finally it does help in my case
â phuclv
Jan 15 at 8:45
add a comment |Â
up vote
11
down vote
I have also seen this problem occur when you have too many sources in your repos.
Try the solution posted above and/or also perhaps this which is sometimes recommended on launchpad:
sudo mv /var/lib/apt/lists /var/lib/apt/lists-old
sudo mkdir -p /var/lib/apt/lists/partial
sudo apt-get update
Let us know how you get on.
Thank-you! This didn't work with DSL without the makedir as well.
â Doug
May 26 '14 at 2:33
add a comment |Â
up vote
4
down vote
I was running into a similar error:
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/dpkg/status
E: The package lists or status file could not be parsed or opened.
I followed similar suggestions to copy status-old
.
$ head /var/lib/dpkg/status
$ head /var/lib/dpkg/status-old
All of my status files were blank for some reason. Luckily, I found out there are backups of these files:
$ ls -l /var/backups/dpkg.status.*
-rw-r--r-- 1 root root 444620 Nov 15 06:33 /var/backups/dpkg.status.0
-rw-r--r-- 1 root root 444620 Nov 15 06:33 /var/backups/dpkg.status.1.gz
-rw-r--r-- 1 root root 128168 Sep 20 2013 /var/backups/dpkg.status.2.gz
-rw-r--r-- 1 root root 112545 Sep 16 2013 /var/backups/dpkg.status.3.gz
-rw-r--r-- 1 root root 107767 Sep 14 2013 /var/backups/dpkg.status.4.gz
-rw-r--r-- 1 root root 107766 Sep 11 2013 /var/backups/dpkg.status.5.gz
-rw-r--r-- 1 root root 94583 Sep 11 2013 /var/backups/dpkg.status.6.gz
I checked the latest backup...
$ head /var/backups/dpkg.status.0
...but it was still blank. So I unzipped an older one...
$ gunzip /var/backups/dpkg.status.1.gz
$ head /var/backups/dpkg.status.1
This time there was content. So I copied it...
$ cp /var/backups/dpkg.status.1 /var/lib/dpkg/status
Then apt-get update
ran without problems.
Credit goes to this post.
add a comment |Â
up vote
3
down vote
I had the same problem and tried all the troubleshooting mentioned in other answers. Strangely the only fix was a different step:
Go to Software & updates -> Ubuntu Software -> Download From ->Other->Select Best Server
Wait for the tests. At the end of the tests the best server will be selected, not necessarily the nearest one nor the main server nor the server for your locale.
Now Reload Repo data, It will finish properly.
add a comment |Â
protected by Community⦠Oct 17 '12 at 9:32
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
8 Answers
8
active
oldest
votes
8 Answers
8
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
472
down vote
accepted
These terminal commands should solve your problem:
First remove the Merge List by opening a terminal (Press Ctrl+Alt+T to launch) and run this command*:
sudo rm -vf /var/lib/apt/lists/*
Next, generate a new one by running a simple update:
sudo apt-get update
Here is the bug report (and another) for this problem, which is now fixed so it shouldn't create new malformed files, however if you already have the malformed files you need to remove them as explained in this post.
*The options used for rm are -v
verbose
-v, --verbose
explain what is being done
and -f
force
-f, --force
ignore nonexistent files and arguments, never prompt
If you are ever unsure about a command line or the options being used always refer to the manual page for the command. These can be accessed on the internet by searching for man and the command for example man rm
or you can access the same information by typing exactly the same command in the terminal for example man rm
instructions for quitting the page will be at the bottom of the terminal like this
8
One individual found he had to do these two steps multiple times, but that it worked eventually.
â John S Gruber
Sep 9 '12 at 5:24
5
It's odd to put the-vf
at the end of therm
command.
â Keith Thompson
Jun 9 '14 at 5:50
5
It didn't solve the issue for me. update still shows me that error.
â marines
Jul 4 '14 at 9:01
1
This is a recurring problem. It keeps happening once in a while. Is anybody aware of the cause of this problem?
â Rushil
Mar 3 '15 at 8:58
1
I have edited the answer for understand ability @jasser
â Allan
Aug 21 '15 at 18:45
 |Â
show 5 more comments
up vote
472
down vote
accepted
These terminal commands should solve your problem:
First remove the Merge List by opening a terminal (Press Ctrl+Alt+T to launch) and run this command*:
sudo rm -vf /var/lib/apt/lists/*
Next, generate a new one by running a simple update:
sudo apt-get update
Here is the bug report (and another) for this problem, which is now fixed so it shouldn't create new malformed files, however if you already have the malformed files you need to remove them as explained in this post.
*The options used for rm are -v
verbose
-v, --verbose
explain what is being done
and -f
force
-f, --force
ignore nonexistent files and arguments, never prompt
If you are ever unsure about a command line or the options being used always refer to the manual page for the command. These can be accessed on the internet by searching for man and the command for example man rm
or you can access the same information by typing exactly the same command in the terminal for example man rm
instructions for quitting the page will be at the bottom of the terminal like this
8
One individual found he had to do these two steps multiple times, but that it worked eventually.
â John S Gruber
Sep 9 '12 at 5:24
5
It's odd to put the-vf
at the end of therm
command.
â Keith Thompson
Jun 9 '14 at 5:50
5
It didn't solve the issue for me. update still shows me that error.
â marines
Jul 4 '14 at 9:01
1
This is a recurring problem. It keeps happening once in a while. Is anybody aware of the cause of this problem?
â Rushil
Mar 3 '15 at 8:58
1
I have edited the answer for understand ability @jasser
â Allan
Aug 21 '15 at 18:45
 |Â
show 5 more comments
up vote
472
down vote
accepted
up vote
472
down vote
accepted
These terminal commands should solve your problem:
First remove the Merge List by opening a terminal (Press Ctrl+Alt+T to launch) and run this command*:
sudo rm -vf /var/lib/apt/lists/*
Next, generate a new one by running a simple update:
sudo apt-get update
Here is the bug report (and another) for this problem, which is now fixed so it shouldn't create new malformed files, however if you already have the malformed files you need to remove them as explained in this post.
*The options used for rm are -v
verbose
-v, --verbose
explain what is being done
and -f
force
-f, --force
ignore nonexistent files and arguments, never prompt
If you are ever unsure about a command line or the options being used always refer to the manual page for the command. These can be accessed on the internet by searching for man and the command for example man rm
or you can access the same information by typing exactly the same command in the terminal for example man rm
instructions for quitting the page will be at the bottom of the terminal like this
These terminal commands should solve your problem:
First remove the Merge List by opening a terminal (Press Ctrl+Alt+T to launch) and run this command*:
sudo rm -vf /var/lib/apt/lists/*
Next, generate a new one by running a simple update:
sudo apt-get update
Here is the bug report (and another) for this problem, which is now fixed so it shouldn't create new malformed files, however if you already have the malformed files you need to remove them as explained in this post.
*The options used for rm are -v
verbose
-v, --verbose
explain what is being done
and -f
force
-f, --force
ignore nonexistent files and arguments, never prompt
If you are ever unsure about a command line or the options being used always refer to the manual page for the command. These can be accessed on the internet by searching for man and the command for example man rm
or you can access the same information by typing exactly the same command in the terminal for example man rm
instructions for quitting the page will be at the bottom of the terminal like this
edited Nov 5 '15 at 16:10
Marco Ceppiâ¦
36.1k23150190
36.1k23150190
answered Mar 13 '11 at 16:53
Allan
10.1k43050
10.1k43050
8
One individual found he had to do these two steps multiple times, but that it worked eventually.
â John S Gruber
Sep 9 '12 at 5:24
5
It's odd to put the-vf
at the end of therm
command.
â Keith Thompson
Jun 9 '14 at 5:50
5
It didn't solve the issue for me. update still shows me that error.
â marines
Jul 4 '14 at 9:01
1
This is a recurring problem. It keeps happening once in a while. Is anybody aware of the cause of this problem?
â Rushil
Mar 3 '15 at 8:58
1
I have edited the answer for understand ability @jasser
â Allan
Aug 21 '15 at 18:45
 |Â
show 5 more comments
8
One individual found he had to do these two steps multiple times, but that it worked eventually.
â John S Gruber
Sep 9 '12 at 5:24
5
It's odd to put the-vf
at the end of therm
command.
â Keith Thompson
Jun 9 '14 at 5:50
5
It didn't solve the issue for me. update still shows me that error.
â marines
Jul 4 '14 at 9:01
1
This is a recurring problem. It keeps happening once in a while. Is anybody aware of the cause of this problem?
â Rushil
Mar 3 '15 at 8:58
1
I have edited the answer for understand ability @jasser
â Allan
Aug 21 '15 at 18:45
8
8
One individual found he had to do these two steps multiple times, but that it worked eventually.
â John S Gruber
Sep 9 '12 at 5:24
One individual found he had to do these two steps multiple times, but that it worked eventually.
â John S Gruber
Sep 9 '12 at 5:24
5
5
It's odd to put the
-vf
at the end of the rm
command.â Keith Thompson
Jun 9 '14 at 5:50
It's odd to put the
-vf
at the end of the rm
command.â Keith Thompson
Jun 9 '14 at 5:50
5
5
It didn't solve the issue for me. update still shows me that error.
â marines
Jul 4 '14 at 9:01
It didn't solve the issue for me. update still shows me that error.
â marines
Jul 4 '14 at 9:01
1
1
This is a recurring problem. It keeps happening once in a while. Is anybody aware of the cause of this problem?
â Rushil
Mar 3 '15 at 8:58
This is a recurring problem. It keeps happening once in a while. Is anybody aware of the cause of this problem?
â Rushil
Mar 3 '15 at 8:58
1
1
I have edited the answer for understand ability @jasser
â Allan
Aug 21 '15 at 18:45
I have edited the answer for understand ability @jasser
â Allan
Aug 21 '15 at 18:45
 |Â
show 5 more comments
up vote
80
down vote
Open a Terminal and run the following commands one at a time:
sudo rm /var/lib/apt/lists/* -vf
sudo apt-get update
See also:
- https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure
1
what does the -vf do?
â speedox
Feb 2 '13 at 15:42
5
@speedox, according toman rm
,-v
means 'verbose', and-f
means 'force'. In other words, remove all designated files without prompting and tell the user what it is doing.
â fouric
Apr 10 '13 at 0:21
In my case, just doing thesudo apt-get update
fixed the problem. I think Allan mentioned newer versions of apt correct this automatically, so maybe try just the update first.
â ThorSummoner
Sep 3 '15 at 22:22
add a comment |Â
up vote
80
down vote
Open a Terminal and run the following commands one at a time:
sudo rm /var/lib/apt/lists/* -vf
sudo apt-get update
See also:
- https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure
1
what does the -vf do?
â speedox
Feb 2 '13 at 15:42
5
@speedox, according toman rm
,-v
means 'verbose', and-f
means 'force'. In other words, remove all designated files without prompting and tell the user what it is doing.
â fouric
Apr 10 '13 at 0:21
In my case, just doing thesudo apt-get update
fixed the problem. I think Allan mentioned newer versions of apt correct this automatically, so maybe try just the update first.
â ThorSummoner
Sep 3 '15 at 22:22
add a comment |Â
up vote
80
down vote
up vote
80
down vote
Open a Terminal and run the following commands one at a time:
sudo rm /var/lib/apt/lists/* -vf
sudo apt-get update
See also:
- https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure
Open a Terminal and run the following commands one at a time:
sudo rm /var/lib/apt/lists/* -vf
sudo apt-get update
See also:
- https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure
edited Jul 9 '12 at 3:54
Jorge Castro
34.7k104421614
34.7k104421614
answered Feb 8 '11 at 18:37
tommyk
2,25162738
2,25162738
1
what does the -vf do?
â speedox
Feb 2 '13 at 15:42
5
@speedox, according toman rm
,-v
means 'verbose', and-f
means 'force'. In other words, remove all designated files without prompting and tell the user what it is doing.
â fouric
Apr 10 '13 at 0:21
In my case, just doing thesudo apt-get update
fixed the problem. I think Allan mentioned newer versions of apt correct this automatically, so maybe try just the update first.
â ThorSummoner
Sep 3 '15 at 22:22
add a comment |Â
1
what does the -vf do?
â speedox
Feb 2 '13 at 15:42
5
@speedox, according toman rm
,-v
means 'verbose', and-f
means 'force'. In other words, remove all designated files without prompting and tell the user what it is doing.
â fouric
Apr 10 '13 at 0:21
In my case, just doing thesudo apt-get update
fixed the problem. I think Allan mentioned newer versions of apt correct this automatically, so maybe try just the update first.
â ThorSummoner
Sep 3 '15 at 22:22
1
1
what does the -vf do?
â speedox
Feb 2 '13 at 15:42
what does the -vf do?
â speedox
Feb 2 '13 at 15:42
5
5
@speedox, according to
man rm
, -v
means 'verbose', and -f
means 'force'. In other words, remove all designated files without prompting and tell the user what it is doing.â fouric
Apr 10 '13 at 0:21
@speedox, according to
man rm
, -v
means 'verbose', and -f
means 'force'. In other words, remove all designated files without prompting and tell the user what it is doing.â fouric
Apr 10 '13 at 0:21
In my case, just doing the
sudo apt-get update
fixed the problem. I think Allan mentioned newer versions of apt correct this automatically, so maybe try just the update first.â ThorSummoner
Sep 3 '15 at 22:22
In my case, just doing the
sudo apt-get update
fixed the problem. I think Allan mentioned newer versions of apt correct this automatically, so maybe try just the update first.â ThorSummoner
Sep 3 '15 at 22:22
add a comment |Â
up vote
23
down vote
You screwed up when you edited /var/lib/dpkg/status
. Restore it from the backup that you made before editing it. Of course, you made a backup, right?
Since you didn't make a backup, edit it again, carefully. Try not to cause more damage.
You can use /var/lib/dpkg/status.old
as a reference point. This is a backup of the status
file from before the last time dpkg
was run. Run
diff /var/lib/dpkg/status.old /var/lib/dpkg/status
to see the differences. Undo the changes that you made manually, and keep the changes that were made by the last dpkg
run.
If you really can't manage to repair the file, copy /var/lib/dpkg/status.old
over /var/lib/dpkg/status
. You will get a well-formed, but out-of-date package database.
You never need to edit /var/lib/dpkg/status
in normal operation. Even whe things go seriously wrong, /var/lib/dpkg/status
is not something that tends to require administrator intervention. Whatever your problems with crossplatformui
were, there is probably a better way of solving them. The only time I've ever needed to edit /var/lib/dpkg/status
was when an upstream Packages
file was broken.
I would also like to know the better way you mentioned to remove crossplatformui if you could help coz i tried every possible way to remove it and tried finding many solutions but only the one i've mentioned has worked...
â Nirmik
May 13 '12 at 15:58
1
@Nirmik No idea aboutcrossplatformui
. Ask that as a separate question. I can tell you that in over a decade of usingdpkg
, including many unofficial sources, I've very very rarely needed to edit thestatus
file, and only when there was a broken third-party repository.
â Gilles
May 13 '12 at 16:01
Okay...Thanx a lot once again....as you suggest i'll post it as a new question :) also as you seem a very advanced user i would like to ask you if you know anything about making non functioning HOT-KTEYS work?? (my wireless key doesent work)
â Nirmik
May 13 '12 at 16:08
Tried to put the old in place of the new, did not fix for me. :-(
â Stéphane Gourichon
Nov 26 '15 at 11:22
1
re: You screwed up when you edited /var/lib/dpkg/status as for me - no, I'm not, I haven't touched this file :) However this is only solution that do solve the problem in my case. Thank you.
â ruslo
Nov 8 '16 at 10:30
add a comment |Â
up vote
23
down vote
You screwed up when you edited /var/lib/dpkg/status
. Restore it from the backup that you made before editing it. Of course, you made a backup, right?
Since you didn't make a backup, edit it again, carefully. Try not to cause more damage.
You can use /var/lib/dpkg/status.old
as a reference point. This is a backup of the status
file from before the last time dpkg
was run. Run
diff /var/lib/dpkg/status.old /var/lib/dpkg/status
to see the differences. Undo the changes that you made manually, and keep the changes that were made by the last dpkg
run.
If you really can't manage to repair the file, copy /var/lib/dpkg/status.old
over /var/lib/dpkg/status
. You will get a well-formed, but out-of-date package database.
You never need to edit /var/lib/dpkg/status
in normal operation. Even whe things go seriously wrong, /var/lib/dpkg/status
is not something that tends to require administrator intervention. Whatever your problems with crossplatformui
were, there is probably a better way of solving them. The only time I've ever needed to edit /var/lib/dpkg/status
was when an upstream Packages
file was broken.
I would also like to know the better way you mentioned to remove crossplatformui if you could help coz i tried every possible way to remove it and tried finding many solutions but only the one i've mentioned has worked...
â Nirmik
May 13 '12 at 15:58
1
@Nirmik No idea aboutcrossplatformui
. Ask that as a separate question. I can tell you that in over a decade of usingdpkg
, including many unofficial sources, I've very very rarely needed to edit thestatus
file, and only when there was a broken third-party repository.
â Gilles
May 13 '12 at 16:01
Okay...Thanx a lot once again....as you suggest i'll post it as a new question :) also as you seem a very advanced user i would like to ask you if you know anything about making non functioning HOT-KTEYS work?? (my wireless key doesent work)
â Nirmik
May 13 '12 at 16:08
Tried to put the old in place of the new, did not fix for me. :-(
â Stéphane Gourichon
Nov 26 '15 at 11:22
1
re: You screwed up when you edited /var/lib/dpkg/status as for me - no, I'm not, I haven't touched this file :) However this is only solution that do solve the problem in my case. Thank you.
â ruslo
Nov 8 '16 at 10:30
add a comment |Â
up vote
23
down vote
up vote
23
down vote
You screwed up when you edited /var/lib/dpkg/status
. Restore it from the backup that you made before editing it. Of course, you made a backup, right?
Since you didn't make a backup, edit it again, carefully. Try not to cause more damage.
You can use /var/lib/dpkg/status.old
as a reference point. This is a backup of the status
file from before the last time dpkg
was run. Run
diff /var/lib/dpkg/status.old /var/lib/dpkg/status
to see the differences. Undo the changes that you made manually, and keep the changes that were made by the last dpkg
run.
If you really can't manage to repair the file, copy /var/lib/dpkg/status.old
over /var/lib/dpkg/status
. You will get a well-formed, but out-of-date package database.
You never need to edit /var/lib/dpkg/status
in normal operation. Even whe things go seriously wrong, /var/lib/dpkg/status
is not something that tends to require administrator intervention. Whatever your problems with crossplatformui
were, there is probably a better way of solving them. The only time I've ever needed to edit /var/lib/dpkg/status
was when an upstream Packages
file was broken.
You screwed up when you edited /var/lib/dpkg/status
. Restore it from the backup that you made before editing it. Of course, you made a backup, right?
Since you didn't make a backup, edit it again, carefully. Try not to cause more damage.
You can use /var/lib/dpkg/status.old
as a reference point. This is a backup of the status
file from before the last time dpkg
was run. Run
diff /var/lib/dpkg/status.old /var/lib/dpkg/status
to see the differences. Undo the changes that you made manually, and keep the changes that were made by the last dpkg
run.
If you really can't manage to repair the file, copy /var/lib/dpkg/status.old
over /var/lib/dpkg/status
. You will get a well-formed, but out-of-date package database.
You never need to edit /var/lib/dpkg/status
in normal operation. Even whe things go seriously wrong, /var/lib/dpkg/status
is not something that tends to require administrator intervention. Whatever your problems with crossplatformui
were, there is probably a better way of solving them. The only time I've ever needed to edit /var/lib/dpkg/status
was when an upstream Packages
file was broken.
answered May 13 '12 at 15:37
![](https://i.stack.imgur.com/cFyP6.jpg?s=32&g=1)
![](https://i.stack.imgur.com/cFyP6.jpg?s=32&g=1)
Gilles
43.2k1398137
43.2k1398137
I would also like to know the better way you mentioned to remove crossplatformui if you could help coz i tried every possible way to remove it and tried finding many solutions but only the one i've mentioned has worked...
â Nirmik
May 13 '12 at 15:58
1
@Nirmik No idea aboutcrossplatformui
. Ask that as a separate question. I can tell you that in over a decade of usingdpkg
, including many unofficial sources, I've very very rarely needed to edit thestatus
file, and only when there was a broken third-party repository.
â Gilles
May 13 '12 at 16:01
Okay...Thanx a lot once again....as you suggest i'll post it as a new question :) also as you seem a very advanced user i would like to ask you if you know anything about making non functioning HOT-KTEYS work?? (my wireless key doesent work)
â Nirmik
May 13 '12 at 16:08
Tried to put the old in place of the new, did not fix for me. :-(
â Stéphane Gourichon
Nov 26 '15 at 11:22
1
re: You screwed up when you edited /var/lib/dpkg/status as for me - no, I'm not, I haven't touched this file :) However this is only solution that do solve the problem in my case. Thank you.
â ruslo
Nov 8 '16 at 10:30
add a comment |Â
I would also like to know the better way you mentioned to remove crossplatformui if you could help coz i tried every possible way to remove it and tried finding many solutions but only the one i've mentioned has worked...
â Nirmik
May 13 '12 at 15:58
1
@Nirmik No idea aboutcrossplatformui
. Ask that as a separate question. I can tell you that in over a decade of usingdpkg
, including many unofficial sources, I've very very rarely needed to edit thestatus
file, and only when there was a broken third-party repository.
â Gilles
May 13 '12 at 16:01
Okay...Thanx a lot once again....as you suggest i'll post it as a new question :) also as you seem a very advanced user i would like to ask you if you know anything about making non functioning HOT-KTEYS work?? (my wireless key doesent work)
â Nirmik
May 13 '12 at 16:08
Tried to put the old in place of the new, did not fix for me. :-(
â Stéphane Gourichon
Nov 26 '15 at 11:22
1
re: You screwed up when you edited /var/lib/dpkg/status as for me - no, I'm not, I haven't touched this file :) However this is only solution that do solve the problem in my case. Thank you.
â ruslo
Nov 8 '16 at 10:30
I would also like to know the better way you mentioned to remove crossplatformui if you could help coz i tried every possible way to remove it and tried finding many solutions but only the one i've mentioned has worked...
â Nirmik
May 13 '12 at 15:58
I would also like to know the better way you mentioned to remove crossplatformui if you could help coz i tried every possible way to remove it and tried finding many solutions but only the one i've mentioned has worked...
â Nirmik
May 13 '12 at 15:58
1
1
@Nirmik No idea about
crossplatformui
. Ask that as a separate question. I can tell you that in over a decade of using dpkg
, including many unofficial sources, I've very very rarely needed to edit the status
file, and only when there was a broken third-party repository.â Gilles
May 13 '12 at 16:01
@Nirmik No idea about
crossplatformui
. Ask that as a separate question. I can tell you that in over a decade of using dpkg
, including many unofficial sources, I've very very rarely needed to edit the status
file, and only when there was a broken third-party repository.â Gilles
May 13 '12 at 16:01
Okay...Thanx a lot once again....as you suggest i'll post it as a new question :) also as you seem a very advanced user i would like to ask you if you know anything about making non functioning HOT-KTEYS work?? (my wireless key doesent work)
â Nirmik
May 13 '12 at 16:08
Okay...Thanx a lot once again....as you suggest i'll post it as a new question :) also as you seem a very advanced user i would like to ask you if you know anything about making non functioning HOT-KTEYS work?? (my wireless key doesent work)
â Nirmik
May 13 '12 at 16:08
Tried to put the old in place of the new, did not fix for me. :-(
â Stéphane Gourichon
Nov 26 '15 at 11:22
Tried to put the old in place of the new, did not fix for me. :-(
â Stéphane Gourichon
Nov 26 '15 at 11:22
1
1
re: You screwed up when you edited /var/lib/dpkg/status as for me - no, I'm not, I haven't touched this file :) However this is only solution that do solve the problem in my case. Thank you.
â ruslo
Nov 8 '16 at 10:30
re: You screwed up when you edited /var/lib/dpkg/status as for me - no, I'm not, I haven't touched this file :) However this is only solution that do solve the problem in my case. Thank you.
â ruslo
Nov 8 '16 at 10:30
add a comment |Â
up vote
18
down vote
I did
sudo apt-get clean
sudo apt-get update
and it worked.
1
Did not fix for me. :-(
â Stéphane Gourichon
Nov 26 '15 at 11:22
add a comment |Â
up vote
18
down vote
I did
sudo apt-get clean
sudo apt-get update
and it worked.
1
Did not fix for me. :-(
â Stéphane Gourichon
Nov 26 '15 at 11:22
add a comment |Â
up vote
18
down vote
up vote
18
down vote
I did
sudo apt-get clean
sudo apt-get update
and it worked.
I did
sudo apt-get clean
sudo apt-get update
and it worked.
edited Sep 8 '12 at 4:10
![](https://i.stack.imgur.com/Dm86X.png?s=32&g=1)
![](https://i.stack.imgur.com/Dm86X.png?s=32&g=1)
Peachy
4,80172843
4,80172843
answered Jul 31 '12 at 13:34
![](https://i.stack.imgur.com/zv3UX.jpg?s=32&g=1)
![](https://i.stack.imgur.com/zv3UX.jpg?s=32&g=1)
psychok7
408720
408720
1
Did not fix for me. :-(
â Stéphane Gourichon
Nov 26 '15 at 11:22
add a comment |Â
1
Did not fix for me. :-(
â Stéphane Gourichon
Nov 26 '15 at 11:22
1
1
Did not fix for me. :-(
â Stéphane Gourichon
Nov 26 '15 at 11:22
Did not fix for me. :-(
â Stéphane Gourichon
Nov 26 '15 at 11:22
add a comment |Â
up vote
16
down vote
Following steps 2-5 in the Package Manager Troubleshooting Procedure usually solves this problem.
For step 2, disable all your PPAs. You can uncheck all of them in Software Sources the same way you'd uncheck just one; see How to disable a particular PPA?. You can re-enable them later.
For step 3, close any open programs you can. It's probably safe to keep your web browser open so you have your instructions in front of you. But it's particularly important to make sure any package managers are not running. This include the Software Center, the Software Updater (Update Manager in older versions of Ubuntu), Synaptic, and Gdebi. It also includes command-line package management utilities like apt-get
, dpkg
, and aptitude
.
Note that if other users are logged on at the same time, they should log off if possible.
For step 4, open a terminal window. One way to do this that works no matter what desktop environment you use, is to press Ctrl+Alt+T.
For step 5, run these commands in the terminal window:
ubuntu-support-status
sudo grep -R proxy /etc/apt/*
grep proxy /etc/environment
echo $http_proxy
echo $ftp_proxy
grep proxy /etc/bash.bashrc
grep proxy ~/.bashrc
cat /etc/apt/apt.conf
sudo fuser -vvv /var/lib/dpkg/lock
sudo fuser -vvv /var/cache/apt/archives/lock
cat /etc/lsb-release
uname -a
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status || sudo cp /var/backups/apt.extended_states.0 /var/lib/dpkg/status
sudo mv /var/lib/dpkg/available /var/lib/dpkg/available-bad
sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists
sudo rm /var/cache/apt/*.bin
sudo mkdir /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists/partial
LANG=C;sudo apt-get clean
LANG=C;sudo apt-get autoclean
LANG=C;sudo apt-get --purge autoremove
LANG=C;sudo apt-get --fix-missing update -o APT::Cache-Limit=100000000
sudo dpkg --configure -a
sudo dpkg --clear-avail
LANG=C;sudo apt-get -f install
LANG=C;sudo apt-get --fix-missing install
LANG=C;sudo apt-get update -o APT::Cache-Limit=100000000 && sudo apt-get dist-upgrade
find /etc/apt -name '*.list' -exec bash -c 'echo -e "n$1n"; cat -n "$1"' _ '' ;
I copied that verbatim from PackageManagementTroubleshoootingProcedure on 2 March 2014. Those commands have evolved in the past and the recommended commands in that article may be changed or expanded on again in the future. So you may want to work from step 5 there. (That article, created/edited by "Contributors to the Ubuntu documentation wiki"--especially Mark Rijckenberg--is licensed CC-BY-SA 3.0, which allows inclusion here with proper attribution.)
Some of those commands attempt to fix the problem (and also may show diagnostic information); others display valuable information about the problem that you can include in your question or otherwise provide to someone helping you. (Or, depending on your skills, may enable you to diagnose and solve it.)
Often this fixes it but when it doesn't it often gives enough information to fix it.
You don't have to manually type those commands; you can copy and paste them. I recommend pasting and running each one separately, though. This makes it clearer what output is from which commands.
I copied the whole block and paste instead of running one-by-one. Although several commands in this are useless and some failed, but finally it does help in my case
â phuclv
Jan 15 at 8:45
add a comment |Â
up vote
16
down vote
Following steps 2-5 in the Package Manager Troubleshooting Procedure usually solves this problem.
For step 2, disable all your PPAs. You can uncheck all of them in Software Sources the same way you'd uncheck just one; see How to disable a particular PPA?. You can re-enable them later.
For step 3, close any open programs you can. It's probably safe to keep your web browser open so you have your instructions in front of you. But it's particularly important to make sure any package managers are not running. This include the Software Center, the Software Updater (Update Manager in older versions of Ubuntu), Synaptic, and Gdebi. It also includes command-line package management utilities like apt-get
, dpkg
, and aptitude
.
Note that if other users are logged on at the same time, they should log off if possible.
For step 4, open a terminal window. One way to do this that works no matter what desktop environment you use, is to press Ctrl+Alt+T.
For step 5, run these commands in the terminal window:
ubuntu-support-status
sudo grep -R proxy /etc/apt/*
grep proxy /etc/environment
echo $http_proxy
echo $ftp_proxy
grep proxy /etc/bash.bashrc
grep proxy ~/.bashrc
cat /etc/apt/apt.conf
sudo fuser -vvv /var/lib/dpkg/lock
sudo fuser -vvv /var/cache/apt/archives/lock
cat /etc/lsb-release
uname -a
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status || sudo cp /var/backups/apt.extended_states.0 /var/lib/dpkg/status
sudo mv /var/lib/dpkg/available /var/lib/dpkg/available-bad
sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists
sudo rm /var/cache/apt/*.bin
sudo mkdir /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists/partial
LANG=C;sudo apt-get clean
LANG=C;sudo apt-get autoclean
LANG=C;sudo apt-get --purge autoremove
LANG=C;sudo apt-get --fix-missing update -o APT::Cache-Limit=100000000
sudo dpkg --configure -a
sudo dpkg --clear-avail
LANG=C;sudo apt-get -f install
LANG=C;sudo apt-get --fix-missing install
LANG=C;sudo apt-get update -o APT::Cache-Limit=100000000 && sudo apt-get dist-upgrade
find /etc/apt -name '*.list' -exec bash -c 'echo -e "n$1n"; cat -n "$1"' _ '' ;
I copied that verbatim from PackageManagementTroubleshoootingProcedure on 2 March 2014. Those commands have evolved in the past and the recommended commands in that article may be changed or expanded on again in the future. So you may want to work from step 5 there. (That article, created/edited by "Contributors to the Ubuntu documentation wiki"--especially Mark Rijckenberg--is licensed CC-BY-SA 3.0, which allows inclusion here with proper attribution.)
Some of those commands attempt to fix the problem (and also may show diagnostic information); others display valuable information about the problem that you can include in your question or otherwise provide to someone helping you. (Or, depending on your skills, may enable you to diagnose and solve it.)
Often this fixes it but when it doesn't it often gives enough information to fix it.
You don't have to manually type those commands; you can copy and paste them. I recommend pasting and running each one separately, though. This makes it clearer what output is from which commands.
I copied the whole block and paste instead of running one-by-one. Although several commands in this are useless and some failed, but finally it does help in my case
â phuclv
Jan 15 at 8:45
add a comment |Â
up vote
16
down vote
up vote
16
down vote
Following steps 2-5 in the Package Manager Troubleshooting Procedure usually solves this problem.
For step 2, disable all your PPAs. You can uncheck all of them in Software Sources the same way you'd uncheck just one; see How to disable a particular PPA?. You can re-enable them later.
For step 3, close any open programs you can. It's probably safe to keep your web browser open so you have your instructions in front of you. But it's particularly important to make sure any package managers are not running. This include the Software Center, the Software Updater (Update Manager in older versions of Ubuntu), Synaptic, and Gdebi. It also includes command-line package management utilities like apt-get
, dpkg
, and aptitude
.
Note that if other users are logged on at the same time, they should log off if possible.
For step 4, open a terminal window. One way to do this that works no matter what desktop environment you use, is to press Ctrl+Alt+T.
For step 5, run these commands in the terminal window:
ubuntu-support-status
sudo grep -R proxy /etc/apt/*
grep proxy /etc/environment
echo $http_proxy
echo $ftp_proxy
grep proxy /etc/bash.bashrc
grep proxy ~/.bashrc
cat /etc/apt/apt.conf
sudo fuser -vvv /var/lib/dpkg/lock
sudo fuser -vvv /var/cache/apt/archives/lock
cat /etc/lsb-release
uname -a
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status || sudo cp /var/backups/apt.extended_states.0 /var/lib/dpkg/status
sudo mv /var/lib/dpkg/available /var/lib/dpkg/available-bad
sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists
sudo rm /var/cache/apt/*.bin
sudo mkdir /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists/partial
LANG=C;sudo apt-get clean
LANG=C;sudo apt-get autoclean
LANG=C;sudo apt-get --purge autoremove
LANG=C;sudo apt-get --fix-missing update -o APT::Cache-Limit=100000000
sudo dpkg --configure -a
sudo dpkg --clear-avail
LANG=C;sudo apt-get -f install
LANG=C;sudo apt-get --fix-missing install
LANG=C;sudo apt-get update -o APT::Cache-Limit=100000000 && sudo apt-get dist-upgrade
find /etc/apt -name '*.list' -exec bash -c 'echo -e "n$1n"; cat -n "$1"' _ '' ;
I copied that verbatim from PackageManagementTroubleshoootingProcedure on 2 March 2014. Those commands have evolved in the past and the recommended commands in that article may be changed or expanded on again in the future. So you may want to work from step 5 there. (That article, created/edited by "Contributors to the Ubuntu documentation wiki"--especially Mark Rijckenberg--is licensed CC-BY-SA 3.0, which allows inclusion here with proper attribution.)
Some of those commands attempt to fix the problem (and also may show diagnostic information); others display valuable information about the problem that you can include in your question or otherwise provide to someone helping you. (Or, depending on your skills, may enable you to diagnose and solve it.)
Often this fixes it but when it doesn't it often gives enough information to fix it.
You don't have to manually type those commands; you can copy and paste them. I recommend pasting and running each one separately, though. This makes it clearer what output is from which commands.
Following steps 2-5 in the Package Manager Troubleshooting Procedure usually solves this problem.
For step 2, disable all your PPAs. You can uncheck all of them in Software Sources the same way you'd uncheck just one; see How to disable a particular PPA?. You can re-enable them later.
For step 3, close any open programs you can. It's probably safe to keep your web browser open so you have your instructions in front of you. But it's particularly important to make sure any package managers are not running. This include the Software Center, the Software Updater (Update Manager in older versions of Ubuntu), Synaptic, and Gdebi. It also includes command-line package management utilities like apt-get
, dpkg
, and aptitude
.
Note that if other users are logged on at the same time, they should log off if possible.
For step 4, open a terminal window. One way to do this that works no matter what desktop environment you use, is to press Ctrl+Alt+T.
For step 5, run these commands in the terminal window:
ubuntu-support-status
sudo grep -R proxy /etc/apt/*
grep proxy /etc/environment
echo $http_proxy
echo $ftp_proxy
grep proxy /etc/bash.bashrc
grep proxy ~/.bashrc
cat /etc/apt/apt.conf
sudo fuser -vvv /var/lib/dpkg/lock
sudo fuser -vvv /var/cache/apt/archives/lock
cat /etc/lsb-release
uname -a
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status || sudo cp /var/backups/apt.extended_states.0 /var/lib/dpkg/status
sudo mv /var/lib/dpkg/available /var/lib/dpkg/available-bad
sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists
sudo rm /var/cache/apt/*.bin
sudo mkdir /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists/partial
LANG=C;sudo apt-get clean
LANG=C;sudo apt-get autoclean
LANG=C;sudo apt-get --purge autoremove
LANG=C;sudo apt-get --fix-missing update -o APT::Cache-Limit=100000000
sudo dpkg --configure -a
sudo dpkg --clear-avail
LANG=C;sudo apt-get -f install
LANG=C;sudo apt-get --fix-missing install
LANG=C;sudo apt-get update -o APT::Cache-Limit=100000000 && sudo apt-get dist-upgrade
find /etc/apt -name '*.list' -exec bash -c 'echo -e "n$1n"; cat -n "$1"' _ '' ;
I copied that verbatim from PackageManagementTroubleshoootingProcedure on 2 March 2014. Those commands have evolved in the past and the recommended commands in that article may be changed or expanded on again in the future. So you may want to work from step 5 there. (That article, created/edited by "Contributors to the Ubuntu documentation wiki"--especially Mark Rijckenberg--is licensed CC-BY-SA 3.0, which allows inclusion here with proper attribution.)
Some of those commands attempt to fix the problem (and also may show diagnostic information); others display valuable information about the problem that you can include in your question or otherwise provide to someone helping you. (Or, depending on your skills, may enable you to diagnose and solve it.)
Often this fixes it but when it doesn't it often gives enough information to fix it.
You don't have to manually type those commands; you can copy and paste them. I recommend pasting and running each one separately, though. This makes it clearer what output is from which commands.
edited Apr 13 '17 at 12:24
Communityâ¦
1
1
answered Nov 28 '11 at 2:36
Eliah Kagan
79k20218359
79k20218359
I copied the whole block and paste instead of running one-by-one. Although several commands in this are useless and some failed, but finally it does help in my case
â phuclv
Jan 15 at 8:45
add a comment |Â
I copied the whole block and paste instead of running one-by-one. Although several commands in this are useless and some failed, but finally it does help in my case
â phuclv
Jan 15 at 8:45
I copied the whole block and paste instead of running one-by-one. Although several commands in this are useless and some failed, but finally it does help in my case
â phuclv
Jan 15 at 8:45
I copied the whole block and paste instead of running one-by-one. Although several commands in this are useless and some failed, but finally it does help in my case
â phuclv
Jan 15 at 8:45
add a comment |Â
up vote
11
down vote
I have also seen this problem occur when you have too many sources in your repos.
Try the solution posted above and/or also perhaps this which is sometimes recommended on launchpad:
sudo mv /var/lib/apt/lists /var/lib/apt/lists-old
sudo mkdir -p /var/lib/apt/lists/partial
sudo apt-get update
Let us know how you get on.
Thank-you! This didn't work with DSL without the makedir as well.
â Doug
May 26 '14 at 2:33
add a comment |Â
up vote
11
down vote
I have also seen this problem occur when you have too many sources in your repos.
Try the solution posted above and/or also perhaps this which is sometimes recommended on launchpad:
sudo mv /var/lib/apt/lists /var/lib/apt/lists-old
sudo mkdir -p /var/lib/apt/lists/partial
sudo apt-get update
Let us know how you get on.
Thank-you! This didn't work with DSL without the makedir as well.
â Doug
May 26 '14 at 2:33
add a comment |Â
up vote
11
down vote
up vote
11
down vote
I have also seen this problem occur when you have too many sources in your repos.
Try the solution posted above and/or also perhaps this which is sometimes recommended on launchpad:
sudo mv /var/lib/apt/lists /var/lib/apt/lists-old
sudo mkdir -p /var/lib/apt/lists/partial
sudo apt-get update
Let us know how you get on.
I have also seen this problem occur when you have too many sources in your repos.
Try the solution posted above and/or also perhaps this which is sometimes recommended on launchpad:
sudo mv /var/lib/apt/lists /var/lib/apt/lists-old
sudo mkdir -p /var/lib/apt/lists/partial
sudo apt-get update
Let us know how you get on.
edited May 8 '11 at 12:49
Marco Ceppiâ¦
36.1k23150190
36.1k23150190
answered May 8 '11 at 10:19
andybleaden
1,746923
1,746923
Thank-you! This didn't work with DSL without the makedir as well.
â Doug
May 26 '14 at 2:33
add a comment |Â
Thank-you! This didn't work with DSL without the makedir as well.
â Doug
May 26 '14 at 2:33
Thank-you! This didn't work with DSL without the makedir as well.
â Doug
May 26 '14 at 2:33
Thank-you! This didn't work with DSL without the makedir as well.
â Doug
May 26 '14 at 2:33
add a comment |Â
up vote
4
down vote
I was running into a similar error:
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/dpkg/status
E: The package lists or status file could not be parsed or opened.
I followed similar suggestions to copy status-old
.
$ head /var/lib/dpkg/status
$ head /var/lib/dpkg/status-old
All of my status files were blank for some reason. Luckily, I found out there are backups of these files:
$ ls -l /var/backups/dpkg.status.*
-rw-r--r-- 1 root root 444620 Nov 15 06:33 /var/backups/dpkg.status.0
-rw-r--r-- 1 root root 444620 Nov 15 06:33 /var/backups/dpkg.status.1.gz
-rw-r--r-- 1 root root 128168 Sep 20 2013 /var/backups/dpkg.status.2.gz
-rw-r--r-- 1 root root 112545 Sep 16 2013 /var/backups/dpkg.status.3.gz
-rw-r--r-- 1 root root 107767 Sep 14 2013 /var/backups/dpkg.status.4.gz
-rw-r--r-- 1 root root 107766 Sep 11 2013 /var/backups/dpkg.status.5.gz
-rw-r--r-- 1 root root 94583 Sep 11 2013 /var/backups/dpkg.status.6.gz
I checked the latest backup...
$ head /var/backups/dpkg.status.0
...but it was still blank. So I unzipped an older one...
$ gunzip /var/backups/dpkg.status.1.gz
$ head /var/backups/dpkg.status.1
This time there was content. So I copied it...
$ cp /var/backups/dpkg.status.1 /var/lib/dpkg/status
Then apt-get update
ran without problems.
Credit goes to this post.
add a comment |Â
up vote
4
down vote
I was running into a similar error:
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/dpkg/status
E: The package lists or status file could not be parsed or opened.
I followed similar suggestions to copy status-old
.
$ head /var/lib/dpkg/status
$ head /var/lib/dpkg/status-old
All of my status files were blank for some reason. Luckily, I found out there are backups of these files:
$ ls -l /var/backups/dpkg.status.*
-rw-r--r-- 1 root root 444620 Nov 15 06:33 /var/backups/dpkg.status.0
-rw-r--r-- 1 root root 444620 Nov 15 06:33 /var/backups/dpkg.status.1.gz
-rw-r--r-- 1 root root 128168 Sep 20 2013 /var/backups/dpkg.status.2.gz
-rw-r--r-- 1 root root 112545 Sep 16 2013 /var/backups/dpkg.status.3.gz
-rw-r--r-- 1 root root 107767 Sep 14 2013 /var/backups/dpkg.status.4.gz
-rw-r--r-- 1 root root 107766 Sep 11 2013 /var/backups/dpkg.status.5.gz
-rw-r--r-- 1 root root 94583 Sep 11 2013 /var/backups/dpkg.status.6.gz
I checked the latest backup...
$ head /var/backups/dpkg.status.0
...but it was still blank. So I unzipped an older one...
$ gunzip /var/backups/dpkg.status.1.gz
$ head /var/backups/dpkg.status.1
This time there was content. So I copied it...
$ cp /var/backups/dpkg.status.1 /var/lib/dpkg/status
Then apt-get update
ran without problems.
Credit goes to this post.
add a comment |Â
up vote
4
down vote
up vote
4
down vote
I was running into a similar error:
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/dpkg/status
E: The package lists or status file could not be parsed or opened.
I followed similar suggestions to copy status-old
.
$ head /var/lib/dpkg/status
$ head /var/lib/dpkg/status-old
All of my status files were blank for some reason. Luckily, I found out there are backups of these files:
$ ls -l /var/backups/dpkg.status.*
-rw-r--r-- 1 root root 444620 Nov 15 06:33 /var/backups/dpkg.status.0
-rw-r--r-- 1 root root 444620 Nov 15 06:33 /var/backups/dpkg.status.1.gz
-rw-r--r-- 1 root root 128168 Sep 20 2013 /var/backups/dpkg.status.2.gz
-rw-r--r-- 1 root root 112545 Sep 16 2013 /var/backups/dpkg.status.3.gz
-rw-r--r-- 1 root root 107767 Sep 14 2013 /var/backups/dpkg.status.4.gz
-rw-r--r-- 1 root root 107766 Sep 11 2013 /var/backups/dpkg.status.5.gz
-rw-r--r-- 1 root root 94583 Sep 11 2013 /var/backups/dpkg.status.6.gz
I checked the latest backup...
$ head /var/backups/dpkg.status.0
...but it was still blank. So I unzipped an older one...
$ gunzip /var/backups/dpkg.status.1.gz
$ head /var/backups/dpkg.status.1
This time there was content. So I copied it...
$ cp /var/backups/dpkg.status.1 /var/lib/dpkg/status
Then apt-get update
ran without problems.
Credit goes to this post.
I was running into a similar error:
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/dpkg/status
E: The package lists or status file could not be parsed or opened.
I followed similar suggestions to copy status-old
.
$ head /var/lib/dpkg/status
$ head /var/lib/dpkg/status-old
All of my status files were blank for some reason. Luckily, I found out there are backups of these files:
$ ls -l /var/backups/dpkg.status.*
-rw-r--r-- 1 root root 444620 Nov 15 06:33 /var/backups/dpkg.status.0
-rw-r--r-- 1 root root 444620 Nov 15 06:33 /var/backups/dpkg.status.1.gz
-rw-r--r-- 1 root root 128168 Sep 20 2013 /var/backups/dpkg.status.2.gz
-rw-r--r-- 1 root root 112545 Sep 16 2013 /var/backups/dpkg.status.3.gz
-rw-r--r-- 1 root root 107767 Sep 14 2013 /var/backups/dpkg.status.4.gz
-rw-r--r-- 1 root root 107766 Sep 11 2013 /var/backups/dpkg.status.5.gz
-rw-r--r-- 1 root root 94583 Sep 11 2013 /var/backups/dpkg.status.6.gz
I checked the latest backup...
$ head /var/backups/dpkg.status.0
...but it was still blank. So I unzipped an older one...
$ gunzip /var/backups/dpkg.status.1.gz
$ head /var/backups/dpkg.status.1
This time there was content. So I copied it...
$ cp /var/backups/dpkg.status.1 /var/lib/dpkg/status
Then apt-get update
ran without problems.
Credit goes to this post.
answered Apr 11 '14 at 22:43
Andrew
25939
25939
add a comment |Â
add a comment |Â
up vote
3
down vote
I had the same problem and tried all the troubleshooting mentioned in other answers. Strangely the only fix was a different step:
Go to Software & updates -> Ubuntu Software -> Download From ->Other->Select Best Server
Wait for the tests. At the end of the tests the best server will be selected, not necessarily the nearest one nor the main server nor the server for your locale.
Now Reload Repo data, It will finish properly.
add a comment |Â
up vote
3
down vote
I had the same problem and tried all the troubleshooting mentioned in other answers. Strangely the only fix was a different step:
Go to Software & updates -> Ubuntu Software -> Download From ->Other->Select Best Server
Wait for the tests. At the end of the tests the best server will be selected, not necessarily the nearest one nor the main server nor the server for your locale.
Now Reload Repo data, It will finish properly.
add a comment |Â
up vote
3
down vote
up vote
3
down vote
I had the same problem and tried all the troubleshooting mentioned in other answers. Strangely the only fix was a different step:
Go to Software & updates -> Ubuntu Software -> Download From ->Other->Select Best Server
Wait for the tests. At the end of the tests the best server will be selected, not necessarily the nearest one nor the main server nor the server for your locale.
Now Reload Repo data, It will finish properly.
I had the same problem and tried all the troubleshooting mentioned in other answers. Strangely the only fix was a different step:
Go to Software & updates -> Ubuntu Software -> Download From ->Other->Select Best Server
Wait for the tests. At the end of the tests the best server will be selected, not necessarily the nearest one nor the main server nor the server for your locale.
Now Reload Repo data, It will finish properly.
answered Nov 11 '15 at 4:12
Muhammad El Nakeep
1835
1835
add a comment |Â
add a comment |Â
protected by Community⦠Oct 17 '12 at 9:32
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
6
It keeps baffling me how awkwardly this operating system handles its updates, even now, that this and similar things are required after no special misuse by the user.
â matt
Apr 4 '16 at 20:41