March 8, 2008

Linux

So, my buddy gave me his computer to fix up for him and after a bit of debating I decided to put Linux (Ubuntu) on it. I'm typically really good with computers but Linux is so foreign and intimidating. I'm getting used to using it now, but I'm kind of freaking out about the fact that I have to fucking teach someone who is also as clueless about Linux as me how the hell to use it. Thankfully I've found some decent "transition" guides that I can set him up with. But, still....WTF does this mean?!?!!

apt-get install digikam digikamimageplugins kipi-plugins

How come I can't just click a link to download something? Fucking Linux. Although, I must say, I'm pretty thoroughly sold on Linux. I'm thinking about hooking my laptop up with a dual boot setup so I can become more fluent in the ways of Linux and maybe eventually switch completely to Linux!

Anyone have any advice on other distros and possibly some guides for a beginner like me?

13 comments:

Anonymous said...

apt-get install digikam digikamimageplugins kipi-plugins

translates to

Install an app for managing photos and some plugins so it can do more stuff. Easy ;)

You can still download things - for example at http://www.getdeb.net/ ,but generally it's safer to use apt-get/aptitude/synaptic.
Synaptic is a graphical interface for apt-get and is way less confusing. Also, Kubuntu has the Adept package manager - it's OK, but synaptic is IMHO better.

Sean H said...

Hey thanks anonymous guy. Much appreciated!

Petr Mrázek said...

Lol, no problem :)

Some console info:

When you do stuff in the console and don't understand something, try running the command with --help.
Like 'apt-get --help'.

Most programs (and some config files) have manual pages - you can display these with 'man something_or_other' -- for example 'man apt-get'.

In some distros there are also info pages - very similar to man pages - 'info something_or_other'. These also have links in them pretty much like HTML.

If a console program outputs a lot of text, you can make it easily scrollable with 'some_program_or_other | less'.

Running 'someprogram > somefile' will make the program output into a new file, which you can read later. It won't ask about overwriting stuff.

'someprogram >> somefile' will append the program output to the end of a file.

So, to display help for rm (tool for deleting files) and make it scrollable, you would type 'rm --help | less'.

If you're stuck, try hitting 'q'. Many console programs recognize that as 'quit'.

When someone tells you to run console commands, be sure to check what they do before you use them. Stuff like 'sudo dd /dev/random /dev/hda' or 'sudo rm -rf /' can destroy the OS and all your data. Not funny.

Useful console things:

'top' -- shows you a list of running processes by %CPU used. There's also an extended version - 'htop', but that's not usually preinstalled.

'dmesg' -- output from the kernel - it's HUGE, but sometimes useful when something doesn't work.

'grep' -- this can search for a line in a file.
Examples:
'dmesg | grep error' - shows system errors since last boot.
'ls -l | grep .jpg' - lists all jpegs in a folder.

'cat' -- used like 'cat somefile'. Prints the contents of a file to console. Best used together with 'less'.

'alsamixer' -- console audio voloume thing.

And some weird stuff:

'cat ~/* /dev/dsp' -- take files in your home directory and feed them to your audio card - it makes 'modem' noises for most files, but you can play raw audio this way (wav and raw files, mp3s are just static when played this way).
Turn down the volume a bit before trying this.

'apt-get moo' -- a hidden easter egg in apt-get.

Well, i could continue... But i'm tired from all the typing :)

Sean H said...

Wow! Thanks for all of the info! That's a whole lot to take in. But, I'm sure I'll figure it all out eventually. Just have to practice and get a feel for it! Do you know of any good repositories of info/guides for a Linux noob like myself?

Petr Mrázek said...

Well, i usually just google for things. Google has a dedicated linux search page - http://www.google.com/linux

Some more sites:

ubuntuforums.org - :)

phoronix.com - often tests new video hardware and drivers

