How do I fix a “Could not get lock /var/lib/dpkg/lock” problem?
mcheart@ubuntu:~$ sudo grep -R proxy /etc/apt/*
[sudo] password for mcheart:
mcheart@ubuntu:~$ grep proxy /etc/environment
mcheart@ubuntu:~$ echo $http_proxy
http://
mcheart@ubuntu:~$ echo $ftp_proxy
mcheart@ubuntu:~$ grep proxy /etc/bash.bashrc
mcheart@ubuntu:~$ grep proxy ~/.bashrc
mcheart@ubuntu:~$ cat /etc/apt/apt.conf
cat: /etc/apt/apt.conf: No such file or directory
mcheart@ubuntu:~$ sudo fuser -vvv /var/lib/dpkg/lock
mcheart@ubuntu:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_
DISTRIB_
DISTRIB_
mcheart@ubuntu:~$ uname -a
Linux ubuntu 3.2.0-48-generic #74-Ubuntu SMP Thu Jun 6 19:45:16 UTC 2013 i686 athlon i386 GNU/Linux
mcheart@ubuntu:~$ sudo rm /var/lib/
mcheart@ubuntu:~$ sudo rm /var/lib/dpkg/lock
mcheart@ubuntu:~$ sudo cp -arf /var/lib/dpkg /var/lib/
sudo mv /var/lib/
sudo cp /var/lib/
mcheart@ubuntu:~$ sudo mv /var/lib/
mcheart@ubuntu:~$ sudo cp /var/lib/
mcheart@ubuntu:~$ sudo mv /var/lib/
mcheart@ubuntu:~$ sudo cp /var/lib/
mcheart@ubuntu:~$ sudo mv /var/lib/
mcheart@ubuntu:~$ sudo cp /var/lib/
mcheart@ubuntu:~$ sudo rm -rf /var/lib/
mcheart@ubuntu:~$ sudo rm -rf /var/lib/apt/lists
mcheart@ubuntu:~$ sudo rm /var/cache/
mcheart@ubuntu:~$ sudo mkdir /var/lib/apt/lists
mcheart@ubuntu:~$ sudo mkdir /var/lib/
mcheart@ubuntu:~$ LANG=C;sudo apt-get clean
mcheart@ubuntu:~$ LANG=C;sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
mcheart@ubuntu:~$ LANG=C;sudo apt-get --purge autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
62 not fully installed or removed.
After this operation, 67.5 MB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database ... 331026 files and directories currently installed.)
Removing linux-headers-
Removing linux-headers-
Setting up libldap-2.4-2 (2.4.28-
Setting up libcurl3 (7.22.0-3ubuntu4.2) ...
Setting up libcurl3-gnutls (7.22.0-3ubuntu4.2) ...
Setting up libcurl3-nss (7.22.0-3ubuntu4.2) ...
Setting up libdrm2 (2.4.43-
Setting up libdrm-intel1 (2.4.43-
Setting up libdrm-nouveau1a (2.4.43-
Setting up libdrm-radeon1 (2.4.43-
Setting up libgl1-mesa-dri (8.0.4-0ubuntu0.6) ...
Setting up libglapi-mesa (8.0.4-0ubuntu0.6) ...
Setting up libgl1-mesa-glx (8.0.4-0ubuntu0.6) ...
Setting up libglu1-mesa (8.0.4-0ubuntu0.6) ...
Setting up libsvn1 (1.6.17dfsg-
Setting up libsvn-java (1.6.17dfsg-
Setting up libxatracker1 (8.0.4-0ubuntu0.6) ...
Setting up lightdm (1.2.3-0ubuntu2.2) ...
Setting up linux-image-
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/
run-parts: executing /etc/kernel/
run-parts: executing /etc/kernel/
update-initramfs: Generating /boot/initrd.
Warning: No support for locale: en_US.utf8
run-parts: executing /etc/kernel/
run-parts: executing /etc/kernel/
run-parts: executing /etc/kernel/
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Found Windows 7 (loader) on /dev/sda1
Skipping Windows 7 (loader) on Wubi system
Found Windows 7 (loader) on /dev/sda2
Skipping Windows 7 (loader) on Wubi system
Found Windows Vista (loader) on /dev/sda3
Skipping Windows Vista (loader) on Wubi system
done
Setting up liblightdm-
Setting up unity-greeter (0.2.9-0ubuntu1.2) ...
Setting up python2.7 (2.7.3-0ubuntu3.2) ...
Setting up python (2.7.3-0ubuntu2.2) ...
Setting up binutils (2.22-6ubuntu1.1) ...
Setting up compiz-core (1:0.9.
Setting up compiz-
Setting up libdecoration0 (1:0.9.
Setting up compiz-
Setting up compiz-gnome (1:0.9.
Setting up compiz (1:0.9.
Setting up firefox (22.0+build2-
Please restart all running instances of firefox, or you will experience problems.
Setting up firefox-globalmenu (22.0+build2-
Setting up firefox-
Setting up firefox-locale-en (22.0+build2-
Setting up librhythmbox-core5 (2.96-0ubuntu4.3) ...
Setting up gir1.2-rb-3.0 (2.96-0ubuntu4.3) ...
Setting up idle-python2.7 (2.7.3-0ubuntu3.2) ...
Setting up libpython2.7 (2.7.3-0ubuntu3.2) ...
Setting up libraptor2-0 (2.0.6-1ubuntu0.1) ...
Setting up linux-image-generic (3.2.0.49.59) ...
Setting up linux-headers-
Setting up linux-headers-
Setting up linux-headers-
Setting up linux-generic (3.2.0.49.59) ...
Setting up linux-libc-dev (3.2.0-49.75) ...
Setting up openssl (1.0.1-4ubuntu5.10) ...
Setting up rhythmbox-data (2.96-0ubuntu4.3) ...
Setting up rhythmbox (2.96-0ubuntu4.3) ...
Setting up rhythmbox-
Setting up rhythmbox-
Setting up rhythmbox-mozilla (2.96-0ubuntu4.3) ...
Setting up rhythmbox-
Setting up rhythmbox-plugins (2.96-0ubuntu4.3) ...
Setting up thunderbird (17.0.7+
Setting up thunderbird-
Setting up thunderbird-
Setting up thunderbird-
Setting up thunderbird-
Setting up thunderbird-
Setting up unity-lens-files (5.10.0-0ubuntu1.1) ...
Setting up x11proto-core-dev (7.0.22-1ubuntu0.1) ...
Setting up chromium-
Setting up chromium-browser (28.0.1500.
Setting up chromium-
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
mcheart@ubuntu:~$ LANG=C;sudo apt-get --purge autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
mcheart@ubuntu:~$ LANG=C;sudo apt-get --fix-missing update -o APT::Cache-
Get:1 http://
Get:2 http://
Get:3 http://
Get:4 http://
Get:5 http://
Get:6 http://
Get:7 http://
Get:8 http://
Get:9 http://
Get:10 http://
Get:11 http://
Get:12 http://
Get:13 http://
Get:14 http://
Get:15 http://
Get:16 http://
Get:17 http://
Get:18 http://
Get:19 http://
Get:20 http://
Get:21 http://
Get:22 http://
Get:23 http://
Get:24 http://
Get:25 http://
Get:26 http://
Get:27 http://
Get:28 http://
Get:29 http://
Get:30 http://
Get:31 http://
Get:32 http://
Get:33 http://
Get:34 http://
Get:35 http://
Get:36 http://
Get:37 http://
Get:38 http://
Get:39 http://
Get:40 http://
Get:41 http://
Get:42 http://
Get:43 http://
Get:44 http://
Get:45 http://
Get:46 http://
Get:47 http://
Get:48 http://
Get:49 http://
Get:50 http://
Get:51 http://
Get:52 http://
Get:53 http://
Get:54 http://
Get:55 http://
Get:56 http://
Get:57 http://
Get:58 http://
Get:59 http://
Get:60 http://
Get:61 http://
Get:62 http://
Get:63 http://
Get:64 http://
Get:65 http://
Get:66 http://
Get:67 http://
Get:68 http://
Get:69 http://
Get:70 http://
Get:71 http://
Get:72 http://
Fetched 19.4 MB in 21s (886 kB/s)
Reading package lists... Done
mcheart@ubuntu:~$ sudo dpkg --configure -a
mcheart@ubuntu:~$ sudo dpkg --clear-avail
mcheart@ubuntu:~$ LANG=C;sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
mcheart@ubuntu:~$ LANG=C;sudo apt-get --fix-missing install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
mcheart@ubuntu:~$ LANG=C;sudo apt-get update -o APT::Cache-
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
mcheart@ubuntu:~$ find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;
/etc/apt/
1 # deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Release i386 (20111012)]/ oneiric main restricted
2
3 # See http://
4 # newer versions of the distribution.
5 deb http://
6 deb-src http://
7
8 ## Major bug fix updates produced after the final release of the
9 ## distribution.
10 deb http://
11 deb-src http://
12
13 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
14 ## team. Also, please note that software in universe WILL NOT receive any
15 ## review or updates from the Ubuntu security team.
16 deb http://
17 deb-src http://
18 deb http://
19 deb-src http://
20
21 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
22 ## team, and may not be under a free licence. Please satisfy yourself as to
23 ## your rights to use the software. Also, please note that software in
24 ## multiverse WILL NOT receive any review or updates from the Ubuntu
25 ## security team.
26 deb http://
27 deb-src http://
28 deb http://
29 deb-src http://
30
31 ## N.B. software from this repository may not have been tested as
32 ## extensively as that contained in the main release, although it includes
33 ## newer versions of some applications which may provide useful features.
34 ## Also, please note that software in backports WILL NOT receive any review
35 ## or updates from the Ubuntu security team.
36 deb http://
37 deb-src http://
38
39 deb http://
40 deb-src http://
41 deb http://
42 deb-src http://
43 deb http://
44 deb-src http://
45
46 ## Uncomment the following two lines to add software from Canonical's
47 ## 'partner' repository.
48 ## This software is not part of Ubuntu, but is offered by Canonical and the
49 ## respective vendors as a service to Ubuntu users.
50 # deb http://
51 # deb-src http://
52
53 ## Uncomment the following two lines to add software from Ubuntu's
54 ## 'extras' repository.
55 ## This software is not part of Ubuntu, but is offered by third-party
56 ## developers who want to ship their latest software.
57 # deb http://
58 # deb-src http://
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Ubuntu apt Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Noel for more information if necessary.