This question already has an answer here:

I use Ubuntu 16.04. APT cannot seem to find the package m4:

root@kevin:/# sudo apt install m4

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package m4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'm4' has no installation candidate

I ran:

sudo apt-get upgrade && apt-get update

This didn't make any difference.

root@kevin:/# grep main /etc/apt/sources.list
# deb cdrom:[Ubuntu 16.04.3 LTS _Xenial Xerus_ - Release amd64 (20170801)]/ xenial main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
## extensively as that contained in the main release, although it includes
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted

marked as duplicate by muru, David Foerster, Eric Carvalho, Kevin Bowen, Severus Tux Aug 21 '17 at 8:31

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Run sudo apt update. – Pilot6 Aug 17 '17 at 15:00
  • It's funny... I use 16.04 lts and m4 is already installed, and it's not obsolete... – Redbob Aug 17 '17 at 15:03
  • 4
    Please edit your question to include the output of grep main /etc/apt/sources.list – steeldriver Aug 17 '17 at 15:15
  • I see root@kevin:/# sudo apt install m4, so already root so no need for sudo... – George Udosen Aug 17 '17 at 15:29
  • 1
    @kevin I know it does't matter but seems to me to be too worrisome for the system... :). – George Udosen Aug 17 '17 at 15:54

Your sources.list doesn't contain any binary sources.

Go to System Settings -> Software & Updates and enable all sources at the first tab.

Then the system will suggest to update and you'll be able to install everything from the repos.

  • awesome! it works !! Thank you very much! oh it has wasted much of my time! @Pilot6 – kevin Aug 17 '17 at 16:00

Your command sudo apt-get upgrade && apt-get update does not have the necessary second sudo after the &&, so apt doesn't have the privileges it needs in order to update properly.

Please run sudo apt update. Then you should be able to install m4.

  • I don't think that's the reason here - the OP appears to be running the commands from a root shell, so sudo is moot (otherwise there'd be an error about permissions / lock files) – steeldriver Aug 17 '17 at 15:11
  • 1
    Good point. Then I have no idea what's going on. @kevin , it would be helpful if you tell us what appears on the screen when you run sudo apt update. – Nick Weinberg Aug 17 '17 at 15:13
  • root@kevin:/home/kevin# sudo apt update Hit:1 cn.archive.ubuntu.com/ubuntu xenial InRelease Hit:2 cn.archive.ubuntu.com/ubuntu xenial-updates InRelease Hit:3 cn.archive.ubuntu.com/ubuntu xenial-backports InRelease Hit:4 ppa.launchpad.net/bitcoin-abc/ppa/ubuntu xenial InRelease Hit:5 ppa.launchpad.net/ethereum/ethereum/ubuntu xenial InRelease Hit:6 security.ubuntu.com/ubuntu xenial-security InRelease Reading package lists... Done Building dependency tree – kevin Aug 17 '17 at 15:22
  • Reading state information... Done All packages are up to date. sorry , I can't paste all the content in one box @Nick Weinberg – kevin Aug 17 '17 at 15:22
  • Problem has been solved , My sources.list doesn't contain any binary sources. Thanks for your help as well! – kevin Aug 17 '17 at 16:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.