Upgrade Samba 3.0.28a to 3.4.3 on Ubuntu 8.04 LTS

Download the source and unpack…

# wget http://samba.org/samba/ftp/stable/samba-3.4.3.tar.gz
# tar zxvf samba-3.4.3.tar.gz
# cd samba-3.4.3/source3

Some people have tried the latest Samba 3.4.4 and report that it works with the rest of these instructions as well. If you want 3.4.4, do this instead:
# wget http://samba.org/samba/ftp/stable/samba-3.4.4.tar.gz
# tar zxvf samba-3.4.4.tar.gz
# cd samba-3.4.4/source3

I needed some development headers for the compile, so

# apt-get install libldap2-dev libkrb5-dev uuid-dev libpam0g-dev zlib1g-dev

You may need more than these – if so, your configure will fail and it will tell you that something.h wasn’t found. apt-cache search something will usually give you the package you are looking for, or a quick Google will tell you what to get.  For example, I was told uuid.h was missing, so:

# apt-cache search uuid | grep -- -dev
libblkid-dev - block device id library - headers and static libraries
libossp-uuid-dev - OSSP uuid ISO-C and C++ - headers and static libraries
uuid-dev - universally unique id library - headers and static libraries

uuid-dev was pretty obvious, so I installed it and the next time I ran ./configure, it went further before failing on something else.  The apt-get command above includes all of the roadblocks I ran into.

Here is the ./configure command I used, which matches the one from the Ubuntu 3.0.28a source with the exception that I removed –without-smbclient from the list of options.

You may want to use Yogg’s configure command from the comments below instead – I haven’t tried it yet, but he indicates it matches the actual Ubuntu file structure better.

# ./configure --cache-file=./config.cache

Once the ./configure ran without issues, I ran make:
# make
Using CFLAGS = -O -I. -I/root/samba-3.4.3/source3 -I/root/samba-3.4.3/source3/../lib/popt -I/root/samba-3.4.3/source3/iniparser/src -Iinclude -I./include -I. -I. -I./../lib/replace -I./../lib/talloc -I./../lib/tevent -I./../lib/tdb/include -I./libaddns -I./librpc -I./.. -DHAVE_CONFIG_H -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Iinclude -I./include -I. -I. -I./../lib/replace -I./../lib/talloc -I./../lib/tevent -I./../lib/tdb/include -I./libaddns -I./librpc -I./.. -I./../lib/popt -DLDAP_DEPRECATED -I/root/samba-3.4.3/source3/lib -I.. -I../source4 -D_SAMBA_BUILD_=3 -D_SAMBA_BUILD_=3
LIBS = -lresolv -lnsl -ldl
LDFLAGS = -Wl,-z,relro -Wl,-Bsymbolic-functions -L./bin
DYNEXP = -Wl,--export-dynamic
LDSHFLAGS = -shared -Wl,-Bsymbolic -Wl,-z,relro -Wl,-Bsymbolic-functions -L./bin
SONAMEFLAG = -Wl,-soname=
mkdir bin
Compiling ../lib/talloc/talloc.c
Linking non-shared library bin/libtalloc.a
Compiling ../lib/replace/replace.c
Compiling ../lib/replace/snprintf.c
Compiling ../lib/replace/getpass.c
creating /root/samba-3.4.3/source3/exports/libtalloc.syms
Linking shared library bin/libtalloc.so.1
Compiling ../lib/tdb/common/tdb.c
Compiling ../lib/tdb/common/dump.c
... etc ...

