Error while installing nodejs v18 on ubuntu 20.04 - node.js

How can i fix this error?
I got this error when i tried to install nodejs v18 using these commands
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
THE ERROR:
E: Repository 'http://ppa.launchpad.net/lutris-team/lutris/ubuntu focal InRelease' changed its 'Label' value from 'Lutris stable' to 'lutris'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
I tried removing the previous node version but it didn't work.

Execute this command:
sudo apt-get update --allow-releaseinfo-change
See the apt man page for more info:
--allow-releaseinfo-change
Allow the update command to continue downloading data from
a repository which changed its information of the release
contained in the repository indicating e.g a new major
release. APT will fail at the update command for such
repositories until the change is confirmed to ensure the
user is prepared for the change. See also apt-secure(8)
for details on the concept and configuration

Related

Google Colab Git-Annex Update Issue

I am trying to use Google Colab for a fMRI experiment, however, I have been struggling with incompatibilities between package versions (for datalad). At first, git did not update with sudo-apt get and I found the solution with this.
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update
sudo apt-get install git -y
git --version
Even though git is updated, git-annex does not seem to update, whilst trying to update with this
sudo apt-get update -y
sudo apt-get install -y git-annex
it gives this error:
"git-annex is already the newest version (6.20180227-1)." But the dependency for datalad requires git-annex at least to be 8.
The git configuration is already initiated (user name and email).
I would deeply appreciate any opinions on how to fix this issue.
Thank you so much in advance.

Problem with moby packages when installing docker-ce on CentOS 7

