Categories
Command Line HowTo Linux Ubuntu

ERROR: Failed to build gem native extension.

While attempting to install a package from gem, I encountered this issue:

sudo gem install dashing
Building native extensions.  This could take a while...
ERROR:  Error installing dashing:
	ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from extconf.rb:2:in `
' Gem files will remain installed in /var/lib/gems/1.9.1/gems/eventmachine-1.2.3 for inspection. Results logged to /var/lib/gems/1.9.1/gems/eventmachine-1.2.3/ext/gem_make.out

Simply to solve this you just need to install ruby-dev packages on ubuntu:

sudo apt-get install ruby-dev
Categories
Command Line Linux Ubuntu

apt-get error “E: Unable to correct problems, you have held broken packages.”

The problem you have encountered is basically the package, or dependencies that are conflicting or broken and are therefore “held”.

You can check what (if any) packages are held using the following command:

dpkg --get-selections | grep hold

or

apt-mark showhold

If there’s no packages, or no output. That means it’s probably a dependency issue which apt-get isn’t able to resolve. apt-get is actually pretty bad at dealing with the dependencies and it’s often easier to try install via aptitude (an alternative to apt-get, which is widely regarded as a better solution to the default apt-get.

Solution:

First install aptitude:

sudo apt-get install aptitude

and then install the package:

sudo aptitude install [package_name]
Categories
Uncategorized

Testing Failed: “Failed: error: SBT did not send a reply to our request, perhaps it was killed or failed to start”

Activator error “Failed: error: SBT did not send a reply to our request, perhaps it was killed or failed to start”.

This may be because SBT isn’t installed, SBT is a “simple build tool” for scala which isn’t packaged with the main binaries. You can download and install the latest SBT from the official page, installing it fixed the issue for me in Activator.

Categories
Linux Ubuntu Uncategorized

Linux Mint: “Could not download all repository indexes”

When running

sudo apt-get update

or attempting to update via the Update Manager in Linux Mint (13), I was fronted with the following error:

Failed to fetch http://packages.linuxmint.com/dists/deb ... tion-en_US Unable to connect to packages.linuxmint.com:http:
Failed to fetch http://packages.linuxmint.com/dists/deb ... slation-en Unable to connect to packages.linuxmint.com:http:
Failed to fetch http://packages.linuxmint.com/dists/deb ... tion-en_US Unable to connect to packages.linuxmint.com:http:
Failed to fetch http://packages.linuxmint.com/dists/deb ... slation-en Unable to connect to packages.linuxmint.com:http:
Failed to fetch http://packages.linuxmint.com/dists/deb ... tion-en_US Unable to connect to packages.linuxmint.com:http:
Failed to fetch http://packages.linuxmint.com/dists/deb ... slation-en Unable to connect to packages.linuxmint.com:http:
Some index files failed to download. They have been ignored, or old ones used instead.

This is caused by missing repositories which are either old, broken or currently down. In order to fix it, simply run:

sudo apt-get update fix-missing

If this option doesn’t work, try changing the repository mirrors with the following guide.

Categories
Linux Ubuntu

VirtualBox (4.26) USB Issue: “unable to enumerate USB device on port n”

After a couple of hours trying to get a USB device (USB-to-Serial FTDI) working in VirtualBox with OSX host and Ubuntu 12.10 guest and receiving an error message similar to the follow:

usb 6-3: new full speed USB device number 24 using ohci_hcd
usb 6-3: device not accepting address 24, error -110
hub 6-0:1.0: unable to enumerate USB device on port 2

It turns out, the issue lies with VirtualBox, when the machine is given more than 1 processor it fails to properly mount any USB device. The only fix I have found to work is to simply reduce the number of processors back to 1. Once it’s returned the USB devices work simply by mounting them the usual way, from the VirtualBox menu > Devices > USB Devices >.

If anyone find a better solution, be sure to comment below.

Categories
Command Line HowTo Linux Ubuntu

what(): Serial Port failed to open: open: Permission denied

what():  Serial Port failed to open: open: Permission denied

Trying to get access to your serial port without the need for running whatever program as sudo or root? You’re probably not in the dialout group, if that’s the case, here’s the fix:

First, check you aren’t in the group:

groups alex

This will list all the groups the user is in, here the user is called ‘alex’, just substitute that for your own username. If the output doesn’t contain the dialout group, keep going. If it does, you might have another issue which this isn’t likely to solve.

sudo gpasswd --add alex dialout

This command will add the user ‘alex’ to the ‘dialout’ group. Once that’s done you’ll need to logout and back in again for the effects to take place.

Categories
Fedora HowTo Linux Ubuntu

Team Fortress 2 Segmentation Fault – Steam for Linux

After getting invited to join the Steam Beta for Linux, (after weeks of using the bypass) I decided to get playing some TF2. After the long install and download I booted it up. The Value splash screen with the tap-guy loads and the menu begins to load, but once it has finished, the game closed and returned to my desktop.

So I tried again, but this time ran steam through terminal in order to get some error messages. The following is what I found to occur when the game crashed:

response: CrashID=bp-ca59d62f-9c2b-47e4-8cd9-9d0b02121212
/home/alex/Steam/SteamApps/username/Team Fortress 2/hl2.sh: line 72: 4811 Segmentation fault ${GAME_DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@"
Game removed: AppID 440 "Team Fortress 2", ProcID 4811
saving roaming config store to 'sharedconfig.vdf'
roaming config store 2 saved successfully

To fix it, there’s a pretty simple solution. This is to add the option “-nojoy” to the launch options of the game:

  1. Right click Team Fortress 2 in the Library pane of Steam.
  2. Click “Properties”.
  3. Click “Set Launch Options”
  4. Add the following: -nojoy
  5. Hit OK and launch the game, everything should be working!

If you’re running Fedora, some folk have found anotherĀ solution to this fix, if the previous doesn’t work:

sudo setsebool -P allow_execheap 1

Where it seems SELinux isn’t allowing the game to start for whatever reasons.

 

Categories
C/C++ Command Line Linux Programming Ubuntu

fatal error: curl/curl.h: No such file or directory | Ubuntu 12.04

fatal error: curl/curl.h: No such file or directory

If you’re missing the curl/curl.h header file, chances are you’re just missing the correct dev package file for the curl library.

sudo apt-get install libcurl4-gnutls-dev

That should fix it.

Categories
Command Line Linux Ubuntu

Ubuntu 12.04 – Removing conflicting operating system files…

If you’re trying out the latest version of Ubuntu, 12.04 or Precise Pangolin and you want to keep your old /home partition, chances are you’ve come across the installation hanging on a process “Removing conflicting operating system files…”. No worries, this seems to be a common bug and there’s a pretty easy work around.

Continue with the installation, without asking for the /home partition to be mounted. Only set the root partition (/) and your swap space.

Once the installation is complete, reboot and load it up.

Now, you’ll want to find the partition that /home is mounted under, this will likely be /dev/sdxN, where x is the drive letter and N is the partition number (i.e mine is located under /dev/sda5).

If you’re unsure, you can list the possible drives using the following command:

ls /dev/ | grep sd

And then you can mount each drive under in a temp directory and check what’s in there:

mkdir temp
mount /dev/sda1 temp

Once you know which partition you want, it’s time to edit your /etc/fstab/

sudo gedit /etc/fstab

For those who don’t go digging around in the config files of linux, this may look pretty daunting, but it isn’t. All you really need to do is add a new line to mount your home partition. Here’s mine:

/dev/sda5	/home/		ext4	defaults	1	2

The first part is the partition that’s being used, next what the partition is. Next is the file system type. Followed by default options and then the dump and pass values.

Once you’ve saved this file with the appended line, reboot your system. Now you should find your old home partition is mounted normally and you can get on with your install.

Categories
Linux Ubuntu

AL lib: pulseaudio.c:331: PulseAudio returned minreq > tlength/2; expect break up – Ubuntu 11.10

./blender
connect failed: No such file or directory
ndof: spacenavd not found
AL lib: pulseaudio.c:331: PulseAudio returned minreq > tlength/2; expect break up
Floating point exception

Download and install the associated package to your processor from here : https://launchpad.net/ubuntu/oneiric/+package/python-openal

Restart your computer and the issue should now be resolved.