reinstall Ubuntu 9.04

Now, I reinstall Ubuntu 9.04 with CD after damage this OS when testing Mac OS X.

During installation process,
- I choose to set partition manually.(I have 3 partitions such as vista, data and one for this installation.)
- format with ext4 file system.

After installation finished,
I see other partition from Windows Vista Business and can map drive. (This good for copy and others.)

I’m happy. :)
I can choose Vista and Ubuntu at Grub.

C++ on Ubuntu 9.04

I want to test C++ on Ubuntu 9.04.

So, follow this post from www.ubuntugeek.com. This post said that………

If you are a developer you need C and C++ Compiler for your development work. In Ubuntu you can install the build-essential for C and C++ compilers.

Install C and C++ Compilers in Ubuntu

sudo aptitude install build-essential

This will install all the required packages for C and C++ compilers

Testing C and C++ Programs

  • Compiling Your first C Programs

Now you need to open first.c file

sudo gedit first.c

add the following lines save and exit the file

#include <stdio.h>
int main()
{
printf(“Hello, World!\n”);
return 0;
}

Firstly compile the code using the following command

cc -c first.c

that would produce an object file you may need to add to the library.
then create an executable using the following command

cc -o first first.c

Now run this executable using the following command

./first

Output should show as follows

Hello, world

  • Compiling your first C++ program

If you want to run c++ program follow this procedure
g++ is the compiler that you must use.
you should use a .cpp file extension rather than a .c one
You need to create a file

sudo gedit first.cpp

add the following lines save and exit the file

#include <iostream>
int main()
{
std::cout << “Hello, World!” << std::endl;
return 0;
}

Run your C++ Program using the following command

g++ first.cpp -o test

./test

Output should show as follows

Hello World!

And I test on my Toshiba laptop.

thanwinnaing@thanwinnaing-laptop:~$ sudo apt-get install build-essential
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
dpkg-dev g++ g++-4.3 libstdc++6-4.3-dev patch
Suggested packages:
debian-keyring g++-multilib g++-4.3-multilib gcc-4.3-doc libstdc++6-4.3-dbg
libstdc++6-4.3-doc diff-doc
The following NEW packages will be installed:
build-essential dpkg-dev g++ g++-4.3 libstdc++6-4.3-dev patch
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 6270kB of archives.
After this operation, 21.4MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.tcc.edu.tw jaunty/main libstdc++6-4.3-dev 4.3.3-5ubuntu4 [1356kB]
Get:2 http://ftp.tcc.edu.tw jaunty/main g++-4.3 4.3.3-5ubuntu4 [4162kB]
Get:3 http://ftp.tcc.edu.tw jaunty/main g++ 4:4.3.3-1ubuntu1 [1438B]
Get:4 http://ftp.tcc.edu.tw jaunty/main patch 2.5.9-5 [100kB]
Get:5 http://ftp.tcc.edu.tw jaunty/main dpkg-dev 1.14.24ubuntu1 [643kB]
Get:6 http://ftp.tcc.edu.tw jaunty/main build-essential 11.4 [7172B]
Fetched 6211kB in 9min 57s (10.4kB/s)
Selecting previously deselected package libstdc++6-4.3-dev.
(Reading database … 103569 files and directories currently installed.)
Unpacking libstdc++6-4.3-dev (from …/libstdc++6-4.3-dev_4.3.3-5ubuntu4_i386.deb) …
Selecting previously deselected package g++-4.3.
Unpacking g++-4.3 (from …/g++-4.3_4.3.3-5ubuntu4_i386.deb) …
Selecting previously deselected package g++.
Unpacking g++ (from …/g++_4%3a4.3.3-1ubuntu1_i386.deb) …
Selecting previously deselected package patch.
Unpacking patch (from …/patch_2.5.9-5_i386.deb) …
Selecting previously deselected package dpkg-dev.
Unpacking dpkg-dev (from …/dpkg-dev_1.14.24ubuntu1_all.deb) …
Selecting previously deselected package build-essential.
Unpacking build-essential (from …/build-essential_11.4_i386.deb) …
Processing triggers for man-db …
Setting up patch (2.5.9-5) …
Setting up dpkg-dev (1.14.24ubuntu1) …
Setting up libstdc++6-4.3-dev (4.3.3-5ubuntu4) …
Setting up g++-4.3 (4.3.3-5ubuntu4) …
Setting up g++ (4:4.3.3-1ubuntu1) …

