Linux and Unix Fixes

Plank is not allowing to pin the running program to the doc

If you are not seeing the "keep in dock" option when right clicking on the icon, first make sure there is a .desktop file for your command in ~/.local/share/application
You can create it by using KDE Menu Editor for example. Then edit the file and comment out the "Path[$e]:" option

Systemsettings hungs or font sizes are incorrect or mouse cursor is huge

Check .config/kcmfonts to make sure forceFontDPI is not 0. If it is set it to 96 and also set it in .config/startupconfig

Broken text in X

For a java-based installer
Try setting java anti-aliasing
-J-Dawt.useSystemAAFontSettings=lcd
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=lcd"
Also, as a quick fix try resizing the window, forcing the text to reflow. At some (usually very small) size it may show up for you.

UXA rendering method
Try switching to the old Intel UXA method for rendering instead of newer SNA

/usr/share/X11/xorg.conf.d/20-intel-uxa.conf
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "AccelMethod" "uxa"
EndSection

Notes: noticabely slower than SNA, but can do an ok job at vertical sync without requiring full screen repaints - there are still glitches in a not full repaint mode.

Modesetting
If you are using intel driver, revert to the original modestting driver

apt remove xserver-xorg-video-intel

Confirmed that it fixed text issues in X11 forwarded java applications
/usr/share/X11/xorg.conf.d/20-intel-modesetting.conf
Section "Device"
Identifier "Intel Graphics"
Driver "modesetting"
EndSection
Note: modesetting in Ubuntu 16.04 is slightly slower than intel, and has mouse cursor blinking, even with full screen repaints for vsync
It also supports smaller overall screen resolution, e.g. cant' run 4 1980 screens side by side.

xorg.conf is missing because X uses autodetect.

To see what it autodetects run
X :1 -configure
it will create a xorg.conf.new in the current folder
The existing xorg.conf overrides autodetects

KDE wallet manager does not find gpg keys

Reconfigure your kgpg to use gpg2 not gpg and re-create keys
according to the changelog
"any change to the private keys using the new gpg will not show up when using pre-2.1 versions of GnuPG "

Troubleshooting sporadic hangups of ssh and other connections over vpn

your tunnel mtu is too high/too close your carrier network's MTU
see it:
ip a s
set it lower
sudo ip link set dev tun0 mtu 1350

What to check when a device is busy and can't be unmounted

Trivial (aka you should have already checked)


Running process
lsof /media/location
Open socket
lsof -a | grep /media/location

Convoluted (aka now you know)


NFS Server export
showmount -e
Encfs
mount | grep encfs
Device malfunction
dmesg | grep "I/O error"

Esoteric (aka you might never see it again)


Loopback device
losetup -a
Swapfile
cat /proc/swaps

Remote printer is not being discovered

If your network printer attached to a linux box and is shared, but not being found by a remote system check the following:

  • Try running avahi-discover (a DNSSD client) that shows all services visible on the network over DNSSD
  • Avahi-daemon is running on the linux box. Avahi is multicast DNS/DNS-SD service discovery server that announces shared printers
  • Your router is capable of forwarding multicast DNS between wired and wireless networks (in case your server is on a wired network and a client is wireless)
  • Your client system can take in DNSSD - UDP port 5353 allowed inbound

You can still add remote printer even if it's not being discovered by editing your /etc/cups/printers.conf and adding something like this:

<Printer HL2270DW>
UUID urn:uuid:12311230d-d123-123c-123f-123123123123
Info HL2270DW @ server
Location server
DeviceURI ipps://server.local:631/printers/HL2270DW
State Idle
Type 6
Accepting Yes
Shared No
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
Option cups-browsed true
</Printer>

The last line (Option cups-browsed true) is what tells it to grab a PPD from the server for printing. You may want to disable cups-browsed too, because it will try to delete this printer when it does not find it on the network (again, because of the last line). The printer works fine without cups-browsed because the PPD function is handled by CUPS not by cups-browsed.

Manually added remote printer is being removed by the system

cups-browsed is the culprit. Stop it from running

sudo systemctl disable cups-browsed

plasmashell hungs

