News:

Forum recently upgraded to 2.1.4. Please report any problems.

Main Menu

Alternatives to windoze

Started by zero, January 17, 2014, 11:51:48 PM

Previous topic - Next topic

zero

A problem I've had since 14.04 and now 16.04 is slow response in Synaptic quick search. The problem surfaces when update-apt-xapian-index runs and chews up 100% of one processor thread while it completely rebuilds the index database. Some people have disabled xapian-index altogether but that also cripples the quick search. A more elegant solution was found here... http://www.sapnwnewbie.com/2010/11/high-cpu-usage-by-update-apt-xapi.html  I've copied it below just in case that page ever goes away. This causes the index to update rather than rebuild from scratch every time.

This process is responsible for maintaining an index of packages to speed up search on Synaptic and is scheduled as a cron job (/etc/cron.weekly).

This is the cron job, triggering the process:

#!/bin/sh

CMD=/usr/sbin/update-apt-xapian-index
IONICE=/usr/bin/ionice

# Rebuild the index
if [ -x $CMD ]
then
if [ -x $IONICE ]
then
  nice $IONICE -c3 $CMD --quiet
else
  nice $CMD --quiet
fi
fi


Edit the lines to show the following:

#!/bin/sh

CMD=/usr/sbin/update-apt-xapian-index
IONICE=/usr/bin/ionice

# Rebuild the index
if [ -x $CMD ]
then
if [ -x $IONICE ]
then
  nice -n 19 $IONICE -c 3 $CMD --update --quiet
else
  nice -n 19 $CMD --update --quiet
fi
fi


The modification will help reduce CPU usage. -n 19 option (you may already have this) gives least favorable scheduling priority. --update option causes the process to update the index instead of rebuilding it every time.

zero

#16
Here's another tip for Ubuntu, Xubuntu, Lubuntu 14.04, 14.10, 15.04, 15.10, 16.04 and possibly 16.10 laptop users.

Problem: Touchpad so sensitive to touch it's almost unusable. It's way too sensitive.
Cause: Default xinput settings are not based on any real world logic.
Solution: Modify xinput settings.

This problem has plagued me for years and for years my only solution has been to use an external mouse! Here's how to fix that. Open a terminal window. Enter...
xinput --list

It should look something like this...
:~$ xinput --list
⎡ Virtual core pointer                    id=2 [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              id=4 [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad              id=14 [slave  pointer  (2)]
⎣ Virtual core keyboard                    id=3 [master keyboard (2)]
    ↳ Virtual core XTEST keyboard              id=5 [slave  keyboard (3)]
    ↳ Power Button                            id=6 [slave  keyboard (3)]
    ↳ Video Bus                                id=7 [slave  keyboard (3)]
    ↳ Video Bus                                id=8 [slave  keyboard (3)]
    ↳ Power Button                            id=9 [slave  keyboard (3)]
    ↳ Sleep Button                            id=10 [slave  keyboard (3)]
    ↳ USB2.0 UVC VGA WebCam                    id=11 [slave  keyboard (3)]
    ↳ Eee PC WMI hotkeys                      id=12 [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            id=13 [slave  keyboard (3)]
:~$


My touchpad is the line that says...
SynPS/2 Synaptics TouchPad              id=14 [slave  pointer  (2)]

To see a complete list of your current xinput settings, enter...
xinput --list-props "full device name or ID"

Notice, you can define your device by NAME or by ID. However, I find that the ID number sometimes changes, whereas the name itself never changes. So, to make absolutely certain you define the correct device every time, on the command line here's the command I enter to change the sensitivity...
xinput --set-prop "SynPS/2 Synaptics TouchPad" "Synaptics Finger" 55 60 0

The numbers correspond to touch low (the pressure it releases at), touch high (the pressure it engages at) and press (only for trackpoint emulation so leave that at 0). The default values are something ridiculously low like 12 15 0, so basically just getting your fingertip close enough to move air near the touchpad causes the pointer to move. Leave the third number at 0 and play with the first two. The difference between the first two is for hysteresis. I like  a difference of 5. My wife's Dell 6520 is set to 107 112 0 for roughly the same sensitivity as my Asus 1215n at 55 60 0. My newest Asus Zenbook UX32VD uses 25 30 0. So as you can see, there's a wide spread of values depending on the make and model of your laptop. The full command line for my new UX32VD laptop is

xinput --set-prop "ETPS/2 Elantech Touchpad" "Synaptics Finger" 25 30 0

Once you're happy with the settings, it's time to make them persist between sessions. In your home directory, find the file named ".xsessionrc". If it does not exist, create a new one using mousepad, leafpad, gedit, vi, nano, what ever plain text editor you have and prefer. Now just paste your entire command line into this file and save. That's it! Every time you log in, your settings are restored.

Some people have expressed that this solution does not work if you've disconnected & reconnected (unplugged, replugged) a device. Their problem is likely related to the ID # changing upon reconnect. I tried to post my explanation of using the device name rather than ID at StackExchange (AskUbuntu) but it's very difficult to earn enough reputation points there to post anything at all!

I hope you find this tip useful. I cannot tell you how pleasant it is now to use my touchpad again.

zero

Problem: Synaptic fails with "W: Can't drop privileges for downloading as file '/root/.synaptic/tmp//tmp_sh' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)"

Solution that works and is safe at https://bugs.launchpad.net/ubuntu/+source/aptitude/+bug/1543280

QuoteChristian Mertes (cmertes) wrote on 2016-09-11:   #20
Thanks for this nice workaround, John, but I would strongly suggest not to execute that first line. If you have already, set the permissions back to 755. Instead, the better way to fix this permission problem is the following line:

sudo chown _apt /var/lib/update-notifier/package-data-downloads/partial/

May I at this point also say that the continued existence of this trivial bug is a disgrace and a reason for me to question if there are structural problems within the core Ubuntu development community that may easily lead to more serious problems.

I totally agree with Christian's sentiments here. Very disappointed that this bug has affected so many for so long and still has not been addressed.