Setting up build-essential (11.4) …
thanwinnaing@thanwinnaing-laptop:~$

But, I test with this code only for C++ which is the same above. :)

#include<iostream>
using namespace std;
int main()
{
cout << “Hello, World!” << endl;
return 0;
}

GPG error in Ubuntu 9.04

ကျွန်တော်က အခုမှ Linux ကို ဒီ Ubuntu 9.04 ကစသုံးဖူးတာ။ (ကျွန်တော်လို စသုံးတဲ့လူတွေများ အသုံးဝင်မလားလို့ ဒီ post ကိုတင်ပါတယ်ဗျာ။)

9.04 ထွက်တော့မယ် ဆိုကတည်းက download လုပ်ဖို့စောင့်ပြီး download လုပ်၊ install လုပ်တော့လည်း ကိုစေတန် ရဲ့ စာအုပ်လေးဖတ်ပြီး Vista တစ်ခြမ်း Ubuntu တစ်ခြမ်းလုပ်တာ အဆင်ပြေနေရော။ တစ်ခါ ကိုစေတန်ရဲ့ blog က post ဖတ်ပြီး extra တွေကို ဒါလေး terminal ထဲရိုက်ပြီး install လုပ်။

sudo apt-get install ubuntu-restricted-extras

တစ်ခါ ဇော်ဂျီဖွန့်ကို box02 ရဲ့ zawgyi-keyboard-ubuntu904.tar.gz ကိုသုံးပြီး install လုပ်တာလဲ အဆင်ပြေ နေဆဲပဲ။ ဒီလို အဆင်ပြေပြေ သုံးလို့ရနေတော့ firefox လေးသုံးပြီး web surf လုပ်လိုက်၊ Pidgin လေးသုံးပြီး chat လိုက်နဲ့ ငါတော့ Ubuntu ကိုသုံးတတ်သွားပြီ ဆိုပြီး ပျော်နေတာပေါ့။

ဒါပေမယ့် ဘာဖြစ်တယ် မသိဘူး လွန်ခဲ့တဲ့ ၁၀ ရက်ကျော်လောက်က စပြီး update လုပ်တဲ့ နေရာမှာ problem စဖြစ်တော့တာပဲ။ box02 ကို gtalk မှာတွေ့တော့ အဲဒီအကြောင်းပြောပြီး ဘယ်လိုလုပ်ရမလဲ မေးရတယ်။ သူပြောတဲ့အတိုင်း လုပ်ကြည့်တယ် အဲဒီအချိန်တုန်းကတော့ ကွန်နက်ရှင်ကြောင့်လို့ ထင်ခဲ့တယ် မပြေလည်ခဲ့ဘူး (box02 ကျေးဇူးပါဗျာ)

ဒါနဲ့ Ubuntu forum မှာလဲ ဝင်မေးကြည့်တယ် ဒီ post နဲ့ပေါ့။ သူတို့ပေးတဲ့ အဖြေကလဲ မပြေလည်ဘူးဗျ။ ဒီမှာ ကျွန်တော် သတိထားမိတာက အားလုံးက Terminal ကနေပဲ လုပ်ခိုင်းနေကျတယ်။ windows မှာလို application setting ကနေ ရှင်းလို့ မရဘူးလားပေါ့။

၁. ဒါနဲ့ system -> administration -> Update Manager ကိုဖွင့်ပါတယ်။ Update Manager ရဲ့ setting ကိုဖွင့်တော့ ထုံးစံအတိုင်း password တောင်းတယ်၊ password ရိုက်လိုက်တော့ Update Manager ရဲ့ software sources window ပွင့်လာပါတယ်။

