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 stretch/updates main deb-src stretch/updates main deb stretch-updates main non-free deb-src 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:
sudo: Installed: (none) Candidate: (none) Version table: 31 Answer
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.