which went fine, then make install:
# make install
Using CFLAGS = -O -I. -I/root/samba-3.4.3/source3 -I/root/samba-3.4.3/source3/../lib/popt -I/root/samba-3.4.3/source3/iniparser/src -Iinclude -I./include -I. -I. -I./../lib/replace -I./../lib/talloc -I./../lib/tevent -I./../lib/tdb/include -I./libaddns -I./librpc -I./.. -DHAVE_CONFIG_H -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Iinclude -I./include -I. -I. -I./../lib/replace -I./../lib/talloc -I./../lib/tevent -I./../lib/tdb/include -I./libaddns -I./librpc -I./.. -I./../lib/popt -DLDAP_DEPRECATED -I/root/samba-3.4.3/source3/lib -I.. -I../source4 -D_SAMBA_BUILD_=3 -D_SAMBA_BUILD_=3
LIBS = -lresolv -lnsl -ldl
LDFLAGS = -Wl,-z,relro -Wl,-Bsymbolic-functions -L./bin
DYNEXP = -Wl,--export-dynamic
LDSHFLAGS = -shared -Wl,-Bsymbolic -Wl,-z,relro -Wl,-Bsymbolic-functions -L./bin
SONAMEFLAG = -Wl,-soname=
Installing bin/smbd as ///usr/sbin/smbd
Installing bin/nmbd as ///usr/sbin/nmbd
Installing bin/swat as ///usr/sbin/swat
Installing bin/winbindd as ///usr/sbin/winbindd
The binaries are installed. You may restore the old binaries (if there
were any) using the command "make revert". You may uninstall the binaries
using the command "make uninstallbin" or "make uninstall" to uninstall
binaries, man pages and shell scripts.
Installing bin/wbinfo as ///usr/bin/wbinfo
Installing bin/smbclient as ///usr/bin/smbclient
Installing bin/net as ///usr/bin/net
... etc ...

which, since I used the configure flags from the original Ubuntu distro, just installs the new version over top of the old.

Next, I tried restarting samba, but I got an error about a missing library:

# /etc/init.d/samba restart
* Stopping Samba daemons [ OK ]
* Starting Samba daemons
/usr/sbin/nmbd: error while loading shared libraries: libtalloc.so.1: cannot open shared object file: No such file or directory

You need to tell your system where to find the libraries it’s looking for. Stupid system. We just made them, but it doesn’t know where to find them. Create /etc/ld.so.conf.d/samba.conf as follows:

# echo "/etc/samba" > /etc/ld.so.conf.d/samba.conf
# ldconfig

Then you should be able to start Samba.

# /etc/init.d/samba start
* Starting Samba daemons [ OK ]

Don’t forget to copy the new samba.schema into the LDAP schema directory if you’re using LDAP.
# cp ../../examples/LDAP/samba.schema /etc/ldap/schema/samba.schema

