Linux commands

From LinuxMCE
Revision as of 13:06, 6 November 2011 by Marie.o (Talk | contribs)

(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search


This wiki is for the many of us out there that are new to linux and don't know the general commands used to find/edit/troublehoot. It also describes a lot of regularly used files for troublehooting. I will just use the core in my examples, but you can do this for any md also.

Logging Into A Terminal On Core Or MD

A lot of troubleshooting is done from a terminal, which is different than a windows or kde environment

  • On the core/hybrid itself press ctrl-alt-f1 for what i call terminal 1, you can also use f2, f3 or f4 and have 4 terminals open at the same time
  • From a windows box download putty which is a free ssh (secure shell) program to telnet into your core/hybrid
    • Download here [1]
    • Open the program and for the core/hybrid use 192.168.80.1 for the Host Name (or IP address) and click the 'Open' button

You are now in a command terminal on your core.

Becoming root

For most of the changes you want to make or installing new software you have to become 'root' (equivalent to administrator in win)

  • If you are worried about messing stuff up, just use the 'sudo' command to become root just for that command, this is generally recommended for novice users of linux
    • kubuntu will ask you for a password when you do, enter the password you used to setup the first account while installing kubuntu. kubuntu will only ask you for your password once per session===
  • If you want to become 'root' and stay that way use the 'sudo -i' command and answer the password

You are now root on the system or can use a command as root

Viewing And Editing Files

For this example i'll use your video setup file xorg.conf

  • location /etc/X11/xorg.conf

This file is used to store all your videocard settings, a lot of simple fixes can be made in here like changing the driver from vesa to nvidia and vice versa.

  • To view you xorg.conf just use the 'cat' command:
cat /etc/X11/xorg.conf

To edit xorg.conf use any of the editors available, in kubuntu 'vi' is always available, i use 'nano'

  • if you don't have nano, you can use the following command to install it
 sudo apt-get install nano
  • after installing nano, just use:
nano /etc/X11/xorg.conf to edit the file

you can now view and edit your xorg.conf, ofcourse you can use these same commands to view/edit any other file

Checking versions of installed software

With this command you can check the versions of the software installed

dkpg -l

Ofcourse getting this whole list is difficult to navigate, and you can ask for only one piece as follows, for this example mythtv is used

dpkg -l | grep mythtv

This should give you a list like this with only the mythtv versions:

ii  mythtv-backend                             2:0.21.0+fixes-22228-openglvdpau2-0ubuntu2  A personal video recorder application (serve
ii  mythtv-common                              2:0.21.0+fixes-22228-openglvdpau2-0ubuntu2  A personal video recorder application (commo
ii  mythtv-frontend                            2:0.21.0+fixes-22228-openglvdpau2-0ubuntu2  A personal video recorder application (clien
ii  mythtv-transcode-utils                     2:0.21.0+fixes-22228-openglvdpau2-0ubuntu2  Utilities used for transcoding MythTV tasks
ii  pluto-mythtv-player                        2.0.0.44.09091422296                        <insert up to 60 chars description>

As you can see this system is running mythtv version 0.21.0 (the vdpau2 gives away it's also using the avenard depot)

Getting a missing key for a certain package

In the latest install the md's medibuntu package key was not set correctly, which gives an error on apt-get update, you can correct this by typing the following.

wget http://packages.medibuntu.org/medibuntu-key.gpg
sudo apt-key add medibuntu-key.gpg

This should add the key to your package manager, do another apt-get update and you should get no errors

Changing root password for an MD

Figure out the device number of your MD when it was created. On the Core/Hybrid start a terminal ctrl-alt-f1 and login with your login and password you used when you installed kubuntu. Become root as above sudo -i and put in the password again. Now navigate to /usr/pluto/diskless/ and look this directory, it should have a number in there that is the same as your md. Now type chroot ## (where ## is the number of the md device) type passwd it asks you to put a new root password in twice, do it and the root password for that md is changed. type exit or just go back to lmce by keystroke ctrl-alt-f7

This is a start and i will be adding to this wiki while i figure out commands on kubuntu and while troubleshooting, please feel free to add your commands at any time

a much more elaborate explanation and list of commands is found here at ubuntu.com [2]