There may be many reasons, but one easy fix to try is to delete .cache/plasmashellrc.lock and restart plasmashell. To find what plasmashell is doing when/before it hungs run

strace plasmashell

Changes to KDE menu are not being saved by KDE menu editor

  1. It's possible that you have multiple .desktop files describing the same application, in different folders. kmenuedit might be reading from one but saving to another.

Check .local/share/applicaitons and it's subfolders for duplicates. Check .config/menus/applications-merged. Try editing a suspect file by hand and see if changes are reflected in kmenuedit

  1. Run kmenuedit from the command line and check for errors
  2. Ensure that .local/share and .config/menus have proper ownership and access permissions

Troubleshooting KDE file indexer baloo fromerly known as nepomuk

On KDE5 Baloo is kicked off by akonadi, the personal information management (PIM) indexed from KDE. It indexes files and other stuff and allows Xapian to search/index the data.

First run the cleaner process is responsible for cleaning out invalid files from the index.

baloo_file_cleaner

To check if a file has been indexed run

balooshow ''[file'' ''name]''

To do a simple search use baloosearch [term] or, to limit it to a directory do

baloosearch -d ''[directory'' ''name]'' ''[term]''

If baloo file extractor is stuck, first check (ps aux) the process and note the numbers at the end of the command line. Kill it and the baloo_file, then launch baloo_file_extractor on any one of those numbers. You can see what file the number corresponds to by running balooshow [number]

To re-index make sure all baloo processes are stopped, delete the DB folder .local/share/baloo/file, set "first run=true" in the config file .config/baloofilerc and run

baloo_file

To go a level deeper and examine the DB you would need xapian-tools from the repo.

xapian-check .local/share/baloo/file/ - to check DB consistency
xapian-inspect .local/share/baloo/file/termlist - to walk down a specific B-tree
delve  .local/share/baloo/file/ - get db stats
dpkg -L xapian-tools - full list of tools, incuding compacting the DB, and copying it
quest -d ''[directory'' ''name]'' ''[xapian-query]'' - to get xapian none numbers matching the query string

Xapian returns node numbers. You can map then to file names by doing something like this

sqlite3 ~/.local/share/baloo/file/fileMap.sqlite3 "Select * from files where id=''[id]''"

You can also delete it's store in ~/.local/share/baloo/file and reindex everything by running

qdbus org.kde.baloo.file /indexer updateAllFolders false

More troubleshooting hints are at the official baloo debugging page

Linux does not boot after battery was depleted in a sleep state

Most likely it hibernated (suspended to disk) and is unable to load the image back correctly. Boot with the "noresume" kernel option

Global shortcuts are not saved in KDE

  • Kill plasmashell
  • Edit .kde/share/config/kglobalshortcutsrc and set the shortcuts manually
  • Restart plasmashell

Repair GRUB efi boot after OSX reinstall on MacBook Pro

Boot into a live Ubuntu distribution. First check to make sure the boot order did not change.

  • Get efibootmgr
  • Verify that the boot order is set to 0,80.

If the boot order is not the problem, reinstall grub:

sudo -s
cryptsetup luksOpen /dev/sda5 b1 (if your main disk is encrypted)
mount /dev/mapper/MainStore-rootvol /mnt
mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
chroot /mnt
mount /boot (mounts non-efi boot partition, not sure if this is necessary)
mount /dev/sda1 /mnt (real EFI boot mounted to /mnt/mnt under the non-chrooted system)
grub-install --efi-directory=/mnt /dev/sda
exit
sudo reboot

Yakuake not saving the command history

To enable real-time shared history among separate terminals. Add to .bashrc file

shopt -s histappend
PROMPT_COMMAND='history -a'

Repairing EFI Bootloader after an NVRAM reset on MacBook Pro

If you did a Command (⌘), Option, P, and R and reset all the settings, your EFI boot order was reset to the orignal mac-only boot. To change the order back to ubuntu-first, boot into a live Ubuntu distribution and get efibootmgr:

sudo apt-get install efibootmgr

Verify that the ubuntu entry got wiped from the NVRAM

sudo efibootmgr -v

If you do not see the 0 partition, labeled "ubuntu" then recreate it. If you do see it you may need to just set the proper boot order (next step) or reinstall grup (see above)

