6

I'm trying to install htop on my server (ubuntu 14.04). Here is the command:

sudo apt-get install htop

But it throws:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package htop

Noted that it throws E: Unable to locate package .... for everything I would like to install (like phpmyadmin). What's the problem and how can I fix it?

stack
  • 581

1 Answers1

8

The htop package is in the repository 'universe'. The following commands should work to install it.

sudo add-apt-repository universe

sudo apt-get update
sudo apt-get install htop

or as root

add-apt-repository universe

apt-get update
apt-get install htop
sudodus
  • 46,324
  • 5
  • 88
  • 152
  • The result of your first command: 'universe' distribution component enabled for all sources. – stack Dec 18 '17 at 07:03
  • I use htop and I install it as described here. What is the output of your update and install commands? – sudodus Dec 18 '17 at 07:07
  • update happens successfully, but E: Unable to locate package htop is still there when I try to install htop. Can you please take a look at my server if I give you user and password? – stack Dec 18 '17 at 07:09
  • How would you send me user and password in a secure way? Maybe you can use gpg encryption and my public key, that you find at https://help.ubuntu.com/community/mkusb/gui/tarball – sudodus Dec 18 '17 at 07:17
  • My server is empty (almost), so I don't care about security, if you give me your email, I will send it to you. Just do you have Putty installed on your computer ? – stack Dec 18 '17 at 07:20
  • Emaul has been sent – stack Dec 18 '17 at 07:41
  • did you get my email? – stack Dec 18 '17 at 07:42
  • @stack, Yes. Please see my messages in the chat room (and let me know if things are working now). – sudodus Dec 18 '17 at 07:56
  • 2
    In case anyone gets the error add-apt-repository command not found, first install the software properties common: apt-get install software-properties-common. – aderchox Aug 11 '20 at 07:04
  • 1
    I got the same issue as the add-apt-repository command not found but luckily I fixed my problem with sudo apt-get update i did not update the system before installing the new package. – Sunil Sapkota Oct 30 '23 at 15:36