64 Bit - Ubuntu: Questions and Answers (2014)

Ubuntu: Questions and Answers (2014)

64 Bit

Questions

Q: Why does Ubuntu Download recommend 32-bit install?

Tags: 64-bit (Next Q)

Update for 13.10: 64-bit version is now the default and 32-bit is labelled "for machines with less than 2GB RAM"

The Ubuntu desktop download screen has a pair of radio buttons you use to select whether you wish to download the 32-bit or 64-bit version. The 64-bit version is labeled "Not recommended for daily desktop usage." If you have a 64-bit processor, why would you not want to use the 64-bit version of Ubuntu?

Update for 10.10: They've removed the "Not recommended" label from the 64-bit version and added a "Recommended" label to the 32-bit version.

Update for 11.04: Same as 10.10.

Update for 12.04: Still says "Recommended" next to 32-bit version of desktop

Update for 12.10: 32-bit version of desktop is still default, says "recommended"

Update for 13.10: 64-bit version is now the default and 32-bit is labelled "for machines with less than 2GB RAM"

Tags: 64-bit (Next Q)

User: warren-pena


Answer by marco-ceppi

This is actually just a mis-wording of sorts. According to LaunchPad Bug #585940 It's meant to convey that typical desktops are 32-bit whereas more recent desktops are 64-bit. Since the 32bit install will always work on both 32bit and 64bit machines it remains "recommended."


Answer by bryce

I used to use 64bit Ubuntu on my desktop, and 32bit on my laptops. For the most part I saw no differences, but there were some small niggles:

· As mentioned above, Flash historically hasn't been very well supported on 64bit. I didn't think I'd care about this, but actually this was a fairly major annoyance for me. I ended up using the 32bit version of flash, manually installed. Recently Adobe has put out a 64-bit Flash, so possibly this is a thing of the past (I haven't tested it yet).

· Java (and other software) on 64bit uses more memory, and this can have some performance impacts. I don't use much java so haven't really experienced this issue but guess it's pretty well known.

· It used to be that a lot more people ran 32bit than 64, so once and a while you'd run into a 64-bit specific problem that would tend to take a long time to get fixed. This has gotten a LOT better in recent years though, but for someone that really wants everything to Just Work, you might prefer 32-bit.

· 64bit means that memory pointers can address higher amounts of memory. If your system has 4gig or more of RAM memory, and you use apps that need lots of RAM, that can be a reason for using 64bit. However, in recent years the PAE kernels for i386 have become standard, and these do permit addressing >4gig.

· If you're a developer and you run 64-bit, you can build both 32-bit and 64-bit executables fairly easily (e.g. with pbuilder). Building 64-bit binaries on 32-bit seems not possible (well, at least not without jumping through some hoops).

[Update 12.04] Just recently I've reinstalled the amd64 version of 12.04, and find it a lot better than it was when I originally wrote the above. I've not tested Java but Flash is definitely working as well as it had on 32bit. Also, completely anecdotally but it seems like people are running 64-bit more often than 32-bit these days.


Answer by steve-beattie

One disadvantage to running the 32bit version non-PAE kernel is that your processes aren't protected with the CPUs non-executable (NX) bit, which can make it easier for attackers attempting to exploit flaws in software. See the Security Team's Features discussion on it for more details. In recent Ubuntu releases, there's an emulation mode, but it's of limited effectiveness.

Also, the randomization space available for things like Address Space Layout Randomization (ASLR) is much, much smaller when using 32 bits, potentially to the point of being brute forcible.


Tags: 64-bit (Next Q)


Q: What are the differences between 32-bit and 64-bit, and which should I choose?

Tags: 64-bit (Next Q)

What is the difference between 32-bit and 64-bit Ubuntu? I've heard the 64-bit platform performs better and can detect more than 4GB of RAM. Also, while some apps haven't ported to 64-bit yet, ia32-libs lets a 64-bit machine run them.