၂. အဲဒီအထဲမှာ tap ငါးခုရှိတယ်၊ Ubuntu software tap ရဲ့ download from: မှာ drop down list ကိုနှိပ်ပါတယ်။

၃. other ကိုရွေး၊ choose a download server window ပေါ်လာရင် selet best server ကိုနှိပ်တယ်။ သူ့အလိုလို ရွေးနေတယ်။ ကျွန်တော့်မှာတော့ နည်းနည်း ကြာတယ်ဗျ။

၄. ကျွန်တော့်ကိုတော့ ဒီ http://ftp.tcc.edu.tw/linux/ubuntu ဆိုတဲ့ server ကိုရွေးပေးတယ်။

၅. close ကိုနှိပ်လိုက်တာနဲ့ update manager ကအလုပ်စလုပ်ပါပြီ။ ဘာ error မှမပြတော့ပါ။ အခုတော့ အရင်လိုပဲ firefox လေးနဲ့ web surf လုပ်လိုက်၊ Pidgin လေးနဲ့ chat လိုက်နဲ့ ပြန်အဆင်ပြေနေတယ်ဗျို့။ :)

Ubuntu 9.04

Last week, I download and install Ubuntu 9.04  on my Toshiba Satellite M200 notebook.

Download time is too long for 699 Mb in Myanmar.

Today when I browse Mysteryzillion, I found to get Ubuntu restricted extras. :)

1. Open “Terminal” from Applications=>Accessories=>Terminal.

2. My Ubuntu is up to date because of using update manager. Thus tpye

sudo apt-get install ubuntu-restricted-extras

3. This show:

thanwinnaing@thanwinnaing-laptop:~$ sudo apt-get install ubuntu-restricted-extras
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
cabextract flashplugin-installer flashplugin-nonfree freepats
gstreamer0.10-pitfdll gstreamer0.10-plugins-bad
gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly-multiverse libass1
libavcodec-unstripped-52 libavutil-unstripped-49 libcdaudio1 libcelt0 libdc1394-22
libdca0 libenca0 libfaac0 libfaad0 libffado0 libfftw3-3 libfreebob0 libgmyth0
libiptcdata0 libjack0 liblrdf0 libmjpegtools-1.9 libmms0 libmodplug0c2 libmp3lame0
libmpcdec3 libmysqlclient15off libneon27-gnutls libofa0 libopenspc0 libquicktime1
libraptor1 libsoundtouch1c2 libwildmidi0 libx264-65 libxml++2.6-2 libxvidcore4
mysql-common raptor-utils ttf-liberation ttf-mscorefonts-installer unrar
Suggested packages:
konqueror-nsplugins msttcorefonts ttf-xfree86-nonfree xfs libfftw3-dev jackd
liblrdf0-dev
Recommended packages:
w32codecs
The following packages will be REMOVED:
libavcodec52 libavutil49
The following NEW packages will be installed:
cabextract flashplugin-installer flashplugin-nonfree freepats
gstreamer0.10-pitfdll gstreamer0.10-plugins-bad
gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly-multiverse libass1
libavcodec-unstripped-52 libavutil-unstripped-49 libcdaudio1 libcelt0 libdc1394-22
libdca0 libenca0 libfaac0 libfaad0 libffado0 libfftw3-3 libfreebob0 libgmyth0
libiptcdata0 libjack0 liblrdf0 libmjpegtools-1.9 libmms0 libmodplug0c2 libmp3lame0
libmpcdec3 libmysqlclient15off libneon27-gnutls libofa0 libopenspc0 libquicktime1
libraptor1 libsoundtouch1c2 libwildmidi0 libx264-65 libxml++2.6-2 libxvidcore4
mysql-common raptor-utils ttf-liberation ttf-mscorefonts-installer
ubuntu-restricted-extras unrar
0 upgraded, 47 newly installed, 2 to remove and 0 not upgraded.
Need to get 42.4MB of archives.
After this operation, 59.4MB of additional disk space will be used.
Do you want to continue [Y/n]? Y

4. When I type “Y” and enter, download and installation process begin.

But, very slow connection. (start at 7:15 PM ; finished at 8:27 PM) :)