How do I fix a “Could not get lock /var/lib/dpkg/lock” problem?

Asked by Noel

mcheart@ubuntu:~$ sudo grep -R proxy /etc/apt/*
[sudo] password for mcheart:
mcheart@ubuntu:~$ grep proxy /etc/environment
mcheart@ubuntu:~$ echo $http_proxy
http://proxyss.wits.ac.za:80/
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_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"
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/apt/lists/lock
mcheart@ubuntu:~$ sudo rm /var/lib/dpkg/lock
mcheart@ubuntu:~$ 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
mcheart@ubuntu:~$ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
mcheart@ubuntu:~$ sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status || sudo cp /var/backups/apt.extended_states.0 /var/lib/dpkg/status
mcheart@ubuntu:~$ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
mcheart@ubuntu:~$ sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status || sudo cp /var/backups/apt.extended_states.0 /var/lib/dpkg/status
mcheart@ubuntu:~$ sudo mv /var/lib/dpkg/available /var/lib/dpkg/available-bad
mcheart@ubuntu:~$ sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
mcheart@ubuntu:~$ sudo rm -rf /var/lib/dpkg/updates/*
mcheart@ubuntu:~$ sudo rm -rf /var/lib/apt/lists
mcheart@ubuntu:~$ sudo rm /var/cache/apt/*.bin
mcheart@ubuntu:~$ sudo mkdir /var/lib/apt/lists
mcheart@ubuntu:~$ sudo mkdir /var/lib/apt/lists/partial
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-headers-3.2.0-37* linux-headers-3.2.0-37-generic*
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-3.2.0-37-generic ...
Removing linux-headers-3.2.0-37 ...
Setting up libldap-2.4-2 (2.4.28-1.1ubuntu4.3) ...
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-0ubuntu0.0.2) ...
Setting up libdrm-intel1 (2.4.43-0ubuntu0.0.2) ...
Setting up libdrm-nouveau1a (2.4.43-0ubuntu0.0.2) ...
Setting up libdrm-radeon1 (2.4.43-0ubuntu0.0.2) ...
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-3ubuntu3.3) ...
Setting up libsvn-java (1.6.17dfsg-3ubuntu3.3) ...
Setting up libxatracker1 (8.0.4-0ubuntu0.6) ...
Setting up lightdm (1.2.3-0ubuntu2.2) ...
Setting up linux-image-3.2.0-49-generic (3.2.0-49.75) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.2.0-49-generic /boot/vmlinuz-3.2.0-49-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-49-generic /boot/vmlinuz-3.2.0-49-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-49-generic
Warning: No support for locale: en_US.utf8
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.2.0-49-generic /boot/vmlinuz-3.2.0-49-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.2.0-49-generic /boot/vmlinuz-3.2.0-49-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.2.0-49-generic /boot/vmlinuz-3.2.0-49-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-49-generic
Found initrd image: /boot/initrd.img-3.2.0-49-generic
Found linux image: /boot/vmlinuz-3.2.0-48-generic
Found initrd image: /boot/initrd.img-3.2.0-48-generic
Found linux image: /boot/vmlinuz-3.2.0-44-generic
Found initrd image: /boot/initrd.img-3.2.0-44-generic
Found linux image: /boot/vmlinuz-3.2.0-43-generic
Found initrd image: /boot/initrd.img-3.2.0-43-generic
Found linux image: /boot/vmlinuz-3.2.0-40-generic
Found initrd image: /boot/initrd.img-3.2.0-40-generic
Found linux image: /boot/vmlinuz-3.2.0-37-generic
Found initrd image: /boot/initrd.img-3.2.0-37-generic
Found linux image: /boot/vmlinuz-3.0.0-12-generic
Found initrd image: /boot/initrd.img-3.0.0-12-generic
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-gobject-1-0 (1.2.3-0ubuntu2.2) ...
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.7.12-0ubuntu2) ...
Setting up compiz-plugins-main-default (1:0.9.7.0~bzr19-0ubuntu10.1) ...
Setting up libdecoration0 (1:0.9.7.12-0ubuntu2) ...
Setting up compiz-plugins-default (1:0.9.7.12-0ubuntu2) ...
Setting up compiz-gnome (1:0.9.7.12-0ubuntu2) ...
Setting up compiz (1:0.9.7.12-0ubuntu2) ...
Setting up firefox (22.0+build2-0ubuntu0.12.04.2) ...
Please restart all running instances of firefox, or you will experience problems.
Setting up firefox-globalmenu (22.0+build2-0ubuntu0.12.04.2) ...
Setting up firefox-gnome-support (22.0+build2-0ubuntu0.12.04.2) ...
Setting up firefox-locale-en (22.0+build2-0ubuntu0.12.04.2) ...
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-3.2.0-49 (3.2.0-49.75) ...
Setting up linux-headers-3.2.0-49-generic (3.2.0-49.75) ...
Setting up linux-headers-generic (3.2.0.49.59) ...
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-plugin-cdrecorder (2.96-0ubuntu4.3) ...
Setting up rhythmbox-plugin-zeitgeist (2.96-0ubuntu4.3) ...
Setting up rhythmbox-mozilla (2.96-0ubuntu4.3) ...
Setting up rhythmbox-plugin-magnatune (2.96-0ubuntu4.3) ...
Setting up rhythmbox-plugins (2.96-0ubuntu4.3) ...
Setting up thunderbird (17.0.7+build1-0ubuntu0.12.04.1) ...
Setting up thunderbird-globalmenu (17.0.7+build1-0ubuntu0.12.04.1) ...
Setting up thunderbird-gnome-support (17.0.7+build1-0ubuntu0.12.04.1) ...
Setting up thunderbird-locale-en (1:17.0.7+build1-0ubuntu0.12.04.1) ...
Setting up thunderbird-locale-en-gb (1:17.0.7+build1-0ubuntu0.12.04.1) ...
Setting up thunderbird-locale-en-us (1:17.0.7+build1-0ubuntu0.12.04.1) ...
Setting up unity-lens-files (5.10.0-0ubuntu1.1) ...
Setting up x11proto-core-dev (7.0.22-1ubuntu0.1) ...
Setting up chromium-codecs-ffmpeg (28.0.1500.52-0ubuntu1.12.04.2) ...
Setting up chromium-browser (28.0.1500.52-0ubuntu1.12.04.2) ...
Setting up chromium-browser-l10n (28.0.1500.52-0ubuntu1.12.04.2) ...
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-Limit=100000000
Get:1 http://archive.ubuntu.com precise Release.gpg [198 B]
Get:2 http://archive.ubuntu.com precise-updates Release.gpg [198 B]
Get:3 http://archive.ubuntu.com precise-backports Release.gpg [198 B]
Get:4 http://archive.ubuntu.com precise-security Release.gpg [198 B]
Get:5 http://archive.ubuntu.com precise Release [49.6 kB]
Get:6 http://archive.ubuntu.com precise-updates Release [49.6 kB]
Get:7 http://archive.ubuntu.com precise-backports Release [49.6 kB]
Get:8 http://archive.ubuntu.com precise-security Release [49.6 kB]
Get:9 http://archive.ubuntu.com precise/main Sources [934 kB]
Get:10 http://archive.ubuntu.com precise/restricted Sources [5470 B]
Get:11 http://archive.ubuntu.com precise/universe Sources [5019 kB]
Get:12 http://archive.ubuntu.com precise/multiverse Sources [155 kB]
Get:13 http://archive.ubuntu.com precise/main i386 Packages [1274 kB]
Get:14 http://archive.ubuntu.com precise/restricted i386 Packages [8431 B]
Get:15 http://archive.ubuntu.com precise/universe i386 Packages [4796 kB]
Get:16 http://archive.ubuntu.com precise/multiverse i386 Packages [121 kB]
Get:17 http://archive.ubuntu.com precise/main TranslationIndex [3706 B]
Get:18 http://archive.ubuntu.com precise/multiverse TranslationIndex [2676 B]
Get:19 http://archive.ubuntu.com precise/restricted TranslationIndex [2596 B]
Get:20 http://archive.ubuntu.com precise/universe TranslationIndex [2922 B]
Get:21 http://archive.ubuntu.com precise-updates/main Sources [400 kB]
Get:22 http://archive.ubuntu.com precise-updates/restricted Sources [5467 B]
Get:23 http://archive.ubuntu.com precise-updates/universe Sources [91.7 kB]
Get:24 http://archive.ubuntu.com precise-updates/multiverse Sources [6571 B]
Get:25 http://archive.ubuntu.com precise-updates/main i386 Packages [670 kB]
Get:26 http://archive.ubuntu.com precise-updates/restricted i386 Packages [10.0 kB]
Get:27 http://archive.ubuntu.com precise-updates/universe i386 Packages [212 kB]
Get:28 http://archive.ubuntu.com precise-updates/multiverse i386 Packages [13.8 kB]
Get:29 http://archive.ubuntu.com precise-updates/main TranslationIndex [3564 B]
Get:30 http://archive.ubuntu.com precise-updates/multiverse TranslationIndex [2605 B]
Get:31 http://archive.ubuntu.com precise-updates/restricted TranslationIndex [2461 B]
Get:32 http://archive.ubuntu.com precise-updates/universe TranslationIndex [2850 B]
Get:33 http://archive.ubuntu.com precise-backports/main Sources [2899 B]
Get:34 http://archive.ubuntu.com precise-backports/restricted Sources [14 B]
Get:35 http://archive.ubuntu.com precise-backports/universe Sources [30.9 kB]
Get:36 http://archive.ubuntu.com precise-backports/multiverse Sources [4385 B]
Get:37 http://archive.ubuntu.com precise-backports/main i386 Packages [2376 B]
Get:38 http://archive.ubuntu.com precise-backports/restricted i386 Packages [14 B]
Get:39 http://archive.ubuntu.com precise-backports/universe i386 Packages [30.8 kB]
Get:40 http://archive.ubuntu.com precise-backports/multiverse i386 Packages [4594 B]
Get:41 http://archive.ubuntu.com precise-backports/main TranslationIndex [72 B]
Get:42 http://archive.ubuntu.com precise-backports/multiverse TranslationIndex [72 B]
Get:43 http://archive.ubuntu.com precise-backports/restricted TranslationIndex [70 B]
Get:44 http://archive.ubuntu.com precise-backports/universe TranslationIndex [73 B]
Get:45 http://archive.ubuntu.com precise-security/main Sources [83.6 kB]
Get:46 http://archive.ubuntu.com precise-security/restricted Sources [2494 B]
Get:47 http://archive.ubuntu.com precise-security/universe Sources [26.7 kB]
Get:48 http://archive.ubuntu.com precise-security/multiverse Sources [1383 B]
Get:49 http://archive.ubuntu.com precise-security/main i386 Packages [312 kB]
Get:50 http://archive.ubuntu.com precise-security/restricted i386 Packages [4620 B]
Get:51 http://archive.ubuntu.com precise-security/universe i386 Packages [80.1 kB]
Get:52 http://archive.ubuntu.com precise-security/multiverse i386 Packages [2367 B]
Get:53 http://archive.ubuntu.com precise-security/main TranslationIndex [74 B]
Get:54 http://archive.ubuntu.com precise-security/multiverse TranslationIndex [71 B]
Get:55 http://archive.ubuntu.com precise-security/restricted TranslationIndex [72 B]
Get:56 http://archive.ubuntu.com precise-security/universe TranslationIndex [73 B]
Get:57 http://archive.ubuntu.com precise/main Translation-en [726 kB]
Get:58 http://archive.ubuntu.com precise/multiverse Translation-en [93.4 kB]
Get:59 http://archive.ubuntu.com precise/restricted Translation-en [2395 B]
Get:60 http://archive.ubuntu.com precise/universe Translation-en [3341 kB]
Get:61 http://archive.ubuntu.com precise-updates/main Translation-en [298 kB]
Get:62 http://archive.ubuntu.com precise-updates/multiverse Translation-en [7834 B]
Get:63 http://archive.ubuntu.com precise-updates/restricted Translation-en [2432 B]
Get:64 http://archive.ubuntu.com precise-updates/universe Translation-en [123 kB]
Get:65 http://archive.ubuntu.com precise-backports/main Translation-en [1512 B]
Get:66 http://archive.ubuntu.com precise-backports/multiverse Translation-en [4043 B]
Get:67 http://archive.ubuntu.com precise-backports/restricted Translation-en [14 B]
Get:68 http://archive.ubuntu.com precise-backports/universe Translation-en [23.1 kB]
Get:69 http://archive.ubuntu.com precise-security/main Translation-en [144 kB]
Get:70 http://archive.ubuntu.com precise-security/multiverse Translation-en [995 B]
Get:71 http://archive.ubuntu.com precise-security/restricted Translation-en [1253 B]
Get:72 http://archive.ubuntu.com precise-security/universe Translation-en [49.5 kB]
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-Limit=100000000 && sudo apt-get dist-upgrade
Hit http://archive.ubuntu.com precise Release.gpg
Hit http://archive.ubuntu.com precise-updates Release.gpg
Hit http://archive.ubuntu.com precise-backports Release.gpg
Hit http://archive.ubuntu.com precise-security Release.gpg
Hit http://archive.ubuntu.com precise Release
Hit http://archive.ubuntu.com precise-updates Release
Hit http://archive.ubuntu.com precise-backports Release
Hit http://archive.ubuntu.com precise-security Release
Hit http://archive.ubuntu.com precise/main Sources
Hit http://archive.ubuntu.com precise/restricted Sources
Hit http://archive.ubuntu.com precise/universe Sources
Hit http://archive.ubuntu.com precise/multiverse Sources
Hit http://archive.ubuntu.com precise/main i386 Packages
Hit http://archive.ubuntu.com precise/restricted i386 Packages
Hit http://archive.ubuntu.com precise/universe i386 Packages
Hit http://archive.ubuntu.com precise/multiverse i386 Packages
Hit http://archive.ubuntu.com precise/main TranslationIndex
Hit http://archive.ubuntu.com precise/multiverse TranslationIndex
Hit http://archive.ubuntu.com precise/restricted TranslationIndex
Hit http://archive.ubuntu.com precise/universe TranslationIndex
Hit http://archive.ubuntu.com precise-updates/main Sources
Hit http://archive.ubuntu.com precise-updates/restricted Sources
Hit http://archive.ubuntu.com precise-updates/universe Sources
Hit http://archive.ubuntu.com precise-updates/multiverse Sources
Hit http://archive.ubuntu.com precise-updates/main i386 Packages
Hit http://archive.ubuntu.com precise-updates/restricted i386 Packages
Hit http://archive.ubuntu.com precise-updates/universe i386 Packages
Hit http://archive.ubuntu.com precise-updates/multiverse i386 Packages
Hit http://archive.ubuntu.com precise-updates/main TranslationIndex
Hit http://archive.ubuntu.com precise-updates/multiverse TranslationIndex
Hit http://archive.ubuntu.com precise-updates/restricted TranslationIndex
Hit http://archive.ubuntu.com precise-updates/universe TranslationIndex
Hit http://archive.ubuntu.com precise-backports/main Sources
Hit http://archive.ubuntu.com precise-backports/restricted Sources
Hit http://archive.ubuntu.com precise-backports/universe Sources
Hit http://archive.ubuntu.com precise-backports/multiverse Sources
Hit http://archive.ubuntu.com precise-backports/main i386 Packages
Hit http://archive.ubuntu.com precise-backports/restricted i386 Packages
Hit http://archive.ubuntu.com precise-backports/universe i386 Packages
Hit http://archive.ubuntu.com precise-backports/multiverse i386 Packages
Hit http://archive.ubuntu.com precise-backports/main TranslationIndex
Hit http://archive.ubuntu.com precise-backports/multiverse TranslationIndex
Hit http://archive.ubuntu.com precise-backports/restricted TranslationIndex
Hit http://archive.ubuntu.com precise-backports/universe TranslationIndex
Hit http://archive.ubuntu.com precise-security/main Sources
Hit http://archive.ubuntu.com precise-security/restricted Sources
Hit http://archive.ubuntu.com precise-security/universe Sources
Hit http://archive.ubuntu.com precise-security/multiverse Sources
Hit http://archive.ubuntu.com precise-security/main i386 Packages
Hit http://archive.ubuntu.com precise-security/restricted i386 Packages
Hit http://archive.ubuntu.com precise-security/universe i386 Packages
Hit http://archive.ubuntu.com precise-security/multiverse i386 Packages
Hit http://archive.ubuntu.com precise-security/main TranslationIndex
Hit http://archive.ubuntu.com precise-security/multiverse TranslationIndex
Hit http://archive.ubuntu.com precise-security/restricted TranslationIndex
Hit http://archive.ubuntu.com precise-security/universe TranslationIndex
Hit http://archive.ubuntu.com precise/main Translation-en
Hit http://archive.ubuntu.com precise/multiverse Translation-en
Hit http://archive.ubuntu.com precise/restricted Translation-en
Hit http://archive.ubuntu.com precise/universe Translation-en
Hit http://archive.ubuntu.com precise-updates/main Translation-en
Hit http://archive.ubuntu.com precise-updates/multiverse Translation-en
Hit http://archive.ubuntu.com precise-updates/restricted Translation-en
Hit http://archive.ubuntu.com precise-updates/universe Translation-en
Hit http://archive.ubuntu.com precise-backports/main Translation-en
Hit http://archive.ubuntu.com precise-backports/multiverse Translation-en
Hit http://archive.ubuntu.com precise-backports/restricted Translation-en
Hit http://archive.ubuntu.com precise-backports/universe Translation-en
Hit http://archive.ubuntu.com precise-security/main Translation-en
Hit http://archive.ubuntu.com precise-security/multiverse Translation-en
Hit http://archive.ubuntu.com precise-security/restricted Translation-en
Hit http://archive.ubuntu.com precise-security/universe Translation-en
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/sources.list

     1 # deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Release i386 (20111012)]/ oneiric main restricted
     2
     3 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
     4 # newer versions of the distribution.
     5 deb http://archive.ubuntu.com/ubuntu precise main restricted
     6 deb-src http://archive.ubuntu.com/ubuntu precise main restricted
     7
     8 ## Major bug fix updates produced after the final release of the
     9 ## distribution.
    10 deb http://archive.ubuntu.com/ubuntu precise-updates main restricted
    11 deb-src http://archive.ubuntu.com/ubuntu precise-updates main restricted
    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://archive.ubuntu.com/ubuntu precise universe
    17 deb-src http://archive.ubuntu.com/ubuntu precise universe
    18 deb http://archive.ubuntu.com/ubuntu precise-updates universe
    19 deb-src http://archive.ubuntu.com/ubuntu precise-updates universe
    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://archive.ubuntu.com/ubuntu precise multiverse
    27 deb-src http://archive.ubuntu.com/ubuntu precise multiverse
    28 deb http://archive.ubuntu.com/ubuntu precise-updates multiverse
    29 deb-src http://archive.ubuntu.com/ubuntu precise-updates multiverse
    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://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse
    37 deb-src http://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse
    38
    39 deb http://archive.ubuntu.com/ubuntu precise-security main restricted
    40 deb-src http://archive.ubuntu.com/ubuntu precise-security main restricted
    41 deb http://archive.ubuntu.com/ubuntu precise-security universe
    42 deb-src http://archive.ubuntu.com/ubuntu precise-security universe
    43 deb http://archive.ubuntu.com/ubuntu precise-security multiverse
    44 deb-src http://archive.ubuntu.com/ubuntu precise-security multiverse
    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://archive.canonical.com/ubuntu oneiric partner
    51 # deb-src http://archive.canonical.com/ubuntu oneiric partner
    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://extras.ubuntu.com/ubuntu oneiric main
    58 # deb-src http://extras.ubuntu.com/ubuntu oneiric main

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

What you call the “Could not get lock /var/lib/dpkg/lock” problem in fact is a feature to keep system settings consistent.

There are several different programs for doing package management (install and remove program packages, perform upgrades to newer versions). The lock file /var/lib/dpkg/lock is used to make sure that package management activities do not execute conflicting tasks at the same time.

Imagine that package A depends on the presence of package B. You have B installed on your system, and in one window you use a package management program to install A - which checks if B is installed and starts installing A. At the same time, however, you use a package management program in another window and tell it to remove package B. What result do you expect?

Your output of the package management troubleshooting procedure shows that you apparently had a problem, but running that procedure apparently has solved it.

Now there is one weakness in your system:
You are running Ubuntu 12.04 precise, but in your sources I see (albeit disabled) source entries for oneiric.

I recommend the following:
open a terminal (ctrl-alt-t) and issue the command
gksudo gksudo gedit /etc/apt/sources.list
This will ask for your password and open an editor with your sources.list loaded.
Scroll down to line 50 and replace the four occurrences of "oneiric" by "precise" in the range between this line and the end of the file (not in line 1!).
Then save the file and close the editor.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#2

Not seeing an issue in the output except a few old sourxes which has been pointed out. Packages are updating....

Can you help with this problem?

Provide an answer of your own, or ask Noel for more information if necessary.

To post a message you must log in.