If so, why not promote 64-bit over 32-bit?

Tags: 64-bit (Next Q)

User: squallbayu


Answer by sergey

I believe the main question when choosing between 32 and 64 bits is not "Does my processor support 64 bits if so then I should use 64 because that's twice as good", but "How much memory do I have?".

64-bit programs use about 50% more memory then their 32-bit counterparts. The results of this are:

· less code/data can fit into processor caches -> more cache misses -> your super-fast processor waits more for memory controller to fetch data from RAM. Processor also needs to read more data because it's more bloated.

· Linux uses non-allocated RAM to cache disks. Less free memory available -> less space for disk caches -> slower disk access

· Once you're out of RAM and the system starts swapping - disk access is thousands times slower than RAM, so any potential benefits of 64-bit code (see below) are flying out of window.

On the other hand, in 64-bit mode processor has more registers, so it doesn't need to access memory that often, also, some calculations (64-bit numbers etc.) are more efficient. So generally, code which is not memory-restricted runs slightly faster in 64-bit mode.

So, if your system has, say, 2GiB of RAM or less then I would definitely choose 32 bits. More than 4GiB - the benefits of 64 bits are becoming more prominent. Around 4GiB is a "grey zone" - you need to make a choice yourself.

Here are screenshots of a (rather old) vanilla Ubuntu running in a VirtualBox with 1GiB RAM:

32 bit: uses 388 MiB of RAM right after booting, no additional applications running (from the screenshot, 397780KiB, which is 388MiB)

32 bit Ubuntu

64 bit: uses 491 MiB of RAM (from the screenshot, 503452KiB = 491MiB)

64 bit Ubuntu

Additionally, in my testing, a web-application written in Python used up to 60% more memory on a 64-bit machine which resulted in a test suite running in 380 secs on a 32-bit machine but taking 523 seconds on a 64-bit one (both with 1GiB of RAM). If the machines were not RAM-limited the results would likely be different (as phoronix tests show).

Here are some more thorough and recent tests: http://kernel.ubuntu.com/~cking/x32/Quantal-x32-power-memory-comparisons.ods

mem freemem usedswap used

Basically, it's like giving up 30% of your RAM in exchange of possible gain of 10% CPU speed.


Answer by mario

If you don't care to learn the technical details, select the recommended 32-bit version.

64-bit is generally faster, even if objectively hard to notice. This is has less to do with the 64-bit data width, but with the availability of 16 over 8 common CPU registers on the whole instruction set. The disadvantage of wasting more memory for management and larger pointers is thereby mostly levelled out.

The practical problem: not everyone has a AMD64 compatible CPU. Promoting 64-bit over the standard i686 version would lead to more user frustration. Therefore for the next few years, it's less confusing to present the 32-bit version to the average user. It's not exactly a problem for anyone in the know, since the 64-bit version is readily available. And we amd64 users don't have any disadvantage from that situation, except for the initial download. All packages are available in both architectures.

Under the circumstances the Ubuntu download page looks okay to me. It says "32 bit (recommended)", but that "recommended" translates to "fewer issues, if you don't know all the technical details of your computer". For the netbook edition download page, there isn't even the choice, because some Intel atom CPUs are 32-bit only even in 2010!
So in conclusion, I think eschewing the compatibility problems is still necessary. However, I agree that there should be at least a shiny footnote along the lines that -64 is faster than -32, and recommended IF (BUT ONLY IF) the target system supports it.


Answer by mitch

The terms 32-bit and 64-bit refer to the way a computer's CPU handles information. The 64-bit version handles large amounts of RAM more effectively than a 32-bit system. 1

· To run a 64-bit OS you need support from the 64-bit CPU.

o To run a 64-bit application you need support from both the 64-bit OS and the 64-bit CPU.

The general rule is that 32-bit (OS and Application) will run on 64-bit, but 64-bit (OS and Application) does not run on 32-bit:

· A 32-bit OS will run on a 32-bit or 64-bit processor without any problem.

