Tuesday, April 16, 2013

First PC Build: Software - Setting Up Ubuntu 12.10

I had already decided that I wanted to install Linux, but I didn't realize until I started researching a bit just how broad the options were, and how passionate people are about which distribution is the best.  I read a lot of articles (this one on Lifehacker was pretty good), but didn't really have a good reason to select anything in particular.  I considered Fedora pretty heavily for a couple of reasons.  First, I use Red Hat at work, so the connection there seemed like it might be a good reason.  Second, there is a "spin" (repackaged distribution with extra software included) called Fedora Electronic Lab that includes an impressive collection of software for electronics design that was tempting.  However, some places I looked made it seem like Fedora tends to be a little less stable due to its emphasis on getting updates out as soon as possible.  I ended up choosing Ubuntu instead, mainly because I didn't have a great reason to pick anything else and it seemed to have a very large community in case I ran into issues.

The downloading and installation process was very straightforward.  I downloaded an ISO from the main download page and used the Windows Disc Image Burner on Windows 7 to create the install DVD.  I am using Ubuntu 12.10 "Quantal Quetzal" 64-bit.  There is a release page that has the common download options available if you want to see the other choices.  During the installation process there is an option to install restricted extras, which I selected, giving you the ability to playback some media formats without having to install additional software later.

Below, I am listing the different additional software I installed after getting the computer up and running.  I may add to this in the future, and this is mostly a log for myself in case I have to do this again later.

The Unity desktop that comes standard on Ubuntu 12.10 is going to take some getting used to.  I may stick with it, but I decided to download a few other desktop environments to try out as well before settling.  These command will install the classic Gnome desktop, the KDE desktop, and the LUbuntu desktop (which is supposed to be lighter weight).


sudo apt-get install gnome-panel
sudo apt-get install kubuntu-desktop
sudo apt-get install lubuntu-desktop

Ubuntu installs with open source graphics drivers that worked fine with the APU I have, but AMD releases a proprietary driver that I installed instead.  There is an unofficial wiki from AMD that contains installation instructions.  Make sure you find the page for your specific distribution.  I initially followed the directions for Ubuntu 12.04 and things did not go well.  I followed the manual installation instructions, which are listed below.  You could also download the zip file from the AMD website instead of the wget line below.

sudo apt-get install build-essential cdbs dh-make dkms execstack dh-modaliases linux-headers-generic fakeroot
sudo apt-get install lib32gcc1
wget http://www2.ati.com/drivers/linux/amd-driver-installer-catalyst-13.1-linux-x86.x86_64.zip
unzip amd-driver-installer-catalyst-13.1-linux-x86.x86_64.zip
chmod +x amd-driver-installer-catalyst-13.1-linux-x86.x86_64.run
sudo ./amd-driver-installer-catalyst-13.1-linux-x86.x86_64.run --buildpkg Ubuntu/quantal
sudo dpkg -i fglrx*.deb
sudo amdconfig --initial -f

After all of these steps, reboot the computer. Then run the following commands to test out the installation and make sure everything works.  The first one should print some information about your GPU, and the second should start a spinning box graphic and report out some information.

fglrxinfo
fgl_glxgears

I have Amazon Prime, which gives you access to stream a lot of TV shows and movies, and when I went to check if it worked....it didn't.  I was using Firefox and my Flash player was up-to-date, but it kept saying I needed to update the player.  I did some searching, and eventually found a solution.

sudo apt-get install libhal1 hal

That worked for a couple weeks, but soon after I did an update in the Ubuntu Software Center...and Amazon Instant Video stopped working.  Apparently there was an update to the flash plug-in that broke it.  A post on the Ubuntu forums describes the fix.

64-bit Download: https://fpdownload.macromedia.com/ge....x86_64.tar.gz

tar -xzf install_flash_player_11_linux.x86_64.tar.gz
sudo cp libflashplayer.so /usr/lib/mozilla/plugins

I don't play computer games, so I don't have anything to compare it to, but I went to Steam, which recently started putting out some Linux games, and downloaded Team Fortress 2 (free to play) to see how it runs on the APU.  It looked like it was working fine to me, and I didn't notice any slowing down or anything.

This one makes me feel a little dumb.  After leaving my computer running for a while, I would check "top" in the terminal and it looked like all of my RAM was being used when the computer was basically idling.  I got pretty frustrated trying to figure out what was going on until I found this site that explains it.  Linux uses unused memory for caching  but it gives it right back to applications when its needed.  My computer is really idling at about 1GB of RAM used, not 3GB+, which is what had me worried.  The "free" command shows how much memory is being used for caching and home much you really have used.

Now, on to the software I really care about.  I mostly want to use this computer to work on my microcontroller projects and C++/Python projects.  GCC and Python came pre-installed, so there's nothing needed to use those.  There are several IDE's available in the Ubuntu Software Center, but for now I plan on just using a text editor and terminal.

Some microcontroller vendors release their tools for Windows only, but there are several officially supported Linux tools.

I use Cadsoft Eagle for PCB layout, and they offer a Linux version.  It comes as a .run file that opens an installer and was very straightforward to install.  I opened up some of their sample project files and it seemed like everything was working correctly. 

Microchip's relatively new MPLAB-X IDE is available for Linux and it also comes as a .run file that is easy to install.  It looks like debugging in Linux is only supported on the PICKIT3, not the PICKIT2, so I'll probably end up getting on of those before I pick back on up one of my stalled PIC18 projects.  I have a storybook reader project and a RC/drone controller project that are both PIC based that haven't made much progress in a while, but hopefully I'll get back to them at some point and transition them over to my Linux development box.

I downloaded the version of the Arduino IDE that is in the Ubuntu repository.  It installed version 1.0.1, while the download page for Arduino is at 1.0.4 for a zipped tar file for Linux.  I'll see once I start working with it if I need to upgrade.  My next/current project will likely use Arduino because I'm helping out a friend with a homebrewing controller who doesn't really have any background in programming/electronics and want to learn through the project and it seemed like the best choice for that.

sudo apt-get install arduino

Atmel also releases an AVR Toolchain for Linux that includes a compiler, assembler, linker and Standard C & math libraries for AVR microcontrollers. I would imagine that the Arduino installation includes some (or all) of this, but it seemed like a useful link to keep track of as well.

Texas Instruments has also provided Linux support for their MSP430 series of microcontrollers with CSS version 5.  The free version is limited to 16kB, but that is larger than most of the low end MSP430's anyway.

3 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. This comment has been removed by a blog administrator.

    ReplyDelete