1

I can't for the life of me get samba (server) to install on my raspberry pi

pi@raspberrypi ~ $ sudo apt-get install samba
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package samba 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
However the following packages replace it:
  smbclient samba-common libpam-winbind libnss-winbind

E: Package 'samba' has no installation candidate

My sources.list looks like this:

deb http://ftp.us.debian.org/debian/ jessie main contrib non-free
deb-src http://ftp.us.debian.org/debian/ jessie main contrib non-free

Trying to install samba-common and samba-common-bin result in similar messages.

No amount of sudo apt-get update or sudo apt-get upgrade seems to be helping at all and all of the Googling I've done seems to have most people's similar problems solved by these update/upgrade.

I tried to install it from source, but ran into some dependency issues there that I couldn't immediately solve. It seems to me that the problem is in my sources.list file.. but I'm having a hard time figuring out what source I need to give me a valid installation candidate for samba.

Edit:

When running sudo apt-get update I had two There is no public key available for the following key IDs errors.

I ran wget https://archive.raspbian.org/raspbian.public.key -O - | sudo apt-key add - – but that didn't seem to fix them, but I tracked down the following command and ran it for each of the listed keys which fixed the issue: sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com [key-id]

Now when I run sudo apt-get update, there are no errors but sudo apt-get install samba still returns the error E: Package 'samba' has no installation candidate (as above)

1

You have got wrong sources.list. It should be:

deb http://archive.raspbian.org/raspbian jessie main contrib non-free rpi
deb-src http://archive.raspbian.org/raspbian jessie main contrib non-free rpi

The OS you have got is Raspbian not Debian. It's not the same distribution.

  • Updated the sources.list and reupdated/upgraded and got the same error. Also worth noting, I have two messages like "There is no public key available for the following key IDs" when I perform an update, but I think they're probably unrelated. – Julian Apr 6 '16 at 13:40
  • It's important. You need to import key. Use wget https://archive.raspbian.org/raspbian.public.key -O - | sudo apt-key add - – Huczu Apr 6 '16 at 13:42
  • I've fixed the "no public key available" errors using sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com and then run apt-get update but I still get the same errors from trying to install samba. (will edit question to include this) – Julian Apr 6 '16 at 21:16
0

I fixed this by adding the wheezy repositories to my sources.list file:

deb http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi
deb-src http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi

I'm not exactly sure why it wouldn't work with the jessie repositories.. Now that I'm thinking about it, I am running wheezy and was using the jessie repositories to get the most recent version for some other packages that I was installing.

  • If you want to use jessie just change repository to jessie and run: apt-get update; apt-get dist-upgrade – Huczu Apr 7 '16 at 6:40

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.