· A 32-bit application will run on a 32-bit or 64-bit OS without any problem.

· But a 64-bit application will only run on a 64-bit OS and a 64-bit OS will only run on a 64-bit processor.

A 64-bit compatible CPU is needed to install a 64-bit OS. Check with the manufacturer of your PC to find out if your system is 64-bit compatible.

32-bit systems have a 4 Gigabyte RAM memory limit, which means they cannot address more than 4GB of RAM even if more is installed on the system (Not all of it will be used). Workarounds are available, but hard to do for an average user.

Note: Ubuntu 12.10, and newer will support PAE automatically. Prior to 12.10, you have the option to choose PAE support depending on your CPU. PAE extends maximum RAM on 32-bit to 64GB, more inforamtion can be found here.

64-bit editions have additional advantages, including an increased bandwidth, hardware enabled DEP (data execution prevention) and better Kernel protection.

The majority of 32-bit applications will continue to work on a 64-bit systems, but some applications do not work at all, or will run slower.

For more information you can look at 32-bit and 64-bit

1Source: Microsoft


Tags: 64-bit (Next Q)


Q: Problems with Eclipse and Android SDK

Tags: 64-bit eclipse (Next Q)

I installed Eclipse, openjdk6 and downloaded and extracted the sdk manager file.

Now, When I created an Android project I got the following error:

2012-06-06 18:44:40 - contactManager] /home/catia/android-sdks/platform-tools/aapt:

error while loading shared libraries: libz.so.1: cannot open shared object file:

No such file or directory

And this one when I tried to create an AVD Manager:

[2012-06-06 19:00:18 - SDK Manager] /home/catia/android-sdks/tools/mksdcard: error

while loading shared libraries: libstdc++.so.6: cannot open shared object file: No

such file or directory

[2012-06-06 19:00:18 - SDK Manager] Failed to create the SD card.

[2012-06-06 19:00:18 - SDK Manager] Failed to create sdcard in the AVD folder.

Tags: 64-bit eclipse (Next Q)

User: csbl


Answer by eliah-kagan

This problem is occurring because the Android SDK is compiled for a 32-bit GNU/Linux system, and your Ubuntu system is a 64-bit GNU/Linux system. The solution should be easy (since Ubuntu fully supports running 32-bit programs on a 64-bit OS)--just install the 32-bit versions of the libraries it needs.

The simplest and easiest way to do this is to install the 32-bit versions of all the most commonly used libraries, by installing the ia32-libs Install ia32-libspackage. You can do this in the Software Center or in the Terminal with:

sudo apt-get update

sudo apt-get install ia32-libs

Originally ia32-libs was provided because Ubuntu, in its default configuration, didn't support installing 32-bit Ubuntu packages on a 64-bit system. Now that this is fully supported by default, the ia32-libs package just causes the same 32-bit packages to be installed on your 64-bit system that would be installed on a minimal 32-bit system. (So for anyone who is worried this might not work now that multarch is supported by default: it still works.)

Source: Android/Eclipse Installation on Ubuntu 11.04 - aapt and adb not working properly
See also: Eclipse Android Plugin libncurses.so.5


Answer by martin-konecny

If you are using Debian Jessie (or Ubuntu 13.10+), try

sudo apt-get install lib32stdc++6


Answer by ether_joe

This thread was the fix for me.

Specifically, installing this package:

sudo apt-get install lib32z1 lib32z1-dev


Tags: 64-bit eclipse (Next Q)


Q: Why does Ubuntu Download recommend 32-bit install?


Q: Is it possible to "upgrade" from a 32bit to a 64bit installation?


Q: What are the differences between 32-bit and 64-bit, and which should I choose?


Q: Problems with Eclipse and Android SDK


PHP

Skip to questions, Wiki by user itsols

PHP initially stood for Personal Home Page but as it evolved into a full-fledged server-side language, it was renamed with a recursive title "PHP Hypertext Pre-processor".