39 replies
  1. Bryan
    Bryan says:

    Much appreciate the post Jeremy, I just needed to perform this surgery yesterday. I had a customer that needed a CIFS mount to a WIndows 2008 R2 box and good ole 2.0.28a no talky encrypted cifs logins.. I used 3.6.8 stable with no issues. I did have to remove the –with-cifsmount flag as it wasn’t recognized with that compile.

    Thanks again!

  2. louis
    louis says:

    Simon Faulkner said: 2012.01.29 07:23
    and to make is even easier…

    add the oneiric sources to your apt list.
    deb-src http://archive.ubuntu.com/ubuntu/ oneiric main restricted
    now apt-get source -t oneiric samba
    apt-get install build-essential
    apt-get build-dep samba
    apt-get source -t oneiric samba -b

  3. Simon Faulkner
    Simon Faulkner says:

    WOW! This was a BIG help – it just worked on Ubuntu 8.04.4 using Samba 3.6.2 on 2012-02-29

    Dan Shearer (Samba Team Member) suggested using

    apt-get install build-essential
    apt-get build-dep samba

    which should make sure that all the parts are pulled in ready for the build

  4. Mitan
    Mitan says:

    I am currently using Windows 7 with Ubuntu 8.04LTS and Samba 3.0.28a acting as a PDC server. Up until this morning my Windows 7 client was able to join and login to the PDC linux machine. When I came to my desk today and tried to login I had a trust relationship error. All windows XP machines on the network connect just fine to the PDC.

    I am trying to determine the best course of action. Does anyone have experience with this problem and will upgrading Samba correct the problem? I only have one windows 7 client, so if there is something I can do on the client side I wouldn’t mind that.

    Any / All of your input will be valuable. Thanks!

  5. MC
    MC says:

    I followed the instructions here to the letter. I used Yogg’s ./configure line and everything went as planned. Samba has been upgraded, as smbstatus reports “Samba version 3.4.4”.

    Prior to the upgrade, the server was set up as a pdc with doman users having roaming profiles. I’m using tdbsam as the backend. Everything was working great. After the update, samba doesn’t want to authenticate any of my domain users. I get this error for every user:

    [2010/09/10 16:57:35, 2] auth/auth.c:320(check_ntlm_password)
    check_ntlm_password: Authentication for user [vsoffice3] -> [vsoffice3] FAILED with error NT_STATUS_NO_SUCH_USER

    I tried listing the users with wbinfo -u, and it reports:
    Error looking up domain users

    What the heck happened to my users? I still see all the user and machine info in the /etc/shadow and /etc/passwd files. I’ve verified that the permissions on the user profiles are correct. None of the users can log into the domain, and none can access shares. Any thoughts?

    Here’s my smb.conf.
    workgroup = DOMAIN
    netbios name = SERVER
    server string = ADA Domain Server
    private dir = /etc/samba/private
    passdb backend = tdbsam

    …blah blah blah…

    • Jeremy
      Jeremy says:

      All of my installs use LDAP for the back end, but I wouldn’t be at all suprised if the the new installation doesn’t pick up the old tdbsam database. (Samba doesn’t use the /etc/passwd and /etc/group files directly) You probably have to import it from wherever it is/was. Google for “tdbsam import export” and you should find some clues about upgrading samba…

      • Marty Cannon
        Marty Cannon says:

        I finally ended up just readding the users to samba with:
        smbpasswd -a username

        After adding the users, I could authenticate. I did have to unjoin all machines from the domain, and rejoin them to actually get my roaming profiles working. In the end, all is well. Thanks for the writeup!

  6. csaba
    csaba says:

    do you think upgrading from ubuntu 8.04’s samba this way to samba 3.5.4 is also possible?
    I am in a school where I use samba and ldap and would like to safely upgrade to have win7 support.
    Any suggestions?

  7. Sparky007
    Sparky007 says:

    When I give command smbstatus it returns me with this. I’m not much of samba expert,but when I look into smb.conf it’s the old one, nothing to configure for LDAP.

    Samba version 3.0.28a
    PID Username Group Machine

    Service pid machine Connected at

    No locked files

    Best regards and thanks for reply.

    • Jeremy
      Jeremy says:

      Looks like you are still running the old version – 3.0.28a. Something in your compile or make install didn’t work. Or you forgot to run make install and just compiled it…

  8. Sparky007
    Sparky007 says:

    Ok, I’ve upgraded samba from 3.0.28a to 3.4.4 by these instructions. It all went without any errors. But when I look up which version is on ubuntu hardy, it gives me 3.0.28a. What can I do? Thx for reply

    • Jeremy
      Jeremy says:

      Package management apps like apt, aptitude, dpkg won’t know about the version you just compiled and installed. If you did everything correctly and the ‘make install’ worked, then you are running the new version.

      Running ‘smbstatus’ at the command line will tell you the version that’s actually installed.

  9. Matt
    Matt says:

    OK, I followed this to the letter but when I get to the make section I get “make: *** No targets specified and no makefile found. Stop.” To my knowledge the configure section was successful. I received no errors during configuration at least not that I saw. I googled this error and it means the make file is missing. When I run the DIR command there is no make file listed. Any assistance is appreciated. This is litterally my first time ever compiling a program from source.

    • Jeremy
      Jeremy says:

      Are you in the source3 directory? Can you post the output of your ‘./configure’, and a ‘pwd’, and ‘ls -al’?

      Which source package are you using? 3.4.3 or something newer?

  10. FS
    FS says:

    Did anyone get ACL working with samba after the upgrade? I can log into the domain with Windows 7, however ACL permissions are not being translated through to windows. I checked they’re working on the server. Googling was no help here.

  11. snpz
    snpz says:

    Hi there!
    Decided to upgrade my samba servers (DC (32bit) and File Server (64bit)) using this manual.
    ./configure with all includes goes well on DC. Creates makefile etc., but on File Server ./configure makes only makefile-noincludes file.
    Is there any difference between includes for 32bit and 64bit machines?

  12. Yogg
    Yogg says:

    Is this right?

    The same thing ^^

    Where have you the “./configure command” from?

    • Jeremy
      Jeremy says:

      The configure flags are from the Ubuntu 8.04 samba sources:

      # cd ~/
      # apt-get source samba
      # cat ~/samba-3.0.28a/debian/rules | less

      (I don’t have an Ubuntu system here to double-check, but the apt-get command above will put the sources in your home directory, and I’m assuming the directory name will be samba-3.0.28a. Adjust accordingly.)

      I suppose that doesn’t necessarily mean that the binary .deb that one would normally download to install samba has the same configure flags – I just posted what I used and this is how I found them…

      • Yogg
        Yogg says:

        I have now tested some options.

        This one seems to be the cleaner way. All libs are on the right place. And everything else also. If i have overseen something please correct me.

        ./configure –cache-file=./config.cache

        With this options also
        # echo “/etc/samba” > /etc/ld.so.conf.d/samba.conf
        # ldconfig
        is not necessary any more.

        The upgrade instructions work for 3.4.3, 3.4.4 and 3.4.5 (Maybe also for future versions 😉 )

        If someone use Samba with LDAP maybe you need “ldap ssl = No” in the smb.conf.

        If Winbindd uses 100% cpu time set “winbind cache time = xx” to a minimum of 1 in the smb.conf (15 is default [seconds]).

  13. Sparrowlegs
    Sparrowlegs says:

    Further update: IT WORKS!

    Am back on 3.3.4. I needed to edit my smb.conf file to stop TLS errors in LDAP:

    ldap ssl = No

    Happy man. Thanks very much for this very useful guide.


  14. Mark Twells
    Mark Twells says:

    I followed your excellent directions on two identical 9.10 machines (the 3.4.0 Samba on 9.10 seems to be broken). Both ran through with no errors. The odd thing is, 3.4.3 works beautifully on one, and on the other one fails with

    server:~$ smbclient //192.168.X.X/user
    Enter users’s password:
    Receiving SMB: Server stopped responding
    session setup failed: Call returned zero bytes (EOF)

    which is bizarre!

  15. Sparrowlegs
    Sparrowlegs says:


    Ok, I’ve upgraded and then downgraded back to 3.0.28a.

    I needed to do “sudo smbpasswd -w [LDAP_ADMIN_PASSWORD]” to get LDAP working again.

    Windows 7 machines now connect to the domain but then fail on reboot when trying to log in with “Trust Relationship Between Workstation and Domain Fails”.

    Isn’t this fun?


  16. Sparrowlegs
    Sparrowlegs says:

    I have used this to upgrade to Samba 3.3.4 as I have read that this works better with Windows 7, but have run into diffculties. The install seemed to go fine, but I’m getting:

    [2009/12/07 22:37:48, 0] lib/smbldap.c:smb_ldap_start_tls(600)
    Failed to issue the StartTLS instruction: Protocol error

    These errors. My LDAP directory seems to be intact, but I can’t join any machines to the Domain or log on.

    Any ideas?


    • Jeremy
      Jeremy says:

      Is anything else able to talk to LDAP using TLS? Can you get Samba working without TLS first? I would start from the basics and make sure everything is working, then add TLS if necessary. (If LDAP and Samba are on the same server, then it’s probably not necessary anyways – just do everything over and block the LAN/WAN…)

  17. Fabrizio
    Fabrizio says:

    An excellent article!
    Thanks a lot for posting. Just one comment based on what I ran into, which is that a C-compiler is needed (e.g., gcc). It’s obvious now, but I did not have one installed on my fileserver.

    Thanks again as it was very helpful.

    • Jeremy
      Jeremy says:

      Indeed, gcc should really be a “standard” part of a linux install – I run into the need to compile from source all the time… (linux is definitely a double-edged sword in that respect)

  18. Kurazs Iosif
    Kurazs Iosif says:

    Hi. I downloaded the source tar file, but it turned that in ./samba-3.4.3 directory, there is no configure script

    Instead there are 2 directories:

    in the ./samba-3.4.3 directory there is a file named: “howto4.txt”
    In this file there is a description on how to compile, with apears to be wrong also

    cant use autoconf.sh in the source4 directory.
    instead in the source3. Witch of course gives and error message with missing packages:
    :~/samba-3.4.3/source3$ ./autogen.sh
    ./autogen.sh: need autoconf 2.53 or later to build samba from GIT

    …. can someone try this approach ?

    I’m not in the mood to brake my server 😀
    And don’t have a spare, to experiment on.


Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply to Mario Cancel reply

Your email address will not be published. Required fields are marked *