Score:1

broken packages error while installing npm on ubuntu

cw flag

I'm trying to install gtop on my Ubuntu machine. For that I need to install nodejs and npm package manager. First I installed nodejs with sudo apt install nodejs and it get installed fine, but for installing npm I got this dependency error message:

The following packages have unmet dependencies:
libssl-dev : Depends: libssl1.1 (= 1.1.1j-1ubuntu3) but 1.1.1j-1ubuntu3.5 
is to be installed
libuv1-dev : Depends: libuv1 (= 1.40.0-1) but 1.40.0-1ubuntu0.1 is to be installed
E: Unable to correct problems, you have held broken packages.

I updated and upgraded the system and reinstalled nodejs and even updated with --fix-missing but I still have the same problem.

Results of apt-cache policy libuv1 :

  libuv1:
  Installed: 1.40.0-1ubuntu0.1
  Candidate: 1.40.0-1ubuntu0.1
  Version table:
 *** 1.40.0-1ubuntu0.1 100
        100 /var/lib/dpkg/status
     1.40.0-1 500
        500 http://cz.archive.ubuntu.com/ubuntu hirsute/main amd64 Packages

I've got these repositories:

$ grep -r deb /etc/apt/sources.list /etc/apt/sources.list.d/.
/etc/apt/sources.list: # deb cdrom:[Ubuntu 21.04 _Hirsute Hippo_ - Release amd64 (20210420)]/ hirsute main restricted
/etc/apt/sources.list:deb http://repo.iut.ac.ir/repo/Ubuntu/ hirsute restricted
/etc/apt/sources.list:# deb-src http://ir.archive.ubuntu.com/ubuntu/ hirsute main restricted
/etc/apt/sources.list:# deb-src http://ir.archive.ubuntu.com/ubuntu/ hirsute-updates main restricted
/etc/apt/sources.list:deb http://repo.iut.ac.ir/repo/Ubuntu/ hirsute universe
/etc/apt/sources.list:# deb-src http://ir.archive.ubuntu.com/ubuntu/ hirsute universe
/etc/apt/sources.list:# deb-src http://ir.archive.ubuntu.com/ubuntu/ hirsute-updates universe
/etc/apt/sources.list:deb http://repo.iut.ac.ir/repo/Ubuntu/ hirsute multiverse
/etc/apt/sources.list:# deb-src http://ir.archive.ubuntu.com/ubuntu/ hirsute multiverse
/etc/apt/sources.list:# deb-src http://ir.archive.ubuntu.com/ubuntu/ hirsute-updates multiverse
/etc/apt/sources.list:# deb-src http://ir.archive.ubuntu.com/ubuntu/ hirsute-backports main restricted universe multiverse
/etc/apt/sources.list:# deb http://archive.canonical.com/ubuntu hirsute partner
/etc/apt/sources.list:# deb-src http://archive.canonical.com/ubuntu hirsute partner
/etc/apt/sources.list:deb http://repo.iut.ac.ir/repo/Ubuntu/ hirsute-security restricted
/etc/apt/sources.list:# deb-src http://security.ubuntu.com/ubuntu hirsute-security main restricted
/etc/apt/sources.list:deb http://repo.iut.ac.ir/repo/Ubuntu/ hirsute-security universe
/etc/apt/sources.list:# deb-src http://security.ubuntu.com/ubuntu hirsute-security universe
/etc/apt/sources.list:deb http://repo.iut.ac.ir/repo/Ubuntu/ hirsute-security multiverse
/etc/apt/sources.list:# deb-src http://security.ubuntu.com/ubuntu hirsute-security multiverse
/etc/apt/sources.list:# (e.g. netinst, live or single CD). The matching "deb cdrom"
/etc/apt/sources.list:deb http://cz.archive.ubuntu.com/ubuntu hirsute main
/etc/apt/sources.list.d/./vscode.list:deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code stable main
/etc/apt/sources.list.d/./windscribe-repo.list.save:deb https://repo.windscribe.com/ubuntu bionic main
/etc/apt/sources.list.d/./windscribe-repo.list:deb https://repo.windscribe.com/ubuntu bionic main
/etc/apt/sources.list.d/./vscode.list.save:deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code stable main
nobody avatar
gh flag
Please add `apt-cache policy libuv1` to your question. and also `grep -r deb /etc/apt/sources.list /etc/apt/sources.list.d/`.
user535733 avatar
cn flag
Your output suggests that some software that you installed (from a non-Ubuntu source) requires a specific version of those packages. That non-Ubuntu software's version requirement is blocking upgrades and new software (that depends upon those upgrades). Search your memory: Locate and uninstall the conflicting non-Ubuntu software.
Kiumars Javan avatar
cw flag
Hi, how can i find out which "nono-ubuntu" software installed this library or blocking it from upgrading?
Kiumars Javan avatar
cw flag
i checked with this command "apt-cache rdepends libuv1" and i have these packages that depends on libuv1 : bind9-libs libuv1-dev moarvm cmake bind9-libs bind9 ttyd storj siridb-server r-cran-httpuv r-cran-fs python3-uvloop-dbg python3-uvloop pcp passenger netdata-core neovim lua-luv libdqlite0 libwebsockets16 libwebsockets-test-server libtensorpipe0 libstorj0 libraft0 libpcp-web1 libh2o0.13 libgetdns10 cmake-curses-gui knot-resolver hddemux cmake-qt-gui
karel avatar
sa flag
Does this answer your question? [Unable to correct problems, you have held broken packages](https://askubuntu.com/questions/223237/unable-to-correct-problems-you-have-held-broken-packages)
Kiumars Javan avatar
cw flag
no actually but thanks for answering.
Score:1
zw flag

Your repositories miss the main, hirsute-updates and hirsute-security components. At first add them by using commands below

sudo add-apt-repository -r "deb http://repo.iut.ac.ir/repo/Ubuntu/ hirsute restricted"
sudo add-apt-repository -r "deb http://repo.iut.ac.ir/repo/Ubuntu/ hirsute universe"
sudo add-apt-repository -r "deb http://repo.iut.ac.ir/repo/Ubuntu/ hirsute multiverse"
sudo add-apt-repository -r "deb http://repo.iut.ac.ir/repo/Ubuntu/ hirsute-security restricted"
sudo add-apt-repository -r "deb http://repo.iut.ac.ir/repo/Ubuntu/ hirsute-security universe"
sudo add-apt-repository -r "deb http://repo.iut.ac.ir/repo/Ubuntu/ hirsute-security multiverse"

sudo add-apt-repository "deb http://cz.archive.ubuntu.com/ubuntu hirsute universe multiverse restricted"
sudo add-apt-repository "deb http://cz.archive.ubuntu.com/ubuntu hirsute-security main universe multiverse restricted"
sudo add-apt-repository "deb http://cz.archive.ubuntu.com/ubuntu hirsute-updates main universe multiverse restricted"

Then update package lists and install all needed upgrades with new dependencies by

sudo apt-get update
sudo apt-get dist-upgrade

and retry.

Kiumars Javan avatar
cw flag
Hi, should i remove the "cz.archive.ubuntu.com" ? because there are some packages that doesn't exist in iut repository
N0rbert avatar
zw flag
Understood, let me edit my answer to use all cz-mirrors.
Kiumars Javan avatar
cw flag
well, thanks it works for me actually i kept the iut repo because it is closer for me geographically and its faster and just added the main and main for updates and after a 600mb upgrade it is ok now. but i have a question in first place why there was not main category in apt sources? as i remember i had installed a pure release of ubuntu hirsute.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.