I've just installed debian 9 using the full disc image (debian-9.8.0-amd64-xfce-CD-1) to install on VirtualBox in a 64bit environment from a Windows 10 host. During the installation I unchecked the desktop environment and xfce checkboxes. I kept the utilities checkbox checked. I did this as I want to be left with a lightweight installation to use as a local server.

Trying to install the 'sudo' package using apt.

I have commented out the CD-rom source and added these sources to /etc/apt/sources.list;

deb http://security.debian.org/debian-security stretch/updates main
deb-src http://security.debian.org/debian-security stretch/updates main

deb http://ftp.debian.org/debian/ stretch-updates main non-free
deb-src http://ftp.debian.org/debian/ stretch-updates main non-free

I have then run apt update and apt upgrade.

Further to this is where I am encountering a problem. When I try to run apt install sudo, I get the following:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package sud 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 'sudo' has no installation candidate

I can see that this is true when I run apt-cache policy sudo as it shows me:

  Installed: (none)
  Candidate: (none)
  Version table:
  • Hi Nath, Could you please paste the output of your sources.list file? I believe there is main component missing. I think you have main and non-free versions of stretch-updates, but not the main version for stretch. – C0deDaedalus Apr 11 '19 at 15:05
  • @C0deDaedalus all of the uncommented lines of the sources.list file are in the question, regards – Nath Imagine Apr 11 '19 at 15:09
  • If that is all in your sources.list, you should add lines for main for stretch too. Then do an update upgrade followed by a reboot. – C0deDaedalus Apr 11 '19 at 15:19

If I understand your problem correctly - You may have some missing sources in your sources.list file.

Use Debian Sources List Generator to automatically generate a list of sources and update your sources.list accordingly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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