Log In | Users | Register
All about IT at IAC
spacer
Edit | Attach | New | Raw | Delete | History | Diff | Print | Pdf | | Tools
You are here: IT » LinuxFAQ

FAQ - Hints & Tricks for Linux Users



General

Which application should I use to do XYZ?

  • The following list gives an overview of some Linux applications and their purpose MOVED TO... LinuxApplications

How can I convert file X into file Y?

  • See this document for some examples about converting and manipulating files in Linux MOVED TO... LinuxConvertFiles

My computer is so slow. What can I do?

There could be several reason why your PC gets slow. Please try the following

  • Execute in Konsole the command top. See if a process is using all your resources (%CPU, %MEM)
  • top -i will show you only the main running processes
  • The load average in top should be below the amount of CPUs you have. In top press 1 to see the amount of CPUs
  • If your PC starts to swap (all physical memory is used) it will be very slow. If you see in top processes called kswapd0, kswapd1 using a lot of CPU, your PC is swapping. Stop the program using a lot of memory.
  • KDE Desktop effects can make your PC slow. Try to disable KDE Desktop effects: From the KDE menu choose Configure Desktop. Choose from Look & Feel MOVED TO... Desktop MOVED TO... Desktop Effects and uncheck the box Enable desktop effects
  • Scrolling in firefox can be very slow. See here for a workaround
  • Acroread does not react for several seconds. See here for a workaround




Login/Logout

I can no longer login to a Linux system

  • In case you work on a IAC Linux PC, check if the PC is connected to the network. The blue LAN cable should be attached to the back of your PC and the interface should blink. The other side of the LAN cable has to be connected to a UTP plug.
  • You have exceeded your diskquota. Try to login over ssh and delete files.
  • Or press at the login screen CTRL+ALT+F1 and login to the text console. CTRL+ALT+F7 will bring you back to the login screen again.
  • /tmp is 100% used. Try to login over ssh and delete files in /tmp.
  • Your KDE settings are screwed up. Try to clean up your KDE settings - note that all KDE settings are lost. However sometimes it's enough to clean up your plasem desktop settings with
    rm -rf ~/.local/share/kactivitymanagerd   # try this first
    rm -f ~/.config/kglobalshortcutsrc.lock
    rm -rf ~/.config/plasma-*                 # try this, if the above doesn't help
    
  • You forgot your password. The administrator can set a new password.
  • Your account was disabled. Ask the administrator to enable it again.
  • If you are using tcsh the .history file could be the problem. On a IAC Deskto press CTRL+ALT+F1. Login with username and password, when the login procedure gets stuck, press CTR+C. You should be logged in. Remove ~/.history. Press CTRL+ALT+F7 and login.

  • For example to print the size of your folders in the home directory type:
    du -hd1 ~
    du -d1  ~ | sort -n
    

  • Quite often your Trash which is under $HOME/.local/share/Trash fills up the whole disk space. Don't forget to delete your trash from time to time.

I can no longer logout from KDE

  • Try to logout with the following command:
    kde-logout
    
    or
    kde-logout -n    # -n: logout without confirmation (now)
    
  • An other possibility is pressing CTRL+ALT+Backspace twice. This will kill the x-server and the login screen should appear.

I can no longer shutdown/reboot my PC

  • It's possible to poweroff or restart your PC from the command line by typing
    poweroff
    reboot
    

I can no longer unlock the screensaver

  • It's possible that the screensaver is hanging and using 100% CPU. Press ALT+CTRL+F1 to get to a text terminal. Login with your username and password. Run "top" to see if kscreensaver_g is using 100% CPU. Terminate the screensaver with
    kill 9 "PID"
    # or
    pkill -9 kscreenlocker_g
    
    Press ALT+CTRL+F7 to get back to your graphical session.




SSH and SCP