sudo efibootmgr -c -d /dev/sda -p 1 -L "Ubuntu" -l "\EFI\ubuntu\bootx64.efi"

Set it to boot first

sudo efibootmgr -o 0,80

System date is messed up, date command shows time in UTC, but KDE shows correct timezone

Chances are your localtime symlink is broken. Check by running

ll /etc/localtime

If it is, change time in KDE to what it would be on the UTC timezone, then fix the link list like this (use whatever zone is appropriate obviously):

sudo ln -sf /usr/share/zoneinfo/SystemV/PST8PDT /etc/localtime

Ubuntu login prompt showing disk check prompt at every login

If you see something like "/dev/sdb1 will be checked for errors at next reboot"

sudo rm /var/lib/update-notifier/fsck-at-reboot

Do a trace/debug on Thunderbird's IMAP, POP or SMTP connections

export NSPR_LOG_MODULES="IMAP:4"
export NSPR_LOG_FILE=~/thundertrace.log
thunderbird

Use "POP3:4" , "IMAP:4" or "SMTP:4". You can use multiple, separated by commas

Troubleshooting remote rsync ssh connection

Use the -e "ssh -vvv" key to make underlying ssh connection very very verbose and send stderr to a file with "2>..."

After refreshing/updating the MPD database some tags are not updated

MPD only updates the DB if the modification date on the file has changed. Some tag editors, like puddletag or easytag keep the original modification date. You could either force the tag editor to update the date, or remove the mpd database and have it recreate it. To recreate it do the following:

  • Stop mpd

sudo service mpd stop

  • Delete the database

sudo rm /var/lib/mpd/tag_cache

  • Update the mpd.conf file. This is important, mpd needs to think something has changed in the config as a hint to check and create the tag database

sudo touch /etc/mpd.conf

  • Start it back up

sudo service mpd start

The DB should be created automatically

GMPC downloads cover art, tags etc when you disabled everything in the UI (disable TagLib)

Even if you set the proxy it will not affect the downloading because GMPC uses LibGlyr (libtag.so) and does not call on it's glyr_opt_proxy(), which makes it fall back on the system wide proxy settings. More precisely it uses libcurl, which then uses environment variables http_proxy, ftp_proxy, all_proxy. LibGlyr also hardcodes urls and connection properties (all hail static URLs!). To disable it you would have to trick the DNS by editing your /etc/hosts file and adding the following:

127.0.0.1       musicbrainz.org
127.0.0.1       slothradio.com
127.0.0.1       jamendo.com
127.0.0.1       last.fm
127.0.0.1       ws.audioscrobbler.com
127.0.0.1       api.jamendo.com
127.0.0.1       www.slothradio.com
127.0.0.1       lyrics.wikia.com
127.0.0.1       api.discogs.com
127.0.0.1       feeds.rhapsody.com
127.0.0.1       www.rhapsody.com
127.0.0.1       www.picsearch.com
127.0.0.1       www.singerpictures.com
127.0.0.1       ecx.images-amazon.com # now this one will also break your amazon shopping

To see what exactly it tries to pull:

gmpc --debug-level 3

Note that it will still able to pull pics of google. The other option is to build a libglyr stub and put it in the place of the real one, but this is for another time. LibGlyr's code is here.

After configuring font hinting you see an error "~/.fonts.conf is deprecated"

This bug shows up in Kubuntu 12.10. Move the file to the appropriate location

mkdir -p ~/.config/fontconfig/conf.d/
mv ~/.fonts.conf ~/.config/fontconfig/conf.d/

Yakuake is not keeping track of command line history

Add

history -a

to the beginning of .bash_logout. It will force history to be saved before exiting

Dolphin is not mounting a Mac filesystem

Quick fix:

sudo modprobe hfsplus

To make it permanent add hfsplus to the end of /etc/modules

KDE printer configuration fails with "the service 'Printer Configuration' does not provide an interface 'KCModule' error

Try running it from a command line

kcmshell4 system-config-printer-kde

If you get this:

The console error from systemsettings ends with:
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 1311, in fillPrinterOptions
    ppd.markDefaults()