winehq.org - Info on Wine (for running windows programs on linux.

www.gnome-look.org - lots and lots of themes, wallpapers and similar stuff. There's also www.kde-look.org etc. - they link to each other.

http://albertomilone.com/nvidia_scripts1.html - automatic installer for new graphics drivers.

And of course, the Linux/Unix section of digg.com.

Sean H said...

Seriously guy....you kick ass! I really appreciate all the help you've given me. Thank you so much!

Petr Mrázek said...

(sorry, there was a bad link)

I just wish someone told me all this a year ago :D

Amarok - a great Linux music player - definitely check it out. It should be installable through synaptic.

K3B - Another great program - this one's for burning CDs and DVDs.

These two are KDE apps. Using them with Gnome requires a bit more RAM, because libraries for both KDE and Gnome have to be loaded.

It's also a good idea to try few different distros. While the software they have is pretty much the same (apart from different default Desktop Environments - Gnome/KDE/XFCE/...), some can have better support for your hardware and better configuration tools.

Opensuse (opensuse.org) is quite polished and runs KDE for example. Then there's Linux Mint (linuxmint.com) - also a great distro. A lot more can be found on distrowatch.com

screencasts.ubuntu.com - video tutorials for Ubuntu. Some of them are outdated (made on older versions of Ubuntu), but they're quite good.

www.linux.com -- all sorts of articles. Not all of them are useful for a desktop user - there's server and developer stuff there also.

www.linuxactionshow.com -- Two geeks, Linux and a microphone. Sometimes they have guests from all kinds of OSS projects.

Anyway, I'll watch this space. Feel free to ask about Linux stuff.

... I think I'll put this all somewhere on the net. Seems like it could be useful for more people...

Sean H said...

Well, the only reason I'm using Ubuntu on his comp is because I did some research and supposedly KDE distros require more processing power and RAM. So, I figure Ubuntu will run fine. Which it has so far.

I've been doing a lot of reading for the past like three days and I think I'm getting the hang of it now.

I've yet to delve into the console yet though. It's big and scary. I'm just trying to get the comp hooked up with shit he needs right now. Console is tomorrow!

Petr Mrázek said...

The RAM/processing power needed are about the same. KDE has more things in the libraries and the actual apps are smaller, Gnome apps are a bit heavier.
KDE has many configuration options (some say too much), Gnome is more about usability and being easy to use.

If you have enough RAM, you can run apps from both. Some of the apps - like Amarok - are definitely worth it.

In ubuntu, the console isn't really needed that much. Only when something goes wrong or if you like it ;)

When you need to do something quickly without having to mess with a GUI or want to automate common tasks - it's there.
You can actually turn the console commands into a script much like the .bat files from DOS and Windows (google: 'bash scripting').

There's also an extension for Nautilus (Gnome/Ubuntu file manager) that lets you add scripts to the context menu of files and folders. In my distro, the package for that is called 'nautilus-actions'.

More basic console info:

Ctrl-C will abort most currently running console programs.

Ctrl-Z will pause them. Then, you can resume them by running 'fg'.

If you need to list what's running quickly, use 'ps'.

Running a program like this :'program &' will make it run in the background.

'wget' is a command line downloader. It has support for resuming interrupted downloads with the '-c' option.
Use it like this: 'wget -c http://some.url.com/huge_file.avi'. Unless the server needs some complicated authentication, it will run just fine.

Sean H said...

His comp has only got 512. So, I figure the lighter the better. I did get amarok though and it is pretty fucking amazing.

One problem I encountered though was this. I tried downloading this program

http://www.hydrogen-music.org/

and it extracted to some .tar.gz file or something and I could figure out how to get it to work.I looked stuff up and found an article

http://lifehacker.com/361341/learn-the-basics-of-installing-from-source-in-linux

but still couldn't figure it out. Any advice?

Sean H said...

One more problem I just encountered. When I try to burn a cd with k3b it tells me that it can't because the files are in mp3 or wma format. Any good converters or work arounds that you know of?

Petr Mrázek said...

tar.gz and .tar are archive files very similar to zip or rar. In this case, no compilation is needed, because it's in the Ubuntu repositories. Just 'apt-get install hydrogen' or use Synaptic for that.

When you find some app, always check the repositories first. It can save a lot of time (Synaptic has a search feature).
If it isn't there, you can still search for .deb packages (see getdeb) - these are much like .msi installers on windows.

Compilation:
That lifehacker page is a bit too simplistic and assumes you have everything set up properly.

For compiling anything on Ubuntu, you need the 'build-essential' package (compilers and other stuff) plus some *-dev packages - these contain library header files that the app you're compiling needs to access the library functions.
Hunting those down can be a bit tricky.

Steps to compile an application:

*Unpack the archive somewhere.

*See if there's some readme or install howto. If there is, do what it says (or no if it's a bunch of nonsense). mostly they contain only general instructions.

*Navigate using the console to the folder where you've extracted the archive. (nautilus has an extension that allows you to open console in any folder. try searching for 'nautilus' in Synaptic - it should be there)

*try running './configure' - a whole lot of text should appear. It will tell you if you need to get any more libraries (* and *-dev packages) - this can be non-obvious at times.

*If everything went OK, type 'make'. There shouldn't be any errors at this point. If there are, you would have to be a programmer or have one standing besides you.

Now, there are two alternatives:
*Install directly using 'make install' - not a great idea - it's hard to uninstall the app after doing this.

*Install using checkinstall (package has the same name) - 'sudo checkinstall'. The app will be installed as a deb package and you'll be able to uninstall it with apt-get, Synaptic, etc.

I don't like compiling stuff. If you can avoid that, then do avoid it.

MP3 burning using K3B:
https://answers.launchpad.net/ubuntu/+source/k3b/+question/6146

I don't know about wma. I've never got hose working even under Windows ... guess it was some DRM crap. Anyway, try installing 'ffmpeg'. That should make it work.

Sean H said...

Thanks so much! You don't know how much I appreciate all of your help!