How can I login over ssh without typing my password?

  • Use SSH Key Based Authentication with empty passphrase in order to login over ssh or scp without password.

  • First, you need to create an RSA key pair on your computer (if you don't already have one):
    ssh-keygen -t rsa
    
    You might need to enter a location to save it. Just use the default path. On Linux it will be somewhere like $HOME/.ssh/id_rsa and for Mac somewhere like /Users/username/.ssh/id_rsa.

    You will also be asked if you want to use a passphrase. If you leave it blank (just press enter), no password will be required for login.

  • Then copy the key to remote system:
    ssh-copy-id user@remotehost.somewhere.ch 
    
    And you will need to enter your password (for the last time!).

  • Check that you can execute commands on the remote host via ssh without password, for example with:
    ssh remotehost.somewhere.ch date
    

  • ALERT! IMPORTANT: Keep secret your private key ~/.ssh/id_rsa and the file ~/.ssh/authorized_keys. Make sure that they are only readable and writable for you. Be aware that anybody who has a physical access to your machine may be able to get these files. If you think that somebody has stolen your private key. Remove all entries of this key from your ~/.ssh/authorized_keys2 files and recreate a new ssh key pair as described above.

  • New Linux distribution expect to find the keys in ~/.ssh/authorized_keys instead of ~/.ssh/authorized_keys2. An easy solution is to link your ~/.ssh/authorized_keys2 to ~/.ssh/authorized_keys in order to keep both files the same.

How to disable ksshaskpass

  • bash users add to your profile ~/.bashrc
    # disable ksshaskpass
    export SSH_ASKPASS=""
    
  • tcsh users add to your profile ~/.cshrc
    # disable ksshaskpass
    setenv SSH_ASKPASS ""
    

Secure copy (scp) does not work

  • First try, whether you can login to the remote system with ssh.
  • If you are using bash, scp will not work as long as your ~/.bashrc generates ANY output. Redirect all output to >/dev/null 2>&1 in ~/.bashrc
  • If you are using tcsh, scp will not work as long as your ~/.cshrc generates ANY output. Redirect all output to >&/dev/null in ~/.cshrc. For example
    source /usr/local/userenv/init_ncl50.csh >&/dev/null
    source /usr/local/userenv/init_pgi.csh  >&/dev/null
    
  • See also http://www.openssh.com/faq.html#2.9

I get "timeout in locking authority file .Xauthority"

  • Log in over ssh gives the following message and starting any graphical program fails
    /usr/bin/xauth:  timeout in locking authority file /home/username/.Xauthority
    
  • Remove .Xauthority-c and .Xauthority-l files and try it again
    rm -f ~/.Xauthority-c ~/Xauthority-l
    

When I open a X application over ssh, I get "Error: Can't open display:"

  • The error means that X11 forwarding is disabled or does not work
  • In case you use ssh between IAC Linux systems, X11 forwarding is enabled per default. If you get the above error, please contact iac-it@env.ethz.ch
  • If you login from an other Linux or Mac System, enable X11 forwarding with the ssh option -X or -X -Y. For example
    ssh -X    username@fog.ethz.ch
    ssh -X -Y username@fog.ethz.ch
    
  • For faster X11 forwarding you can try to enable ssh compression with -C option:
    ssh -X -C username@fog.ethz.ch
    

When starting a application over ssh, I get "No DBUS session-bus found"

  • After ssh login run
    export $(dbus-launch)
    
    Please note, this only works for bash shell users,

How can I mount my home directory outside of IAC?

  • First you need to create an empty directory to be used as mount point.
    mkdir ${HOME}/ethz_home
    
  • Then you can use sshfs as following:
    sshfs username@fog.ethz.ch: ${HOME}/ethz_home
    
  • To unmount the directory:
    fusermount -u ${HOME}/ethz_name
    

How can I mount directories that are located behind a remote machine?

At CSCS only the ela.cscs.ch machine is exposed to the internet. Therefore one has to always log in first to that machine, before jumping to daint using (ssh daint). Directories such as /scratch and /project are not mounted on ela.cscs.ch which makes accessing those cumbersome, in particular using file explorers (e.g., Nautilus, Dolphin). However, one can configure ssh to use a jumphost (here: ela.cscs.ch).

To this end put the following in .ssh/config:

Host daint
  HostName daint
  ForwardX11Trusted yes
  ProxyJump USERNAME@ela.cscs.ch
  User USERNAME

You can then log in directly to daint with ssh daint and mount the filesystem in your favourite file explorer using sftp://USERNAME@daint.

More info about SSH and keys can be found here.




Shell

I get "Argument list too long". What can I do?

  • The "Argument list too long" error occurs anytime you feed too many arguments to a single shell command, like ls *, rm *, etc. Below are some suggestions how to work around this problem.
  • Manually split the command line arguments into smaller bunches. For example
    ls [a-m]*
    ls [n-z]*
    
  • Use the find command. For example
    find . -name '*' -exec ls {} \;
    
  • Use xargs. For example
    find . -name '*' | xargs ls
    
  • For example to delete all netcdf files in a directory you can run
    find . -maxdepth 1 -type f -name '*.nc' -exec rm -f {} \;
    
  • -type f find only files (f)
  • -maxdepth 1 do not descend into subdirectories
  • {} is replaced by the current file name found by find

How can I keep running a program in the background?

My console is dead. What can I do?

  • Try to press CTRL+Q.
  • If you use Konsole from KDE and press CTRL+S by mistake, the Konsole will be suspended and looks like completely dead. CTRL+Q will resume the Konsole.




Disk quota

How can I list the quota of my home directory?

  • You can use the command df or quota
    df -h ~/
    quota -s
    

How can I find folders using more than 1 MB disk space in my home directory?

  • The following command will print the size (du -hs) of your folders and files (first level = -maxdepth 1) in your home directory ($HOME) excluding folders and files which have only some KB of size (grep -v [0-9]K):
    find $HOME -maxdepth 1 -exec du -hs {} \;  | grep -v "[0-9]K"
    

How can I empty the trash manually?

  • When the trash reaches its maximum size, the error message 'Cleanup the trash manually' will appear. Empty the trash in:
    cd ~/.local/share/Trash
    

How can I find out the amount of free disk space in a folder?

  • Change to the folder and run the command df
    cd folder
    df -h .
    

Is there a way to display the file size in a folder graphically?

  • Start konqueror, browse the the folder or type as Location file:/parth/to/your/folder. In the konqueror menu choose MOVED TO... View MOVED TO... View Mode MOVED TO... File Size View. Please be patient depending on the folder size building up the File Size View can take some time.




Emacs

Do not show the start-up screen of emacs

  • Add the following lines to your ~/.emacs or ~/.gnu_emacs file:
    ;; Do not show the start-up screen
    (setq inhibit-splash-screen t) 
    

AUCTeX error message problem

  • If you use AUCTeX to write LaTeX, and upon compilation an error is detected, you are supposed to press C-` to get the error message. If instead of the error message you get ""Error after last TeX File closed", you can fix the problem by inserting into your ~/.emacs
    ; Fix calling convention so AUCTeX reports errors
    (setq LaTeX-command-style '(("" "%(PDF)%(latex) -file-line-error %S%(PDFout)")))
    

Emacs looks different?

  • In openSUSE there are different emacs styles available (emacs-x11, emacs-gtk, emacs-nox). To get X11 styled emacs type
    emacs-x11
    

Pressing the down arrow key moves cursor to the next line as seen on the screen, but not to end of line




Chrome

Chromium does not start up when executing on a remote machine over ssh




Firefox

Firefox is hanging for several seconds. What can I do?

  • Firefox seems to have problems when the profile is stored in your home folder, because your home folder is mounted over NFS v3.
  • WORKAROUND: Move ~/.mozilla to the local disk /lhome
    1. Quit Firefox !
    2. Move /home/$USER/.mozilla to /lhome/$USER/.mozilla
      mv /home/$USER/.mozilla /lhome/$USER/
      
    3. Link /home/$USER/.mozilla to /lhome/$USER/.mozilla
      ln -s /lhome/$USER/.mozilla /home/$USER/
      
    4. Start Firefox
  • Drawback: Since /lhome/$USER/.mozilla is stored locally on your PC. You can no longer start Firefox on another system with your default profile. More information about Firefox profiles
  • Note: /lhome is backed up daily to /backup. More information about Linux Backup

Firefox does not start. What can I do?

  • Remove the lock files lock and .parentlock in your firefox profile. For example run the following commands:
    find ~/.mozilla/firefox -name lock -exec rm -f {} \;
    find ~/.mozilla/firefox -name .parentlock -exec rm -f {} \;
    

  • Or just running the command
    firefox-unlock
    
    will do the same for you.

Public folders are empty in ETH Web Mail

My firefox is screwed up completely. What can I do?

  • First try to refresh firefox: https://support.mozilla.org/en-US/kb/refresh-firefox-reset-add-ons-and-settings
  • In case this does not help quit firefox !
  • If needed try to safe some settings, see https://support.mozilla.org/en-US/kb/recovering-important-data-from-an-old-profile
  • Now (re-)move your broken firefox profile.
    cd  ~/.mozilla
    rm -rf firefox
    # or instead of delete, just move
    mv firefox firefox.bak
    
    If you start firefox now, a fresh firefox profile will be created and all your settings (bookmarks, plugins) are lost.
  • In order to keep your firefox settings, copy from the backup an older and working firefox profile into the ~/.mozilla folder before starting firefox.
  • In case your .mozilla folder is on /lhome
    cd /backup
    cd "date-and-time-of-last-working-version"
    cd  $USER/.mozilla
    cp -a firefox ~/.mozilla/
    
  • In case your mozilla folder is on /home
    cd /home/.snapshot
    cd "date-and-time-of-last-working-version"
    cd  $USER/.mozilla
    cp -a firefox ~/.mozilla/
    
  • Start firefox again.

I miss the icons in the search box (search bar)

Firefox version >= 34 comes with an new Search interface, if you don't like it, you can it turn off:

  1. Open Firefox and type about:config in the addressbar and press enter. It'll confirm, click on I'll be careful, I promise! button.
  2. Now type oneoff in the Filter box and look for following boolean key: browser.search.showOneOffButtons
  3. The entry browser.search.showOneOffButtons should be set to true. Double-click on it or right-click on it and select Toggle. It'll set its value to false.

My firefox is slow and does not work as expected. What can I do?

Clicking on an email link in Firefox does not open Thunderbird and leaves the recipient blank

  • In Firefox MOVED TO... Edit MOVED TO... Preferences
  • Select the tab Applications
  • As Content type select mailto. As action selecte use other...
  • Type in /usr/bin/thunderbird -compose %u MOVED TO... OK MOVED TO... OK

I see reversed colors (blue people) and artifacts of flash animations all over the screen

  • Try to unset hardware optimization flag for the flash player. Right-clicking on the video and remove that flag

I see the message "The bookmarks and history system will not be functional because one of Firefox's files is in use by another application. ..."

  • In most cases this means that the file places.sqlite of your firefox profile is damaged after a firefox crash
  • In this case many firefox functions will not work, like Toolbar buttons such as Back/Forward are disabled
  • The database file places.sqlite stores your bookmarks and history
  • places.sqlite is stored in your firefox profile folder,
    cd ~/.mozilla/firefox
    cd 6ie8g6li.default      ### your profile will have an other random name in front of .default !!
    
  • You can restore places.sqlite and places.sqlite-journal files from your backup. See the above FAQ for more info. I
  • In case this does not help, quit firefox, remove places.sqlite, start firefox again.

How do I run multiple sessions of Firefox?

  • Firefox does not allow two instances with the same user running in different sessions. If you should need it, you must run it with the command:
    firefox -no-remote -P
    
    otherwise you'll have the error "Firefox is already running, but is not responding. To open a new window, you must first close the existing firefox process, or restart your system".

How can I remove the "start new session" when opening firefox? I always want it to start a new session.

  • Type about:config in the Location Bar
  • Press Enter
  • Scroll down to find the line:
    browser.sessionstore.resume_from_crash
    
  • Double click (or right-click and select toggle) to set it to false

How to synchronize bookmarks between different computers?

  • Firefox can now natively sync bookmarks and other components.
  • Go to Preferences MOVED TO... Sync and create a firefox account.
  • Select what you want to synchronize.

How to restore firefox bookmarks?

  • The firefox bookmarks are stored in the files places.sqlite and places.sqlite-journal
  • These files are inside your firefox profile folder under ~/.mozilla/firefox/"anything".default. Where "anything" is a random string like cj3cdqk4.
  • Restore places.sqlite and places.sqlite-journal from the backup

Scrolling in Firefox is very slow

In firefox type as URL about:config. As Filter type general.smoothScroll and the Value to false with a double click.




Thunderbird

I don't see all my folders in Thunderbird. What can I do?

  • In case you create a folder outside of Thunderbird, for example in Webmail, on your iPhone, or in Outlook, Thunderbird will not see this folder automatically. You have to subscribe to this folder. Right click on mail account name in Folder Pane and select Subscribe.... A new window should open showing a list of folders. Select the folders you want to see in Thunderbird and click on 'Subscribe' and afterward click on OK.
  • The same happens if you delete/rename a folder outside of Thunderbird. You may have to Unsubscribe first, in order to get ride of the "grayish" folder in Thunderbird.

How to set the default web browser in Thunderbird?

  • In Thunderbird go to MOVED TO... Edit MOVED TO... Preferences MOVED TO... Advanced MOVED TO... General MOVED TO... Config Editor. As Filter type the following and set them to true by double clicking.
    Network.protocol-handler.warn-external.ftp
    Network.protocol-handler.warn-external.http
    Network.protocol-handler.warn-external.https
    
  • If you now press on a link, Thunderbird will ask to choose an application. For example for Firefox set /usr/bin/firefox.
  • Don't forget to select Remeber my choice for ...

Thunderbird does not startup. What can I do?

  • Remove the lock files lock and .parentlock in your thunderbird profile by running the command
    thunderbird-unlock
    

Thunderbird and Firefox are missing scroll arrows

  • Lack of the scroll arrows buttons is apparently a Gnome/GTK3 theming feature. Add the following lines to your ~/.config/gtk-3.0/gtk.css should bring them back:
    *{
     -GtkScrollbar-has-backward-stepper: 1;
     -GtkScrollbar-has-forward-stepper: 1;
     -GtkScrollbar-has-secondary-backward-stepper: 1;
    }
    

How can I use my ETH exchange calendar in Thunderbird?

  • Install the following add-ons in Thunderbird MOVED TO... Tools MOVED TO... Add-ons MOVED TO... Search for the add-on
  • After the add-ons are installed, we can start to configure TbSync for synchronize with Exchange
  • In Thunderbird MOVED TO... Tools MOVED TO... Add-on Preferences MOVED TO... TbSync
  • Click on Account actions MOVED TO... Add new account MOVED TO... Exchange ActiveSync MOVED TO... Custom Configuration
  • Fill out
    • Account name: can be any name, for example ETH
    • User name (email address): your_eth_username@ethz.ch
    • Password: your ETH password (LDAP)
    • Server address: mail.ethz.ch
    • Click on Add account
  • Enable the synchronization status for the account by enabling Enable and synchronize this account and choose the Available resources for the Calendars. You may also choose to synchronize your Tasks and Contacts too.
  • Set a Periodic synchronization (for example 5 minutes) and click on Synchronize now
  • Finally close the TbSync account manager window

Thunderbird does not open links

  • Search for your preference file prefs.js in your thunderbird profile folder:
    find ~/.thunderbird -name prefs.js
    

  • Add the following lines in prefs.js to open links with firefox:
    user_pref("network.protocol-handler.app.http","/usr/bin/firefox");
    user_pref("network.protocol-handler.app.https","/usr/bin/firefox");
    user_pref("network.protocol-handler.app.ftp","/usr/bin/firefox");
    

Thunderbird is filling up my home directory. What can I do?

  • Per default Thunderbird 3.x downloads all emails to your local ~/.thunderbird folder. Since your emails are stored on the ETH mailserver this behavior is not needed and it is a waste of diskspace in your home directory.
  • See here how to disable this feature: ThunderbirdConfigure

Is there a way to force Thunderbird to look inside all subscribed folders for new mail?

  • In Thunderbird go to MOVED TO... Edit MOVED TO... Preferences MOVED TO... Advanced MOVED TO... General tab MOVED TO... Config Editor...
  • Choose as Filter: imap
  • Now double click on mail.check_all_imap_folders_for_new to set it to true.

Thunderbird downloads attachments only partially. The result are corrupt attachments like damaged PDFs.

  • In Thunderbird go to MOVED TO... Edit MOVED TO... Preferences MOVED TO... Advanced MOVED TO... General tab MOVED TO... Config Editor...
  • Choose as filter: by_chunks
  • Double click on mail.imap.fetch_by_chunks (only Thunderbird <= 2.x) and mail.server.default.fetch_by_chunks to set them to false.
  • In addition, choose as filter: literal
  • Double click on mail.imap.use_literal_plus to set it to false.

Usually Thunderbird downloads attachments "in chunks", but to do it it's necessary that the mail server reports their right size. Sometimes servers don't support this feature properly which can lead to corrupt attachments.

I don't see all my mail folders in Thunderbird

  • Right click on Inbox and choose Subscribe...
  • Mark the mail folders you want to see inside thunderbird and press Subscribe / OK

I use Thunderbird 3.x and want to have some Thunderbird 2.x functionality back

I would like that Thunderbird shows me the number of unread messages in the system tray?




Latex

Missing style files

  • The latex installation is split into over 4'500 different packages. We only have installed 1'000 of them. In case you miss a latex style file, please let us (iac-it@env.ethz.ch) know.

How to add subfolders to TEXINPUTS?

  • If you want to add specific files like bib-styles and so on open ~/.bashrc and add the following
    export TEXINPUTS=/Dir_1/Dir_2/Latex_Stuff//:
    
    The two // at the end allow a recursive search in the directory, i.e., it checks also subfolders. Or for ~/.cshrc:
    setenv TEXINPUTS /Dir_1/Dir_2/Latex_Stuff//:
    

My Latex installation seems to be broken

  • Revise your TEXINPUTS and BSTINPUTS variables.
    echo $TEXINPUTS
    echo $BSTINPUTS
    
  • Unless you have a special reason unset these variables per default in your shell profile files (tcsh: ~/.cshrc; bash: ~/.bashrc)

AUCTeX error messages problem

If you use AUCTeX to write LaTeX, and upon compilation an error is detected, you are supposed to press C-` to get the error message. If instead of the error message you get ""Error after last TeX File closed", you can fix the problem by insert into your ~/.emacs

; Fix calling convention so AUCTeX reports errors
(setq LaTeX-command-style '(("" "%(PDF)%(latex) -file-line-error %S%(PDFout)")))




Acrobat-Reader

Acroread is slow or hangs several seconds

Try the following
  • bash users add to ~/.bashrc the line
    export ACRO_DISABLE_FONT_CONFIG=1
    
  • tcsh user add to ~/.cshrc the line
    setenv ACRO_DISABLE_FONT_CONFIG 1
    
  • Logout/login to make the change fully active
  • Also try to remove your acroread settings
    /bin/rm -rf $HOME/.adobe/Acrobat
    

Printer settings don't change according to printer dialog fields

You need to reinitialize your acroread settings:
  • Quit acroread
  • Remove your settings
    /bin/rm -rf $HOME/.adobe/Acrobat
    
  • Start acroread

Printing from acroread does not work. I get "The document could not be printed."

  • According to Adobe support, the problem could be due to "a PDF file containing damaged content such as images or fonts that cannot be rendered by Acrobat during the printing process".
  • As workaround open the PDF file with kpdf and print it as PDF. In the printer dialog choose as Print to File (PDF). Save the output file under a different name.
  • Now open this new PDF file with acroread and try printing again.
  • Alternatively, use a other program to print the pdf file, like kpdf, kghostview, evince, okular.

Acroread is crashing all the time. What can I do?

  • Try to clean up all your adobe settings
    mv $HOME/.adobe $HOME/_adobe.bak
    # or
    rm -rf $HOME/.adobe
    
  • If you have in addition a folder ~/.acrobat remove it
    rm -rf $HOME/.acrobat
    
  • Since acroread seems to be quite unstable use an other PDF viewer like kpdf, kghostview, xpdf, evince, okular. See also MOVED TO... LinuxApplications#Document_Viewer




LibreOffice (aka OpenOffice)

How to set A4 page size as default?

  • The default locale setting of in Libreoffice is set to English (USA).
  • In order to change the default page size from Letter to A4. Set the locale setting for example to English (UK) or German (Switzerland)
  • The locale setting influences settings for numbering and units of measure.
  • Go to MOVED TO... Tools MOVED TO... Options MOVED TO... Language Settings MOVED TO... Languages. Set Local setting for example to German (Switzerland)

    Screenshot_LibreOffice.png

How to repair a corrupt .DOCX file?

  • Unzip the .docx file in a temporary directory:
    mkdir temp
    unzip broken.docx -d temp
    
  • Assuming the XML error is near line 2, column 30441, open the file word/document.xml in emacs at this position:
    emacs -nw +2:30411 temp/word/document.xml
    
  • Emacs should color XML errors in red. Correct the error.
  • Remove any emacs backup files (*~), for example
    rm temp/word/document.xml~
    
  • Pack all files again in a DOCX File:
    cd temp
    zip -r ../fixed.docx *
    
  • Open the fixed file in LibreOffice - Good luck!
    oowriter ../fixed.docx
    

LibreOffice/OpenOffice is crashing all the time or does no longer start up. What can I do?

  • Try to clean up all your OpenOffice settings
    mv $HOME/.ooo-2.0      $HOME/_ooo-2.0
    mv $HOME/.ooo3         $HOME/_ooo3
    mv $HOME/.libreoffice  $HOME/_libreoffice
    

Impress is very slow. What can I do?

  • Do not insert graphics as eps. Use jpg or png instead
  • Disable Font Anti-Aliasing: MOVED TO... Tools MOVED TO... Options MOVED TO... LibreOffice MOVED TO... View MOVED TO... untick Use Anti-Aliasing




Matlab

Matlab is crashing or does not work

Matlab fonts are huge in the command window

Open the Preference window using the Preferences menu. There is a Fonts item in the Preferences that will let you customize the fonts used in each of the Desktop tools and the main font settings. Change all fonts from "Desktop code" to Custom. Choose for example Droid Sans Mono




Sound

How do I turn off that annoying system beep?

  • In a shell, type
    xset b off
    
    and enjoy the silence.

  • In order to disable the system beep permanently add to your shell profile ~/.bashrc (for bash) or ~/.cshrc (for tcsh) the line
    xset b off >&/dev/null
    

Sound is not working. What can I do?

  • Click on the loudspeaker icon found in the panel/system tray. Or from a console run the command
    kmix 
    

  • Sometimes the KDE tool kmix is not working properly. In this case try to configure the sound with the GNOME command:
    pavucontrol
    

  • Check if all channels are enabled (the button at the top should be light green). Set all channels to maximum and try to play a test sound. Warning: This can be very load.
    speaker-test -c2 -l5 -twav
    
    If you hear a sound, adjust the level of the channels.

  • In case you don't hear anything, either your sound card is not configured correctly or your sound card is not supported by the Linux installation. Contact your system administrator MOVED TO... GettingHelp




KDE

KDE or the KDE menu bar is hanging what can I do?

  • In case the Task Manager or the KDE Menu is hanging, try to restart plasma. In a console (or press ALT+F2) type
    killall plasmashell
    kstart5 plasmashell
    
  • Kill your session by pressing twice CTRL+ALT+BACKSPACE. IMPORTANT: In contrast to the above commands, all unsaved data will be lost!
  • If nothing works, you have to reboot your PC. Press ALT+F2) type
    reboot
    

KDE menu does no longer show any applications and/or clicking on a file does not open any application

  • Try to rebuild the KDE configuration cache
    rm -rf ~/.config/menus
    kbuildsycoca5 --noincremental
    

  • Re-install KDE Application menu widgets

How to change the keyboard layout

  • Right click on the US symbol on the right side of the system tray/panel - select Preferences MOVED TO... Input Methods MOVED TO... Add MOVED TO... German MOVED TO... German (Switzerland) MOVED TO... Add

Kactivitymanagerd pops up every second. What can I do?

  • Try to reset the kactivitymanagerd settings with
    rm -rf ~/.local/share/kactivitymanagerd
    

I don't like KDE. Is there an alternative?

  • Yes. Try out XFCE Desktop (http://www.xfce.org). Xfce is a lightweight desktop environment. At the login screen select Session Type and choose Xfce Session instead of KDE.

How to change the desktop background?

  • Right click on your desktop and select Configure Desktop

How to change the font in the konsole (terminal)?

  • Open a terminal (konsole).
  • In the menu go to Settings MOVED TO... Edit Current Profile... Click on the Appearance tab. At the bottom choose Edit Font.... Select a font. For example Droid Sans Mono size 10 points. Finally press Ok and Apply.

How to put application icons in the panel?

  • In the KDE menu search for the application you want to put into the panel.
  • Instead of starting the application with a left click, right click on it and from the menu cooose Add to Panel. About how to move the icon inside the panel, see next point.

How to move icons/widgets in the panel?

  • Right click on the panel and choose Panel Options and MOVED TO... choose Panel Settings. Or on the right side of the panel click on the three horizontal lines symbol.
  • While the Settings window is opened, move the cursor to the icon/widget on the panel, click on it and move to the desired location and click again. Close the Panel Settings window after the move.

I cannot modify my panel, for example add applications or move widgets?

  • Check if your panel is not locked. Right click on the panel and select Unlock Widgets.

How to adjusting the thickness of the panel?

  • On the right side of the panel click on the three horizontal lines symbol. A toolbar pops up.
  • Click the "Height" button but DO NOT RELEASE the mouse button.
  • Now move the mouse, this causes the height of the panel to grow or shrink.

How to configure the pager?

  • The pager shows you the virtual desktops. The pager is a widget and can be added to the panel or to the desktop.
  • To configure the pager located in the panel, right click on it and choose Pager Settings or Configure Virtual Desktops.

How to Disable Akonadi?

  • Open ~/.config/akonadi/akonadiserverrc and set “StartServer” to false.
    [QMYSQL]
    StartServer=false
    
  • Later if you want to use akonadi again, you can manually start it by running the following command: ‘kcmshell4 kcm_akonadi‘ or ‘akonaditray‘.
  • ALERT! Note: PIM applications and other akonadi dependent applications (kontact, kaddressbook, kmail, korganizer, kalarm, etc) won’t work with akonadi disabled.

How to clean up your KDE settings

  • If you experience problems with KDE. I recommend to start from scratch and clean up all your KDE settings.
  • To (re-)move your KDE settings move them to a backup folder. Start a konsole/terminal and type:
    mkdir ~/KDE.backup
    mv ~/.local/share/kactivitymanagerd ~/KDE.backup
    rm -f ~/.config/kglobalshortcutsrc.lock
    mv ~/.config/plasma-*               ~/KDE.backup
    mv ~/.config/*rc                    ~/KDE.backup
    mv ~/.kde4                          ~/KDE.backup
    mv ~/.kde                           ~/KDE.backup
    
  • Or just remove it completely
    rm -rf ~/.local/share/kactivitymanagerd
    rm -rf ~/.config/plasma-*
    rm -f  ~/.config/kglobalshortcutsrc.lock
    rm -rf ~/.config/*rc 
    rm -rf ~/.kde4
    rm -rf ~/.kde
    
  • NOTE: Maybe you only have to remove ~/.config/plasma-*
  • Now logout and login again. KDE4 will start with the default settings.
  • If you can not login to KDE, press Ctrl+Alt+F1. Login to the text console. (Re)move ~/.kde and ~/.kde4. Press Ctrl+Alt+F7 to get back to the login screen.
  • Instead of starting with fresh KDE settings, try to restore old ~/.kde and ~/.kde4 folders from the backup, see LinuxHome#Restore_from_Backup

How to set a shortcut to start an application?

  • On a konsole start the program systemsettings5. Or from the KDE menu choose Configure Desktop. Choose from Workspace Shortcuts.

How to mount/unmount USB disks and CD/DVD ?

  • Use the plasma widget called Device Notifier, which shows attached devices such as USB flash drives, CD/DVD drives, or digital cameras.
  • For more info see DeviceNotifier

Shutdown the PC from the KDE menu does not work or only after a long delay

  • To power off your PC start a konsole and type the command poweroff or turnoff. For more information see also RemoteTurnOffOn




XFCE

All window title bars went missing, how to get them back?

  • Remove all XFCE settings and cache from your home directory to reset to default
    rm -rf ~/.cache/sessions/xfce4-session
    rm -rf ~/.cache/xfce4*
    rm -rf ~/.config/autostart/xfce4-settings-helper-autostart.desktop
    rm -rf ~/.config/xfce4
    

Changing the number of workspaces in the settings does not have any effect.

  • Remove all XFCE settings and cache from your home directory to reset to default (see above)




GNOME Shell

Screen cannot be locked

  • For versions of Gnome Shell newer than 3.6, gnome-screensaver is no longer available and locking the screen relies on the display manager GDM. Since the standard installation uses SDDM, the screen cannot be locked. As a fix xscreensaver can be used by invoking
    xscreensaver-command -lock
    
  • This can be mapped to the keyboard shortcut Ctrl + Alt + L under Settings -> Keyboard -> Custom Shortcuts.
  • Note that xscreensaver needs to run in the background and should be added with a new entry in the autostart folder (~./config/autostart/):
    [Desktop Entry]
    Name=XScreensaver   
    GenericName=Xscreensaver
    Exec=/usr/bin/xscreensaver
    Terminal=false
    Type=Application
    X-GNOME-Autostart-enabled=true
    

How to disable keyring

  • if you get
    Enter password to unlock your login keyring
    
    and don't remember your password for the keyring. Remove all keyring settings with
    rm -rf ~/.local/share/keyrings
    rm -rf ~/.gnome2/keyrings
    
  • BTW. The GNOME keyring application can be started with the command
    seahorse
    




Python

ALERT! Warning: do not automatically activate an environment in .bashrc

  • Automatically activating an environment in (e.g. source activate iacpy3_2019) in your .bashrc can break your login
  • If you cannot login and suspect it is because of this issue
    • open alternative (non-graphical) shell with CTRL + ALT + F1
    • edit your .bashrc and remove the line with source activate environment

Also check the docs on JupyterHub!

JupyterHub

Should I use Python?

  • Absolutely.

Tutorials

Which version should I use? python 2 or python 3?

  • You should use python 3 for every new project.
  • ALERT! Note: Python 2 has reached its end-of-life in 2019. It no longer receives bugfixes. Most projects (numpy, matplotlib, ...) stoped supporting python 2!

What's the recommended way to use python at IAC?

  • We recommend to use conda to manage packages and environments. See below.

What about other solutions?

  • Python installed on the machines?
    It is discouraged to use the python installation on the machines. Package versions can change unexpectedly which may lead to code incompatibilities. This solution is not viable for long-term reproducibility.

  • Virtual environments?
    Conda is superior to virtual environments because it also handles non-python dependencies (such as the netCDF library) and can therefore offer a more stable environment.

What are Best Practices when using python?

  • For each project you should decide on a conda environment and note which one you use. You could for example create a startup file that you call every time you work on the project:
    #!/bin/bash
    module load conda/2022
    source activate iacpy3_2022
    

  • This file has to be made executable (chmod +x startup) and needs to be invoked as source startup.
  • help See this gist for a more complete example

Why is it important to work with a fixed environment?

  • Python packages undergo a rapid development and may become incompatible with your script. If you want to re-run your analysis in at a later stage you want to have the same versions for the packages you used. Therefore it is important that you know which environment you used.

What is conda?

  • conda is a program that manages (python) packages and environments. It allows to use a centralized installation while still providing user flexibility in term of package installation.

What is mamba?

  • mamba is a faster drop-in replacement for conda - it allows for much faster dependency solving. You can replace almost every conda command by mamba command

What is a conda environment?

  • From the conda documentation: A conda environment is a directory that contains a specific collection of conda packages that you have installed. For example, you may have one environment with NumPy 1.7 and its dependencies, and another environment with NumPy 1.6 for legacy testing. If you change one environment, your other environments are not affected. You can easily activate or deactivate environments, which is how you switch between them. You can also share your environment with someone by giving them a copy of your environment.yaml file.

What is a conda package?

  • A conda package is a compressed tarball file that contains system-level libraries, Python or other modules, executable programs and other components. Conda keeps track of the dependencies between packages and platforms. Thus, it can not only handle python packages but also other dependencies (e.g. the netCDF c library).

How do I use conda?

  • Load the module
    module load conda
    
  • View all environments
    conda env list
    

  • Work in an environment
    source activate iacpy3_2023
    
    • ALERT! Warning: do not do this in your .bashrc, instead define an alias (see below)
  • List installed python packages
    conda list
    
  • jupyter -> use JupyterHub)
  • Start spyder
    spyder
    
  • Use ipython
    ipython
    

  • TIP For a simpler and quicker usage, you can create an alias in your ~/.bashrc:
    alias iacpy24='module load conda; source activate iacpy3_2024'
    

What environments are available?

  • TIP You can also make all environments available with module load conda

  • 2024 environments
    module load conda/2024
    conda env list
    
    • iacpy3_2024: based on iacpy3_2023, uses python 3.11; updated all packages on 16.04.2024; Note that a number of packages have been removed from the environment - contact iac-linux@env.ethz.ch if you are missing something.

  • 2023 environments
    module load conda/2023
    conda env list
    
    • iacpy3_2023: based on iacpy3_2022, uses python 3.11; updated all packages on 08.08.2023; Note that a number of packages have been removed from the environment - contact iac-linux@env.ethz.ch if you are missing something.

Older environments

  • 2022 environments
    module load conda/2022
    conda env list
    
    • iacpy3_2022: based on iacpy3_2021, uses python 3.9; updated all packages on 16.03.2022;

  • 2021 environments
    module load conda/2021
    conda env list
    
    • iacpy3_2021: based on iacpy3_2020, uses python 3.9; updated all packages on 22.04.2021;

  • 2020 environments
    module load conda/2020
    conda env list
    
    • iacpy3_2020: based on iacpy3_2019, uses python 3.7; updated all packages on 15.04.2020;

  • 2019 environments
    module load conda/2019
    conda env list
    
    • iacpy3_2019: based on iacpy3_2018, uses python 3.7; updated all packages on 08.04.2019;
    • iacpy_cmip6_ng environment used to create the cmip6 new generation archive, please use iacpy3_2019

  • 2018 environments
    module load conda/2018
    conda env list
    
    • iacpy3_2018: based on dypy, uses python 3.6; updated all packages on 03.04.2018;
    • iacpy2_2018: based on dypy, but uses python 2.7; updated all packages on 03.04.2018

  • 2017 environments
    module load conda/2017
    conda env list
    
    • dypy: python3.5 environment with dypy (for LAGRANTO) and suitable for most users
    • cis_env: python3.5 environment with cis tools in version 1.5.4
    • pyferret_env: python3.5 environment with pyferret in version 7.0
    • pyn_env: python2.7 environment with PyNgl and PyNio in version 1.5

  • ALERT! module load miniconda3 is equivalent to module load conda

I am missing a package - what can I do?

  • Write to iac-linux@env.ethz.ch - we can generally add single packages to the existing environments. If you are impatient, see below.

How can I install a single package?

  • You will need to create your own environment (see below), and then add the package with
    mamba install <package>
    

How can I create my own environment?

  • conda allows to manage environments without being root!

Create a new environment

  • NB: don't forget to include ipython in your new environment

Clone and tweak an existing environment

  • If you want to have more control on your environment but still exiting one as a base, you can do the following:
    mamba create -n analysis_2019 --clone iacpy3_2019
    

  • You can now add packages to the new environment:
    source activate analysis_2019
    mamba install <package>
    # - OR -
    pip install <package> # installation with mamba is preferred!
    

Background information about the differences between pip, conda and anaconda

How can I create an executable python script when using a conda environment?

  • To run a python script directly from the command line (./script.py) you need to add the following at the top of your script
    #!/usr/bin/env python
    
  • However, the environment needs to be loaded, before it is executed.
  • Of course the file needs to be executable (chmod +x scripy.py)

How to best run jupyter notebook on a server?

  • See below how to run a notebook on a server from your personal computer.
  • Here we to setup a jupyter notebook running on a server and use it from your computer.
  • It will make use of tmux on the server to keep a session running even if you are not logged in anymore.
  • For security purpose the jupyter notebook produces a token at start, you need to copy this token (password) to the login screen of the notebook.

  • On the server
    tmux new-session -s 'background jobs'
    cd ~
    module load conda/<year>
    source activate <environment>
    jupyter notebook --no-browser --port 55000
    
    • ALERT! If the port is already in use jupyter will select the next higher available. Make sure that you use the right port in the next part.

  • On your computer:
    ssh -f -N -L localhost:8888:localhost:55000 SERVER
    

  • Open the browser and go to: http://127.0.0.1:8888
  • Copy the token given by the jupyter notebook on the server and paste it in the login field.
  • TIP This also works to tunnel a notebook from a linux machine to a windows machine
    • e.g. via (WSL [windows subsystem for linux]), or Start -> cmd
  • TIP You can recover the full address including the token on the SERVER by pressing CTRL C once.

Run a notebook on a server - from your personal computer

  • ALERT! Please don't run jupyter/ python on fog or fog2. These are login nodes that don't have many ressources.

You cannot directly ssh to our servers. Therefore, the above solution does not work from you personal computer. There are two possibilities.

1) Configure fog as a 'jumphost'

  • Edit (or create) ~/.ssh/config file as follows (on your personal computer)
    Host fog
      User <username> # your ETH username
      Hostname fog.ethz.ch
    
    Host atmos # change this according to the SERVER you want to use
      User <username> # your ETH username
      Hostname atmos.ethz.ch # change this as well
      ProxyCommand ssh -q -W %h:%p fog
    

  • now the following command should work
    ssh -f -N -L localhost:8888:localhost:55000 atmos
    
  • if you try to access the server from Windows using putty, make sure that you add the forwarded port to the profile for your session (on the left under "Category" go to "Connection" -> "SSH" -> "Tunnels" and type "8888" into source port, "localhost:55000" into destination, then click "Add")
  • ALERT! do NOT write atmos.ethz.ch, only atmos

2) Use ssh from the USYS VPN

  • Connect to the USYS-VPN
  • You can now ssh to the following servers (i.e. the above script works directly)
    • litho, cfc
  • If you want to access another server, please contact iac-linux@env.ethz.ch

Run spyder remotely

  • ALERT! Please don't run spyder on fog or fog2. These are login nodes that don't have many ressources.
  • ssh to any of the servers to run your analyis, e.g.:
    ssh -X <username>@fog.ethz.ch
    ssh -X litho
    module load conda
    source activate iacpy3_2023
    spyder
    
  • If you don't want to log in twice (-> fog -> server), see tipps above (Run a notebook on a server)

Spyder 3 shows strange symbols

  • Something goes wrong with the font in spyder3. The workaround is to use the symbols of spyder2.
  • In spyder3 go to Tools > General (Appearance) > Icon Theme: Change to Spyder 2 and restart spyder.

user packages no longer available in conda environment and JupyerHub

  • Packages installed with pip install <package> --user (site packages) are no longer available in personal conda environments.
  • This should not effect most users.

Why was this change introduced?

  • Conda environments should be self-contained and reproducible. Site packages 'pollute' the clean workspace (i.e. there could be packages in an environment that were never installed into it).
  • You don't need --user to install packages with conda+pip.
    • Most often you will be able to install packages directly with conda (conda install <package>)
    • When using conda+pip it is not necessary to install packages with --user; you can do this with pip install <package>

I'am missing my self-installed packages, what can I do?

  • Recommended: You should re-install the packages into your enviroment:
    module load conda
    source activate <environment>
    pip install <package>
    
  • NB: Make sure that pip is included in the environment before installing extra packages into it.
  • If you installed site packages into an existing environment (one managed by IAC-IT), you will have to clone this environment, see instructions above.
  • Not recommended: You can get the old behaviour back by adding the following line to your ~/.bashrc (for bash):
    module load conda # as before
    unset PYTHONNOUSERSITE
    

What has changed?

  • module load conda now does the following: export PYTHONNOUSERSITE=1. This avoids putting the site-packages in the pythonpath, as explained in the documentation.

spacer

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Wiki? Send feedback
Syndicate this site RSS ATOM