AttributeError: 'bool' object has no attribute 'markDefaults'

The you can fix it by installing

sudo aptitude install system-config-printer-gnome

Running

system-config-printer

Install a new printer (say PDF, if you do not have it get it as a cups-pdf package). Then set the new printer as default. When prompted say "system default" GNOME here is more robust than KDE.

NetworkManager does not start scripts

First, make sure all the files in /etc/NetworkManager/dispatcher.d are owned by root Then, run the following command and watch what happens when a network action is triggered:

sudo /usr/lib/NetworkManager/nm-dispatcher.action --debug

KDE phonon does not see audio devices

Check your System Settings -> Multimedia -> Phonon If it lists only PulseAudio you need to load a KDE module for PulseAudio (start-pulseaudio-kdm). The easies way to do it is to get the latest pulseaudio from here.

If after doing this you still do not see your devices check your modules by loading the udev module:

pactl load-module module-udev-detect

If that helped you can copy your /etc/pulsea/default.pa over to ~/.pulse (save the existing first). Restart your KDM and check if that worked.

For more help check 1

F-Spot crashes with the "Icon 'gtk-missing-image' not present in theme" message

Re-generate icon cache manually. I did it for all themes and it helped:

locate icon-theme.cache | sudo xargs rm
sudo update-icon-caches /usr/share/icons/*

Network is down after restarting a computer that was in a sleep mode

Its an annoying bug that is better be fixed in Ubuntu soon, but for now do this:

sudo service network-manager stop
sudo rm /var/lib/NetworkManager/NetworkManager.state
sudo service network-manager start

If this does not work you might have to

killall knetworkmanager
knetworkmanager &

(obviously for KDE)

AMD/ATI driver is displaying a watermark "unsupported hardware" or some other watermark

Replace the /etc/ati/control file with the one that has your software marked as supported.You could get the control file by unpacking a dpkg created by running the ati-installer in a package mode (look at the command line arguments for 'bundle'). You have to get the right one somewhere, somehow. Experiment and google.

You might have to first kill the X server since the ati driver replaces control files when it is shut down.

sudo service kdm stop

(or gdm depending on what you run)

AMD/ATI control panel settings do not survive reboot

Make sure there is only one X running. amdcccle saves it data to /etc/ati/amdpcsdb, but a ati service running in the background overwrites the db when X is restarted. amdcccle disables this "feature" of the ati's service for the X server amdcccle is running on, but not for any other server running at the same time, so the DB gets wiped out.

Same goes for manual editing/replacement of the file. Shutdown all X's first, then tweak the file.

Repair copy/paste into windows via a terminal server session (tsclient)

Sure way: on the windows machine, start control panel->admin tools->terminal services manager->expand the local box. Pick your session. Right click on your current session. Select reset. Caution: I suspect MSSQL server may have gotten killed one time I had submitted a session reset.

Quick way: On the windows machine, kill and restart 'rdpclip' process

Troubleshoot beagle indexer

Run in the foreground debug mode

beagled --fg --debug --backend Thunderbird

Look at the logs in /home/user/.beagle/Log/current-Beagle.

Can not find Python binding for LittleCMS

sudo ln -s /usr/share/python-support/python-liblcms/lcms.py /usr/lib/python2.5/site-packages/lcms.py

Apt-get complaining about a menu entry at the end

/usr/share/menu/cairo-dock: 1: Syntax error: word unexpected (expecting ")")

fixed by

sudo chmod 644 /usr/share/menu/cairo-dock


CentOS-RHEL

Being prompted for file override even with -f

when copy with force does not work you probably have

alias cp="cp -i" 

set in .bashrc
To disable it temporarily do

unalias cp

for a permanent fix comment it out in .bashrc

Is firewall active?

firewall-cmd --state

What firewall zone is active

firewall-cmd --get-active-zones

What is configured on an active zone

firewall-cmd --zone=public --list-all

Can not execute anything on a network share


remount it with the executable permissions

mount -o remount,exec /isimdata/

Strange install errors having to do with file paths


Before unpacking any IBM software make sure that the path that you are unpacking it to does not contain spaces.

@Troubleshooting @LinuxandUnix