I have a docker image for CentOS 7 which installs docker-ce via the recommended instructions.
i.e.
RUN yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
RUN yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
RUN yum update -y
RUN yum install -y docker-ce docker-ce-cli containerd.io
Recently this stopped working and now fails as follows:
--> Processing Conflict: moby-containerd-1.3.6+azure-1.x86_64 conflicts containerd
--> Processing Conflict: moby-runc-1.0.0~rc10+azure-2.x86_64 conflicts runc
--> Finished Dependency Resolution
Error: moby-containerd conflicts with containerd.io-1.2.13-3.2.el7.x86_64
Error: moby-runc conflicts with containerd.io-1.2.13-3.2.el7.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
The command '/bin/sh -c yum install -y docker-ce docker-ce-cli containerd.io' returned a non-zero code: 1
If the install command is replaced with:
yum install -y docker
I get a different error to do with an unsigned package:
Package runc is obsoleted by moby-runc, trying to install moby-runc-1.0.0~rc10+azure-2.x86_64 instead
...
Package moby-runc-1.0.0~rc10+azure-2.x86_64.rpm is not signed
I tried forcing use of a few old versions as below to no avail e.g.
RUN yum install -y docker-1.13.1-102.git7f2769b.el7.centos
Why is this happening? How can I fix it? And how can I prevent similar problems in the future?
Update: A critical missing piece of information from this question is the use of Azure. I had the following as aspnetcore is required to publish packages in an Azure devops pipeline:
RUN rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
RUN yum update -y && yum install aspnetcore-runtime-3.1 -y
my repo's needed to be updated --- the following resolved me:
curl https://packages.microsoft.com/config/rhel/7/prod.repo > ./microsoft-prod.repo
sudo cp ./microsoft-prod.repo /etc/yum.repos.d/
yum update -y
https://learn.microsoft.com/en-us/windows-server/administration/linux-package-repository-for-microsoft-software
The Answer from user8475213 worked for me. But I had to run after these commands also:
yum clean metadata
Caveat: Usually disclaimers apply. This is only what I think, I may be mistaken. Please comment / suggest edits if so.
How can I fix it?
This was actually a problem with the baseurl of a repo not the docker-ce repo (though I did originally file a bug report there (see issue #11198).
The moby packages come from "packages-microsoft-com-prod".
It seems the baseurl has changed.
The correct one is now:
baseurl=https://packages.microsoft.com/rhel/7/prod/
installed via:
RUN curl https://packages.microsoft.com/config/rhel/7/prod.repo >/etc/yum.repos.d/microsoft-prod.repo
The one with the dodgy packages is:
baseurl=https://packages.microsoft.com/centos/7/prod/
Installed via:
RUN rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
The moby packages exist only in the CentOS repo which is possibly defunct, as Microsoft themselves have changed installation documentation in various places.
There was also a workaround. You can exclude the 'moby' packages until they are really ready as in:
RUN yum install -y docker --exclude=moby-\*
Why is this happening?
I think this is caused by overly aggressive promotion of moby replacements for docker-ce functionality.
It is hopefully a transient state while they are working things out.
That the package moby-runc-1.0.0~rc10+azure-2.x86_64.rpm is not signed suggests a problem with the build process used. This package ought only to be available to beta testers. Certainly not in a repository marked "stable".
How can I prevent similar problems in the future?
Contrary to popular myths, using docker does not completely isolate you from changes in the environment. The repositories used by your docker files are themselves part of the environment. If that environment changes, as in this case, then your reproducible build may cease to be reproducible. The only real way to avoid that is to host your own repositories which comes at a high price. Usually external repositories are stable enough that this is not an issue.
You should consider specifying specific versions of packages to install in your dockerfile to avoid getting unexpected upgrades. However, that will not help you in cases like this where a package is obsoleted and replaced.
Related problem in RHEL 8
Seems that azure depends on packages from the container-tools module, and Docker conflicts with these packages.
# dnf remove #container-tools

How to stop/disable/hold automatic updates for packages in linux?

I have installed some packages (Docker, Kubeadm, Kubelet, Kubectl) for my Kubernetes cluster on Ubuntu 18.04 LTS.
I don't want these packages to get auto updated because there will be some issue arises between them when the update happens between one another.
I just want to update manually when they are stable.
What is the correct command for stop packages update automatically?
Commands I have used to install them on Ubuntu 18.04
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install -y docker-ce=18.06.1~ce~3-0~ubuntu
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
cat << EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF
sudo apt-get update
sudo apt-get install -y kubelet=1.12.7-00 kubeadm=1.12.7-00 kubectl=1.12.7-00
Motivation: You don't want to take any risks over sensitive packages on your linux machine (It happens when your application is in production and customers use it, or some important task running inside, newer version can break changes and accidentally can cause a downtime). In this situation - you want to pin specific versions to your packages and make sure no upgrade happens without explicit action and approval from your side.
Solution: You should disable the unattended-upgrades feature and pin your package into the current version you use (in other words - keep this version).
step 1: disable automatic upgrade (aka unattended-upgrades)
$ sudo vim /etc/apt/apt.conf.d/20auto-upgrades
#edit these lines - which disabling the upgrade feature.
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "0";
step 2: hold and freeze the specific package you want prevent from self upgrading:
sudo apt-mark hold <package-name>
You can use the hold status for a package (or set of packages) to not involve it upgrades. That gives you the more fine-tuned ability to decide on a per-package basis what should, or should not, upgrade. Very helpful during known digressions, bugs, and subtle changes in behaviour.
From the manual page for dpkg and edited / indented:
--get-selections [package-name-pattern...]
Get list of package selections, and write it to stdout. Without a pattern,
non-installed packages (i.e. those which have been previously purged) will
not be shown.
--set-selections
Set package selections using file read from stdin. This file should be in
the format “package state”, where state is one of install, hold, deinstall
or purge. Blank lines and comment lines beginning with ‘#’ are also
permitted.
The available file needs to be up-to-date for this command to be useful,
otherwise unknown packages will be ignored with a warning. See the
--update-avail and --merge-avail commands for more information.
The format is arguably a little weird -- but this is very powerful and helpful. I relied on it a few times during my twenty-five years (!!) with Debian/Ubuntu. I may have a shell script helper somwhere but I may need to dig.
Find of the day :). Ubuntu apt gives you the command to hold the auto update of the package. Thanks to Dirk for giving me the hint.
sudo apt-mark hold docker-ce kubelet kubeadm kubectl
apt doesn't have yum like flags --enable-repo and --disablerepo while performing install or update. A way to manage repos is shown here
But for your case the way you have added the repositories they have been appended to /etc/apt/sources.list therefore you can use sed to comment out the repository lines which you have added to install docker and kubernetes.
Note: you should comment out lines after installation and before performing sudo apt-get update
Example:To disable docker repo:
sed -i 's/^deb.*docker.*/# &/g' /etc/apt/sources.list
Enable the docker repo for manual update:
sed -i '/^# deb .*docker.*/s/^# //' /etc/apt/sources.list

"Error Executing Command, Exiting" Error upon installation of NodeJS

I am using Ubuntu 16.04LTS.
I typed in the following command in the terminal:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
In return, I am receiving the following error:
Reading package lists... Done
W: The repository 'http://ppa.launchpad.net/tualatrix/next/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.
W: The repository 'http://ppa.launchpad.net/tualatrix/ppa/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/tualatrix/next/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found
E: Failed to fetch http://ppa.launchpad.net/tualatrix/ppa/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.
Error executing command, exiting
I just installed the very old version of NodeJS and NPM from the Ubuntu repositories because I could not install the most current version. However, I still want the most current version of Node and NPM.
I had the same issue. The problem is not the nodejs installation script but another package in your package list in /etc/apt/sources.list.
The following worked for me:
1) Create backup of the file /etc/apt/sources.list just to be on the safe side:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bu
2) Remove the packages that cause the issue:
Open /etc/apt/sources.list with root permissions, e.g.
sudo nano /etc/apt/sources.list
and remove the
http://ppa.launchpad.net/tualatrix/next/ubuntu/dists/xenial/main/binary-amd64/Packages
parts. In my case it was skype that caused the issue; you can identify the critical packages by the lines that start with E: Failed to fetch.
Afterwards, the following works fine (taken from the installation instructions):
cd ~
curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt-get install nodejs
sudo apt-get install build-essential
If one then types
nodejs -v
it will return
v8.9.4
(or whatever version you specified).
In case you already have anaconda installed, I recommend to install node.js inside an environment which keeps things clean. A detailed explanation on how to do this can be found here. Basically all it needs is
conda create -n webdev nodejs
plus desired python modules in case you would like to use e.g. Flask or Django.

How to disallow update command to look for google-chrome dependency

I am using ubuntu 12.04. I am trying to update the system but getting some error with google-chrome module.
sudo apt-get update
Error:
W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release Unable to find expected entry 'main/binary-i386/Packages' in Release file (Wrong sources.list entry or malformed file)
E: Some index files failed to download. They have been ignored, or old ones used instead.
Is there any way, I can remove above dependency so that my update could run successfully, I tried by removing google chrome using:
sudo apt-get purge google-chrome-stable
but error remains the same.
You can comment your update link for google chrome in the apt source list file.
cd /etc/apt
sudo grep -rn "google" * to find out the apt list file which includes the update link of google chrome
Use one of your familiar editor to mark those lines.
In my case, the messages are as followed,
sources.list.d/google-chrome.list:3:deb http://dl.google.com/linux/chrome/deb/ stable main
sources.list.d/google-chrome.list.save:3:deb http://dl.google.com/linux/chrome/deb/ stable main

Resources