Why do I get an error running sudo apt-get update?

2

Hi install Lubuntu 16.04 on my system and whenever I run sudo apt-get update , I get the following error:

  

W: The repository «cdrom: // Lubuntu 16.04.2 LTS Xenial Xerus - Release i386 (20170216) xenial Release» does not have a Publication file.   N: Data from a repository like this can not be authenticated and therefore its use is potentially dangerous.   N: See the apt-secure (8) man page for details on creating repositories and configuring users.   W: The repository « link xenial Release» does not have a Publication file.   N: Data from a repository like this can not be authenticated and therefore its use is potentially dangerous.   N: See the apt-secure (8) man page for details on creating repositories and configuring users.   E: Failed to get cdrom: // Lubuntu 16.04.2 LTS Xenial Xerus - Release i386 (20170216) / dists / xenial / main / binary-i386 / Packages Use «apt-cdrom» to make APT recognize this CD. You can not use «apt-get update» to add new CDs   E: Failed to get link 404 Not Found   E: Some index files could not be downloaded, have been omitted, or old ones used instead.

I have run apt-cdrom as it says, but nothing happens. Any idea what I'm doing wrong? I tried to install Node.js and it also gave me error:

  

npm update check failed │   │ Try running with sudo or get access │   │ to the local update config store via │   │ sudo chown -R $ USER: $ (id -gn $ USER) /home/miguel/.config

Try cleaning the cache, but the command did not work with the sudo npm cache clean -f command I do not know what else I can do to correct errors. Thanks.

    
asked by Miguel Espeso 10.07.2018 в 11:44
source

1 answer

1

Formerly, until about 4 years ago, Chris Lea's repo was the source for recent versions of Node, but since 2014, Chris Lea decided join forces with Nodesource , from where the official packages are published today.

At this moment you have installed a repo that stopped publishing updates more or less in the version of Ubuntu 14.04 (Trusty Tahr) therefore there is no release for 16.04 (Xenial Xerus) or a public key for it. It will not let you install and the process of sudo apt-get update will be interrupted.

You'll have to remove the repo that you added. As a first step, remove repos in your /etc/apt/sources.list.d folder

sudo rm -f /etc/apt/sources.list.d/chris-lea-node_js-*.list

And then run

sudo apt-get update

If that does not work, then first run:

sudo add-apt-repository -y -r ppa:chris-lea/node.js

Then repeat the steps that I put you up.

Having removed the offensive repo (not that it's a rude repo, it just messes up the apt update procedure). As I said, having done this, install nodejs from Nodesource. For example version 8

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
    
answered by 10.07.2018 / 13:09
source