The languages uses a syntax simliar to conventional C, but it has its own set of functions.

Being a server-side language, PHP cannot receive user inputs. However, inputs sent from a program such as a web browser can be received by PHP on the server.

After PHP version 5, the language became truly object-oriented. Other languages that fall into the same category include

· ASP (Active Server Pages) - a more Windows-oriented language.

· JSP (Java Server Pages)

From the inception, PHP has been used with MySQL for building database applications. Both being open-source tools, have made the duo like bread and butter. However, in recent years, more DB platforms have got popular with PHP and these include MS-SQL Server, PostgreSQL and more.


Questions

Q: How do I install curl in php5?

Tags: php (Next Q)

I currently have PHP 5.3 installed with Apache in 10.04 Lucid. How can I add the PHP Curl libraries? Do I need to install any other dependencies for curl?

Tags: php (Next Q)

User: darren-newton


Answer by kfro

I believe that the package php5-curl should do the trick. Use the package manager of your choice and the deps should be taken care of.

sudo apt-get install php5-curl

You will need to restart the server afterwards:

sudo service apache2 restart

Alternatively, if you are using php-fpm, you'll need to restart php5-fpm instead

sudo service php5-fpm restart


Tags: php (Next Q)


Q: What is the easiest way to enable PHP on nginx?

Tags: php

What is the easiest way to enable PHP on nginx on Ubuntu 12.04?

Best solution is the one that request minimal work, ideally just a package installation :)

Tags: php

User: sorin


Answer by papashou

The following method will get you started fast on Ubuntu 12.04:

Install the dependences:

sudo apt-get install php5-common php5-cli php5-fpm

Install nginx:

sudo apt-get install nginx

Start nginx:

sudo service nginx start

Test that it's working (should see "Welcome to nginx!")

sudo service nginx stop

In your nginx site configuration (/etc/nginx/sites-available/default), uncomment the lines in the server {} section starting with

listen for ipv4 / ipv6 both.

scroll down to where it says "location ~ .php {" and uncomment lines so it looks like this:

location ~ \.php$ {

fastcgi_split_path_info ^(.+\.php)(/.+)$;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

include fastcgi_params;

}

sudo service php5-fpm restart sudo service nginx restart

Your default web root is located at /usr/share/nginx/www (per the config file). (See root /usr/share/nginx/www;

(Note: For Ubuntu 12.10 or newer, you will need to replace the fastcgi_pass 127.0.0.1:9000; line with this to make it work: fastcgi_pass unix:/var/run/php5-fpm.sock;)


Answer by olibre

The answer of @papashou is correct.

As I use Ubuntu 12.10, the configuration is a bit different. Here is what I did:

Install

sudo apt-get install nginx php5-fpm

Enable PHP

Uncomment the following lines in configuration file /etc/nginx/sites-available/default

Skip code block

location ~ \.php$ {

fastcgi_split_path_info ^(.+\.php)(/.+)$;

# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

# # With php5-cgi alone:

# fastcgi_pass 127.0.0.1:9000;

# With php5-fpm:

fastcgi_pass unix:/var/run/php5-fpm.sock;

fastcgi_index index.php;

include fastcgi_params;

}

Start (or restart)

sudo service php5-fpm restart

sudo service nginx restart

Test nginx

Opening this link http://localhost should display "Welcome to nginx!"

Test php

Create a php file:

> grep -w '^[^#]*root' /etc/nginx/sites-available/default

root /usr/share/nginx/www;

> cd /usr/share/nginx/www

> sudo su

# echo '<?php phpinfo(); ?>' > info.php

Opening http://localhost/info.php should display the PHP information page.


Tags: php


Q: What's the easiest way to set up a LAMP stack?


Q: How do I install curl in php5?


Q: How do I install latest PHP in supported Ubuntu versions (like 5.4.x in Ubuntu 12.04)?


Q: What is the easiest way to enable PHP on nginx?