1

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
karel
  • 114,770
  • Please add apt-cache policy libuv1 to your question. and also grep -r deb /etc/apt/sources.list /etc/apt/sources.list.d/. – nobody Oct 24 '21 at 13:22
  • 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. – user535733 Oct 24 '21 at 13:37
  • Hi, how can i find out which "nono-ubuntu" software installed this library or blocking it from upgrading? – Kiumars Javan Oct 24 '21 at 14:07
  • 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 – Kiumars Javan Oct 24 '21 at 14:12
  • no actually but thanks for answering. – Kiumars Javan Oct 24 '21 at 15:06

1 Answers1

1

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.

N0rbert
  • 99,918
  • Hi, should i remove the "cz.archive.ubuntu.com" ? because there are some packages that doesn't exist in iut repository – Kiumars Javan Oct 24 '21 at 14:55
  • Understood, let me edit my answer to use all cz-mirrors. – N0rbert Oct 24 '21 at 14:57
  • 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. – Kiumars Javan Oct 24 '21 at 15:46