0

I'm accessing a linux system [Ubuntu16.04 LTS] remotely. A lot of things seem to be messed up. I need to install libgmp-dev, which gives E: Sub-process /usr/bin/dpkg returned an error code (1) error. After trying a few things, I thought apt-get update might help, but sudo apt-get update gives error:

Err:18 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main amd64 Packages
404  Not Found
W: The repository 'http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/mc3man/trusty-media/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.

Read a few posts and it seems removing the ppa is the solution, however I'm not sure how to do that from the command line. This popular answer suggests sudo apt-get install ppa-purge before removing the ppa. But running sudo apt-get install ppa-purge again gives error E: Sub-process /usr/bin/dpkg returned an error code (1).

I want to try the solution sudo add-apt-repository --remove ppa:whatever/ppa but embarrassing enough I'm not sure what to put in place of whatever because I never installed these ppas (I only just got access to this system).

Output of ls /etc/apt/sources.list.d is:

aheck-ubuntu-ppa-xenial.list                 mc3man-ubuntu-xerus-media-xenial.list  nccl-2.1.15-ga-cuda8.0.list.save
aheck-ubuntu-ppa-xenial.list.save            multiverse.list                        opennms.list
blahota-ubuntu-texstudio-xenial.list         multiverse.list.save                   sublime-text.list
blahota-ubuntu-texstudio-xenial.list.save    myppa.list                             sublime-text.list.save
mc3man-ubuntu-trusty-media-xenial.list       myppa.list.save
mc3man-ubuntu-trusty-media-xenial.list.save  nccl-2.1.15-ga-cuda8.0.list

EDIT:

When I run apt-get update a lot of ppas from mc3man don't give any error, except the one (amd64), is it safe to remove all of these files which come as output of grep mc3man * inside /etc/apt/sources.list.d/?

mc3man-ubuntu-trusty-media-xenial.list:deb http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial main
mc3man-ubuntu-trusty-media-xenial.list:# deb-src http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial main
mc3man-ubuntu-trusty-media-xenial.list.save:deb http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial main
mc3man-ubuntu-trusty-media-xenial.list.save:# deb-src http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial main
mc3man-ubuntu-xerus-media-xenial.list:deb http://ppa.launchpad.net/mc3man/xerus-media/ubuntu xenial main
mc3man-ubuntu-xerus-media-xenial.list:# deb-src http://ppa.launchpad.net/mc3man/xerus-media/ubuntu xenial main

EDIT2:

mv mc3man-ubuntu-trusty-media-xenial.list mc3man-ubuntu-trusty-media-xenial.list.bak worked because I'm behind a proxy, now the error is:

E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/ 
momo
  • 115

1 Answers1

2

You could try to cd into the sources.list.d directory and run grep to a subpattern that you know from the error, such as:

grep mc3man *

this will show the file and line that it found that contains the given string, such as

afile.list: blah/mc3man/blah

you can then proceed with the sudo add-apt-repository --remove ppa:whatever/ppa as proposed using the file where the string was matched (in this example, afile.list)

  • Hi, thanks a lot! Just added an edit to the question, can you please check before I proceed? – momo Jun 03 '20 at 09:01
  • 1
    your error relates to the http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main which is the first two lines of your output only ( mc3man-ubuntu-trusty-media-xenial.list). – Nick Andriopoulos Jun 03 '20 at 09:06
  • 1
    Ran but gives ERROR: '~mc3man-ubuntu-trusty-media-xenial.list' user or team does not exist. – momo Jun 03 '20 at 09:13
  • 1
    this indicates that either there is a network issue on your server or you are behind a proxy -- both scenarios are incompatible with add-apt-repository. You can simply move the .list files to backups (someone already did so with .list.save, so you can use mv mc3man-ubuntu-trusty-media-xenial.list mc3man-ubuntu-trusty-media-xenial.list.bak ). This should allow apt to work. – Nick Andriopoulos Jun 03 '20 at 09:18
  • I am behind a proxy. This helped get rid of above error. However getting a different error E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/ now. – momo Jun 03 '20 at 09:23
  • try sudo lsof /var/lib/dpkg/lock to figure out if the lock file belongs to any process (if it does, either wait for it to end or kill -9 it. If no process owns it, just sudo rm /var/lib/dpkg/lock. – Nick Andriopoulos Jun 03 '20 at 09:29