29 September 2009

Ubuntu Server: "Setting locale failed" and a fix

Yesterday, working remotely to set up a cleanly-installed Ubuntu Jaunty server, every command that I ran would give me errors with Perl and an unset language. For example:

root@dev:/vweb# adduser htomol tracusers

perl: warning: Setting locale failed.

perl: warning: Please check that your locale settings:

LANGUAGE = (unset),

LC_ALL = (unset),

LANG = "en_US.UTF-8"

are supported and installed on your system.

perl: warning: Falling back to the standard locale ("C").

Adding user `htomol' to group `tracusers' ...

Adding user htomol to group tracusers

Done.

root@dev:/vweb#

I tried reconfiguring the locales package and a few others but no fix. The solution was to install the language pack that I wanted to use; I am not sure why this didn't happen at install time (I didn't do the installation). For English, the pack to install was 'language-pack-en' so I needed to run:

root@dev:/vweb# aptitude update

...

...

root@dev:/vweb# aptitude install language-pack-en

...

...

root@dev:/vweb#

That seemed to have fixed it; thanks goes out to the irc.Freenode.net people on #ubuntu-server, specifically the user named sub. Another example, in my eyes, of why Ubuntu is not the slick setup that everyone seems to believe that it is; I've never had this issue with Debian.

=-=-=-=-=
Powered by Bilbo Blogger

16 September 2009

CMake: How to define where to build a package

I just build Bilbo Blogger, a KDE blogging client that I have recently read about.

KDE apps now use 'cmake' instead of 'configure' when building a package from source; it seems to work about the same but it does have a different syntax. So for my own reference, and others who search for it, if you want to require a directory prefix with cmake here is the proper syntax:

shell:/home/username/package/$ mkdir build

shell:/home/username/package/$ cd build

shell:/home/username/package/build/$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local

shell:/home/username/package/build/$ make

shell:/home/username/package/build/$ sudo checkinstall

That last part allows you to create a fake, bad Debian package.deb. Its not the best package and it cannot really be shared with others (due to dependency checking mostly, I think), but it does allow it to install and run and be removed from your computer using aptitude or dpkg.

This is my first post with Bilbo, we'll see how it turns out!

=-=-=-=-=
Powered by Bilbo Blogger

14 September 2009

Access More Samba shares in KDE

In KDE's file browser Dolphin, you can view available Windows network share workgroups and computers (and anything else that uses Samba, like your own Linux computer for example) with the KIO-Slave 'smb:/'. Just as websites are data that are accessed with http:/ and file servers can be accessed with ftp:/ , so too can Samba shares be accessed with smb:/ . (Note that usually we see http://www.xyz.com/ — in true Unix fashion the protocol part is the http:/ and the path of the remote server is /www.xyz.com/ )

For example, opening Dolphin we see our own files in /home/username/ as this image show:



Entering smb:/ into our address bar we get:


But what if you know there are other workgroups out there, such as MSHOME or OFFICE? We have two options. You can either enter the protocol and path such as smb://mshome/ (the name of a specific workgroup), or you can edit the file /etc/samba/smb.conf to not put yourself into any workgroup.

If we go with this second route and edit /etc/samba/smb.conf and change our workgroup from whatever we have now, to a * , we can suddenly see many more workgroups!

First, edit our file and replace "workgroup = workgroup" and make it read "workgroup = *" as we see here:




Then, restart Samba networking (note, we cannot share files with the Samba protocol without being in a workgroup!); on Debian we restart it like this (or a reboot, or I am sure there is a graphical way to do this also)


Notice that smbd failed to restart, because we're not in a workgroup.

Now, with Dolphin's address bar of smb:/ we can see all of the workgroups in our local network!


Enjoy your newfound access to network shares!