Hardcore Linux

Anything about Ubuntu, Centos, openSuSe and Fedora

Category Archives: Configuration

Ubuntu 14.04 Hash Sum mismatch problem.

Some update and upgrade session might corrupt the metadata of the package information in Ubuntu, more known as the “Hash Sum mismatch” error after the  apt-get update command. A workaround if the simple update command doesn’t work is you need to manually clean the package metadata record being produced, here’s how:

  1. Run these series of command on your terminal:
    apt-get clean
    rm -rf /var/cache/apt/*
    rm -rf /var/lib/apt/lists/*
  2. Then check if all works out by doing another package metadata update:
    apt-get update
  3. Done.

Full information about the discussion here: (https://gitlab.com/gitlab-org/omnibus-gitlab/issues/628)



Fix for Elantech touchpad on Ubuntu 14.04

Since I recently got my new Lenovo G5070 notebook few days ago, I rush in to install second OS : Ubuntu 14.04, though installation process is tough, need to fix video card defaults, from fgrlx to intel graphics. Then another issue is wireless network RTL8723BE drops after each connection, but this article is about the touchpad: the ElanTech Touchpad, which by default not functioning well. Issues like there’s no switch off touchpad option in Ubuntu settings, multi-touch is not working, neither the scrolling.

Now to fix this issues, here’s the guide:

1. First, download the patch for the touchpad here.

2. Install dkms (if you haven’t done it yet)

sudo apt-get install dkms

3.  Go to the directory where you store the file and perform the following:

sudo dkms ldtarball psmouse-elantech-x551c.tar.gz
sudo dkms install -m psmouse -v elantech-x551c

4. Then reconfigure the driver

sudo rmmod psmouse
sudo modprobe psmouse
sudo update-initramfs -u -k all

5. Done

error: Diskfilter writes are not supported Ubuntu 14.04

After a clean install or upgrade from 12.04 to 14.04 on raid or lvm setup, normally you will encounter this error, which is related to the setup I mentioned. From various test, I encounter a workaround to fix this error.

Modify /etc/grub.d/10_linux 

Replace quick_boot=1 with quick_boot=0


Allow Standard User to connect to wifi on Ubuntu

Still using Ubuntu 12.04, and one of the problem we’ve encountered is it requires normal user to authenticated the designated admin user’s password when connecting to wireless network, which in my opinion doesn’t make sense. How can a normal user access internet over wifi if they aren’t allowed to do so?

Check what google search has to offer, I finally found a fix for this. Adding policykit rules for wifi users.

Create or modify a file  etc/polkit-1/localauthority/50-local.d/52-wifi-management.pkla

$> sudo gedit etc/polkit-1/localauthority/50-local.d/52-wifi-management.pkla

and then enter the following

[Wifi management]

and save on exit.

Add the user to the netdev group

$> sudo usermod -a -G ftp jerry

Restart the system and standard user should now be able to connect to wifi..


Ubuntu 12.04 /etc/resolv.conf implementation with dnsmasq

On the current version of Ubuntu (12.04), you might notice that the current /etc/resolv.conf file always record a nameserver which then resolv dns via dnsmasq, but most of the time after test few things, I found it more problematic. It always disregard my local DNS server, and goes directly to the DNS of my ISP.

If you’re having the same problem like mine, here’s a quickfix:

1. Modify the configuration /etc/NetworkManager/NetworkManager.conf

$> sudo gedit /etc/NetworkManager/NetworkManager.conf

2.  Comment the line that contain “dns=dnsmasq


3. Then restart the network-manager

$> sudo  service network-manager restart

4. Done



Ubuntu 11.04 Shutdown and Restart Problem with CIFS

UPDATE(07/29/2011): The GRUB thing didn’t work at all, back to basic trapping signal via upstart scripts in /etc/init/dbus.conf.  I tried it before using /etc/init/network-manager.conf but on Ubuntu 10.10, it’s not working anymore. Here’s another test and works for me.

1. Modify the current /etc/init/dbus.conf.

$> sudo vi /etc/init/dbus.conf

2. Add a pre-stop script, which looks like this:

pre-stop script
       trap "TERM signal" TERM
      /bin/umount -a -t cifs -l -f
      trap - TERM
end script 

3. Save the script and have a test.

4. Done.

UPDATE(07/28/2011): Found a better alternative via GRUB, link here. Mainly you just need to modify the  /etc/default/grub. Here’s the details:

1. Edit the /etc/default/grub

$> sudo vi /etc/default/grub

2. Add “reboot=pci” on the GRUB_CMDLINE_LINUX line, it should look something like this:

... GRUB_CMDLINE_LINUX="reboot=pci" ...

3. Update the grub

$> sudo update-grub


4. Done


It’s an ancient bug (here), which still exist in Ubuntu 11.04, or even in other distros. When you got a mounted samba shares before the shutdown or restart process, the machine waits for around 10 minutes before it complete the operation. Very troublesome that’s why I tried various workaround but none of them  works with Ubuntu 11.04. Not even the /etc/rc6.d/K*  or the upstart /etc/init configurations, nor the old python script I posted before (here’s the link).

After few considerations, I made a desperate workaround, creating a script that triggers before the /sbin/shutdown, /sbin/reboot and /sbin/restart commands.

1. Rename the current shutdown, reboot and restart commands in /sbin.

#> mv /sbin/shutdown /sbin/shutdown2
#> mv /sbin/reboot /sbin/reboot2
#> mv /sbin/restart /sbin/restart2 

2. Then create scripts with names of the previous commands in /sbin, which contains the following:

umount -t cifs -a -f -l
/sbin/shutdown2 $@
exit 0 

3. Make similar script for reboot and restart command which also points to /sbin/reboot2 and /sbin/restart2.

4.  Until the dbus implementation of stop on deconfiguring-networking comes to Ubuntu 11.04, which I think working with
Ubuntu 11.10 oneiric. I think this is the least workaround that works for me.

5. Done

passwd: Module is unknown

After modifying your workstation authentication and adds optional LDAP or KERBEROS authentication, you end up messing your pam configurations. Here’s a quick fix that works for me:

$ sudo pam-auth-update --force

I hope it works in your case too.

SAMBA PDC on Centos 5.5

This guide will help to install and configure a SAMBA Windows File Server that acts as a PDC using tbsam, Although it is suggested to have it configured with LDAP authtentication backend, many small office still cater this kind of configuration.

Here’s the details:

1. Install the Samba File Server and necessary packages.

#> yum groupinstall "Windows File Server"

2. Prepare the necessary directories needed for netlogon.

#> mkdir -p /home/samba/netlogon

3. For new users to have a directory called profile in their home directory, add a folder called “profiles” in the /etc/skel. For existing users, just add the folder “profiles” to their home directories and change the ownership to their corresponding owners.

4. Backup the existing /etc/samba/smb.conf file first before using the configuration below:

 #Server Declaration
 workgroup = MYDOMAIN
 netbios name = FILESERVER001
 server string = File Server  %v

 #Security Properties
 security = user
 domain master = yes
 preferred master = yes
 local master = yes
 domain logons = yes
 wins support = yes
 os level = 65
 name resolve order = wins bcast hosts

 #Login Configurations
 logon path = \\%L\%U\profiles
 logon drive = H:
 logon home = \\%L\%U
 logon script = logon.bat

 #User Scripts
 add group script = /usr/sbin/groupadd '%g'
 delete group script = /usr/sbin/groupdel '%g'
 add user to group script = /usr/sbin/usermod -a -G '%g' '%u'
 delete user from group script = /usr/bin/gpasswd -d '%u' '%g'
 add user script = /usr/sbin/useradd -m -G users '%u'
 add machine script = /usr/sbin/useradd -s /bin/false -d /tmp '%u'
 delete user script = /usr/sbin/userdel -r '%u'
 idmap uid = 1000 - 20000
 idmap gid = 1000 - 20000

 passdb backend = tdbsam:/etc/samba/passdb.tdb
 passwd program = /usr/bin/passwd '%u'
 passwd chat = "*Enter\snew\sUnix\spassword:*" %n\n "*retype\snew\sUnix\spassword:" %n\n. "*updated successfuly*"
 passwd chat debug = yes
 encrypt passwords = yes
 unix password sync = yes
 enable privileges = yes
 username map = /etc/samba/smbusers

 # Log File
 log file = /var/log/samba/%m.log
 log level = 3
 max log size = 50

 #Other Configurations
 printing = cups
 printcap name = cups
 show add printer wizard = No

#============================ Share Definitions ==============================

 path = /home/samba/netlogon
 admin users = root
 guest ok = yes
 browsable = no
 valid users = %U
 read only = no
 admin users = Administrator

 path = /home/%U/profiles
 create mode = 0600
 directory mode = 0700
 profile acls = Yes
 read only = No

 comment = Home Directories
 browseable = no
 writeable = yes
 valid users = %S
 create mode = 777
 directory mode = 777

 comment = All Printers
 path = /var/spool/samba
 browseable = no
 guest ok = no
 writable = no
 printable = yes

5. Modify the /etc/nsswitch.conf, your hosts line should look like this:

hosts:  files wins dns

6. Modify the /etc/samba/smbusers, the root usermap should look like this:

root = administrator Administrator admin

7.  Link SAMBA and Linux user groups, from root access, execute the following commands:

#>  net groupmap add ntgroup="Domain Admins" unixgroup=root rid=512 type=d 
#>  net groupmap add ntgroup="Domain Users"  unixgroup=users rid=513 type=d
#>  net groupmap add ntgroup="Domain Guests" unixgroup=nobody rid=514 type=d

After each commands, the system should response with the following message.

Successfully added group Domain ... to the mapping db as a domain group

8. To additional groups, perform the following:

#> groupadd <linux group>
#> net groupmap add ntgroup="<windows group>" unixgroup=<linux group> type=d

Note: the rid value should be the succeeding number of the previously entered value.

9.  Add root to the samba users, to be used in domain authentication on windows workstations.

#> smbpasswd -a root
#> smbpasswd -e root

10. Check your configurations and verify that you have entered the correct settings.

#> testparm

11.Restart the samba service, also start the winbind service it not yet running.

#> service smb restart
#> service winbind start

12. Test the Administrator access first

#> smbclient -L localhost -U
   enter the root password

12. To add new users, you can use the basic commands:

#> useradd -m -G users <username>
#> passwd <username>
#> smbpasswd -a <username>

Also note that new users and groups should be in range from 1000 to 20000, else modify the idmap declarations in /etc/samba/smb.conf.

13. Restart the samba service again, and check of the new user will be authenticated when accessing the samba shares.

$> smbclient -L localhost -U <username>
enter the <username's> password

14. Configure the windows workstation and join them to your new samba file server using the details below:

Domainname: MYDOMAIN
Administrator Account: Administrator
Password: <your root password>

15. Done.

Ubuntu 10.10: Problem with static IP address and network-manager

As of Ubuntu 10.10, I find network-manager problematic, since it alters the static IP address you’ve configured in /etc/network/interfaces.  This is even though you successfully configured the static IP address and stuff. Network-Manager still override them with and use the IP the DHCP had given.

So for now my only fix is to uninstall network-manager and packages related to it.

#> sudo apt-get purge network-manager network-manager-gnome

After this, the static IP address configured in /etc/network/interfaces will be working fine.



Installing Virt Manager for Ubuntu 10.04

After establishing my KVM host from other machine, now it’s the time you need to configure your remote kvm guest manager, if you prefer the GUI management. Here’s the quickest way to do:

  1. Execute this in the console:
    $> sudo apt-get install ubuntu-virt-mgmt
  2. After that you can now add remote KVM host and  manage your vms.
  3. Done.
%d bloggers like this: