Welcome!
Important information
-- Spectre and Meltdown vulnerabilities

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-18 Final release info here
-- Migration Information to MX-18 here
-- antiX-17.3 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

[solved] Problem with /var/lib/apt/lists/lock

Help for Current Versions of MX
Post Reply
mg979
Forum Novice
Forum  Novice
Posts: 14
Joined: Fri Jan 05, 2018 10:37 am

[solved] Problem with /var/lib/apt/lists/lock

#1

Post by mg979 » Wed Jan 09, 2019 10:47 pm

On a fresh install on a very old laptop, I installed a bunch of programs, among which silversearcher-ag.

Running

Code: Select all

ag
I get:

Code: Select all

$ ag
Lettura elenco dei pacchetti... Fatto
W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (1: Operazione non permessa)
E: Impossibile aprire il file di blocco /var/lib/apt/lists/lock - open (13: Permesso negato)
E: Impossibile bloccare la directory /var/lib/apt/lists/
W: Si è verificato un problema nell'eseguire l'unlink del file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permesso negato)
W: Si è verificato un problema nell'eseguire l'unlink del file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permesso negato)
E: Impossibile aprire il file di blocco /var/lib/dpkg/lock - open (13: Permesso negato)
E: Impossibile acquisire il blocco sulla directory di amministrazione (/var/lib/dpkg/). È necessario essere root.
But if I run

Code: Select all

sudo ag
or

Code: Select all

/usr/bin/ag
it works.

Code: Select all

which ag
shows /usr/bin/ag.
I tried rebooting, uninstalling and reinstalling ag, but the problem persists. Even stranger, if I uninstall it and run ag, instead of getting 'command not found' I get this same error.

I also tried deleting /var/lib/apt/lists/lock as I read after a google search.

What to do?

Output of ls /var/lib/apt/lists -l

Code: Select all

ls /var/lib/apt/lists -l
totale 138808
-rw-r--r-- 1 root root   231665 nov 10 10:35 ftp.it.debian.org_debian_dists_stretch_contrib_binary-amd64_Packages
-rw-r--r-- 1 root root   216763 nov 10 10:35 ftp.it.debian.org_debian_dists_stretch_contrib_binary-i386_Packages
-rw-r--r-- 1 root root   187429 lug 14 10:57 ftp.it.debian.org_debian_dists_stretch_contrib_i18n_Translation-en
-rw-r--r-- 1 root root 38931296 nov 10 10:35 ftp.it.debian.org_debian_dists_stretch_main_binary-amd64_Packages
-rw-r--r-- 1 root root 38743277 nov 10 10:35 ftp.it.debian.org_debian_dists_stretch_main_binary-i386_Packages
-rw-r--r-- 1 root root 26453538 nov 10 10:35 ftp.it.debian.org_debian_dists_stretch_main_i18n_Translation-en
-rw-r--r-- 1 root root 22770965 giu 16  2017 ftp.it.debian.org_debian_dists_stretch_main_i18n_Translation-it
-rw-r--r-- 1 root root   383610 nov 10 10:35 ftp.it.debian.org_debian_dists_stretch_non-free_binary-amd64_Packages
-rw-r--r-- 1 root root   340669 nov 10 10:35 ftp.it.debian.org_debian_dists_stretch_non-free_binary-i386_Packages
-rw-r--r-- 1 root root   422133 nov 10 10:35 ftp.it.debian.org_debian_dists_stretch_non-free_i18n_Translation-en
-rw-r--r-- 1 root root   117946 nov 10 11:12 ftp.it.debian.org_debian_dists_stretch_Release
-rw-r--r-- 1 root root     2434 nov 10 11:23 ftp.it.debian.org_debian_dists_stretch_Release.gpg
-rw-r--r-- 1 root root    91028 gen  9 21:39 ftp.it.debian.org_debian_dists_stretch-updates_InRelease
-rw-r--r-- 1 root root    19156 gen  2 20:58 ftp.it.debian.org_debian_dists_stretch-updates_main_binary-amd64_Packages
-rw-r--r-- 1 root root    19143 gen  2 20:58 ftp.it.debian.org_debian_dists_stretch-updates_main_binary-i386_Packages
-rw-r--r-- 1 root root    15588 lug 31 21:57 ftp.it.debian.org_debian_dists_stretch-updates_main_i18n_Translation-en
-rw-r--r-- 1 root root    27413 gen 10 01:35 it.mxrepo.com_antix_stretch_dists_stretch_InRelease
-rw-r--r-- 1 root root   792779 gen 10 01:35 it.mxrepo.com_antix_stretch_dists_stretch_main_binary-amd64_Packages
-rw-r--r-- 1 root root   842022 gen 10 01:35 it.mxrepo.com_antix_stretch_dists_stretch_main_binary-i386_Packages
-rw-r--r-- 1 root root     8136 gen 10 01:24 it.mxrepo.com_mx_repo_dists_stretch_InRelease
-rw-r--r-- 1 root root  2147977 gen  9 17:20 it.mxrepo.com_mx_repo_dists_stretch_main_binary-amd64_Packages
-rw-r--r-- 1 root root  2151328 gen  9 17:20 it.mxrepo.com_mx_repo_dists_stretch_main_binary-i386_Packages
-rw-r--r-- 1 root root   277858 gen 10 01:24 it.mxrepo.com_mx_repo_dists_stretch_non-free_binary-amd64_Packages
-rw-r--r-- 1 root root   284850 gen 10 01:24 it.mxrepo.com_mx_repo_dists_stretch_non-free_binary-i386_Packages
-rw-r----- 1 root root        0 gen 10 03:31 lock
drwx------ 2 _apt root    12288 gen 10 03:31 partial
-rw-r--r-- 1 root root     4856 dic  8 02:39 security.debian.org_dists_stretch_updates_contrib_binary-amd64_Packages
-rw-r--r-- 1 root root     4847 dic  8 02:39 security.debian.org_dists_stretch_updates_contrib_binary-i386_Packages
-rw-r--r-- 1 root root     4844 feb  7  2018 security.debian.org_dists_stretch_updates_contrib_i18n_Translation-en
-rw-r--r-- 1 root root    94345 gen  9 23:51 security.debian.org_dists_stretch_updates_InRelease
-rw-r--r-- 1 root root  2528426 gen  8 23:45 security.debian.org_dists_stretch_updates_main_binary-amd64_Packages
-rw-r--r-- 1 root root  2536578 gen  8 23:45 security.debian.org_dists_stretch_updates_main_binary-i386_Packages
-rw-r--r-- 1 root root  1398473 dic 27 17:38 security.debian.org_dists_stretch_updates_main_i18n_Translation-en
-rw-r--r-- 1 root root     3421 ott 14 21:00 security.debian.org_dists_stretch_updates_non-free_binary-amd64_Packages
-rw-r--r-- 1 root root     3419 ott 14 21:00 security.debian.org_dists_stretch_updates_non-free_binary-i386_Packages
-rw-r--r-- 1 root root     1381 ago 16 22:44 security.debian.org_dists_stretch_updates_non-free_i18n_Translation-en
Last edited by mg979 on Thu Jan 10, 2019 11:49 am, edited 1 time in total.

mg979
Forum Novice
Forum  Novice
Posts: 14
Joined: Fri Jan 05, 2018 10:37 am

Re: Problem with /var/lib/apt/lists/lock

#2

Post by mg979 » Wed Jan 09, 2019 10:57 pm

Ok I found out it's set as an alias to apt-get, but I can't see the file that sets it.

Edit: it was in /etc/bash.bashrc

I didn't have this issue with another install (virtualbox).

Post Reply

Return to “MX Help”