unable to lock the administration directory (/var/lib/dpkg/) is another process using it?

Asked by mike

ubuntu-mate@ubuntu-mate:~$ ubuntu-support-status
Support status summary of 'ubuntu-mate':

You have 1854 packages (100.0%) that can not/no-longer be downloaded
You have 0 packages (0.0%) that are unsupported

Run with --show-unsupported, --show-supported or --show-all to see more details
ubuntu-mate@ubuntu-mate:~$ cat /etc/dpkg/dpkg.cfg.d/multiarch
cat: /etc/dpkg/dpkg.cfg.d/multiarch: No such file or directory
ubuntu-mate@ubuntu-mate:~$ dpkg --print-foreign-architectures
ubuntu-mate@ubuntu-mate:~$ sudo su
root@ubuntu-mate:/home/ubuntu-mate# cd /
root@ubuntu-mate:/# ubuntu-support-status
Support status summary of 'ubuntu-mate':

You have 1854 packages (100.0%) that can not/no-longer be downloaded
You have 0 packages (0.0%) that are unsupported

Run with --show-unsupported, --show-supported or --show-all to see more details
root@ubuntu-mate:/# cat /etc/dpkg/dpkg.cfg.d/multiarch
cat: /etc/dpkg/dpkg.cfg.d/multiarch: No such file or directory
root@ubuntu-mate:/# dpkg --print-foreign-architectures
root@ubuntu-mate:/# sudo grep -R proxy /etc/apt/*
root@ubuntu-mate:/# grep proxy /etc/environment
root@ubuntu-mate:/# echo $http_proxy

root@ubuntu-mate:/# echo $http_proxy

root@ubuntu-mate:/# echo $ftp_proxy

root@ubuntu-mate:/# grep proxy /etc/bash.bashrc
root@ubuntu-mate:/# grep proxy ~/.bashr
grep: /root/.bashr: No such file or directory
root@ubuntu-mate:/# cat /etc/apt/apt.conf
cat: /etc/apt/apt.conf: No such file or directory
root@ubuntu-mate:/# sudo fuser -vvv /var/lib/dpkg/lock
root@ubuntu-mate:/# sudo fuser -vvv /var/cache/apt/archives/lock
root@ubuntu-mate:/# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"
root@ubuntu-mate:/# uname -a
Linux ubuntu-mate 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:06:14 UTC 2016 i686 i686 i686 GNU/Linux
root@ubuntu-mate:/# sudo rm /var/lib/apt/lists/lock
root@ubuntu-mate:/# sudo rm /var/cache/apt/archives/lock
root@ubuntu-mate:/#
root@ubuntu-mate:/# sudo rm /var/cache/apt/archives/lock
rm: cannot remove '/var/cache/apt/archives/lock': No such file or directory
root@ubuntu-mate:/#
root@ubuntu-mate:/# sudo rm /var/cache/apt/archives/lock
rm: cannot remove '/var/cache/apt/archives/lock': No such file or directory
root@ubuntu-mate:/#
root@ubuntu-mate:/# sudo rm /var/cache/apt/archives/lock
rm: cannot remove '/var/cache/apt/archives/lock': No such file or directory
root@ubuntu-mate:/# sudo rm /var/lib/dpkg/lock
root@ubuntu-mate:/# sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
root@ubuntu-mate:/# sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
root@ubuntu-mate:/# sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status || sudo cp /var/backups/apt.extended_states.0 /var/lib/dpkg/status
root@ubuntu-mate:/# sudo mv /var/lib/dpkg/available /var/lib/dpkg/available-bad
root@ubuntu-mate:/# sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
cp: cannot stat '/var/lib/dpkg/available-old': No such file or directory
root@ubuntu-mate:/# sudo rm -rf /var/lib/dpkg/updates/*
root@ubuntu-mate:/# sudo rm -rf /var/lib/apt/lists
root@ubuntu-mate:/# sudo rm /var/cache/apt/*.bin
root@ubuntu-mate:/# sudo rm /var/cache/apt/*.bin
rm: cannot remove '/var/cache/apt/*.bin': No such file or directory
root@ubuntu-mate:/# sudo mkdir /var/lib/apt/lists
root@ubuntu-mate:/#
root@ubuntu-mate:/# sudo mkdir /var/lib/apt/lists
mkdir: cannot create directory ‘/var/lib/apt/lists’: File exists
root@ubuntu-mate:/#
root@ubuntu-mate:/# sudo mkdir /var/lib/apt/lists
mkdir: cannot create directory ‘/var/lib/apt/lists’: File exists
root@ubuntu-mate:/#
root@ubuntu-mate:/# sudo mkdir /var/lib/apt/lists
mkdir: cannot create directory ‘/var/lib/apt/lists’: File exists
root@ubuntu-mate:/# sudo mkdir /var/lib/apt/lists/partial
root@ubuntu-mate:/# LANG=C;sudo apt-get clean
root@ubuntu-mate:/# LANG=C;sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
root@ubuntu-mate:/# sudo dpkg --configure -a
root@ubuntu-mate:/# sudo dpkg --clear-avail
root@ubuntu-mate:/# 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.
root@ubuntu-mate:/# 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.
root@ubuntu-mate:/# 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.
root@ubuntu-mate:/# LANG=C;sudo apt-get --fix-missing update -o APT::Cache-Limit=100000000
Reading package lists... Done
root@ubuntu-mate:/# LANG=C;sudo apt-get update -o APT::Cache-Limit=100000000 && sudo apt-get dist-upgrade
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.
root@ubuntu-mate:/# find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;

/etc/apt/sources.list

     1 # deb cdrom:[Ubuntu-MATE 16.04.1 LTS _Xenial Xerus_ - Release i386 (20160719)]/ xenial main multiverse restricted universe
     2

/etc/apt/sources.list.d/steam.list

     1 # deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
     2 # deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam

/etc/apt/sources.list.d/ubuntu-mate-dev-ubuntu-welcome-xenial.list

     1 # deb http://ppa.launchpad.net/ubuntu-mate-dev/welcome/ubuntu xenial main
     2 # deb-src http://ppa.launchpad.net/ubuntu-mate-dev/welcome/ubuntu xenial main
root@ubuntu-mate:/# sudo dpkg --audit
root@ubuntu-mate:/#

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Looks fine. What is the output of:

sudo apt-get --reinstall install nano

Thanks

Revision history for this message
Manfred Hampl (m-hampl) said :
#2

You do not have any repository listed in your sources.list configuration file, so I assume that you cannot install any software.

You have to add the standard list of repositories into the /etc/apt/sources.list configuration file, e.g by adding the following contents:

# deb cdrom:[Ubuntu-MATE 16.04.1 LTS _Xenial Xerus_ - Release i386 (20160719)]/ xenial main multiverse restricted universe
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

deb http://archive.ubuntu.com/ubuntu/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ xenial universe
deb-src http://archive.ubuntu.com/ubuntu/ xenial universe
deb http://archive.ubuntu.com/ubuntu/ xenial-updates universe
deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu/ xenial multiverse
deb-src http://archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://archive.ubuntu.com/ubuntu/ xenial-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates multiverse

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu xenial partner
# deb-src http://archive.canonical.com/ubuntu xenial partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
# deb http://extras.ubuntu.com/ubuntu xenial main
# deb-src http://extras.ubuntu.com/ubuntu xenial main

deb http://security.ubuntu.com/ubuntu xenial-security main restricted
deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse

Can you help with this problem?

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

To post a message you must log in.