Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Tuesday, February 10, 2009

Install Softwares on Ubuntu without Internet Connection

When installing ubuntu, it's a must that you have an internet connection when installing softwares since the software packages are downloaded from ubuntu's repositories.

But what if you installed ubuntu on a PC that is not directly connected to the internet?

there is hope.. this post is all about this.. Installing Softwares on Ubuntu without Internet Connection. (atleast without your PC directly connected to the internet).

you'll be needing a couple of things:
  1. your PC where ubuntu is installed (no internet connection)
  2. another PC which is connected to the internet (good if ubuntu is installed here as well, if not, you can always run ubuntu using liveCDs)
  3. usb flash drives (you'll use this to copy your downloaded packages)
  4. Ubuntu LiveCD (incase the PC connected to the internet has windows installed on it)

Upating your PC

Assuming your PC is newly installed with Ubuntu, you need to update it: meaning download all files needed by ubuntu for it to know all the location of softwares (and also the list of softwares)

on your terminal, do this: (in case you don't know where the terminal is, see this link)
sudo apt-get update -qq --print-uris |cut -d\' -f 2 > upgradelist.txt
That command will generate a file named "upgradelist.txt" which contains a list of files to be downloaded later on the PC with internet connection. On my pc upgradelist.txt looks like this:

Copy that file (upgradelist.txt) on your usb flash drive.


Downloading the Upgradelist.txt

Boot the PC with internet connection using a Ubuntu LiveCD (or using an ubuntu installed on usb flash drive). Then, copy the file "upgradelist.txt" on a folder on the desktop, and name it Upgrade.

on the terminal do this:
cd Desktop/Upgrade

wget -i upgradelist.txt -x
The last command will download all the files on directories. On my PC it downloaded files and put them on three directories:
  1. ph.archive.ubuntu.com
  2. security.ubuntu.com
  3. wine.budgetdedicated.com
Don't worry if we don't have the same directories.

Copy those directories on your usb flash drives, and bring them on your PC without internet connection.


Updating your PC with the downloaded files

Now that you've downloaded the files, we need to put them on your PC and let Ubuntu know where they are. Press ALT+F2 and type
gksu nautilus
That command will open a file manager with root (admin) privileges. Using this file manager, copy all the downloaded directories on the root directory under a directory named localrep.

This is equivalent to doing
sudo mkdir /localrep
in your terminal

The following figure shows my downloaded directories under localrep directory.

Next, we'll be editing the file where the original repositories are listed. Using the file manager with Root privileges, go to
/etc/apt/
and look for the file "sources.list"

Make a duplicate copy of that file and name it "sources.list.bak" (right-click on the file, copy, and then paste). It is important that you are using a file manager with Root privileges to be able to do this.

Incase something goes wrong, you'll be needing that file.

Next, right-click the file and select "Open with Text Editor..." (again it is also important that you are using a file manager with Root privileges to be able to do this)

(again you can open a file manager with root privileges by pressing alt+f2, then typing gksu nautilus)

Using the Replace button, replace all http:/ on that file with file:/localrep.

For instance, the line that says
deb http://security.ubuntu.com/ubuntu hardy-security main restricted
should be renamed to
deb file:/localrep/localrep/security.ubuntu.com/ubuntu hardy-security main restricted
see the following figure for reference

Next, we tell ubuntu to use those lines, instead of the original ones. On your terminal do this
sudo apt-get update
Or
under System>Administration>Synaptic Package Manager, click on Reload.

Your PC is now ready to generate a download script file for any software you wish to install.


Selecting the Software Package to be installed

As an example we will be downloading vlc (a multimedia player).

On the Synaptic Package Manager, search for vlc, click on it, and on the pop-up that shows, select Mark for Installation. If it asks you to Mark Additional Required Changes, simply select Mark.

(don't click on Apply yet)

Under File, click on Generate package download script. This will generate a script that will be used to download all the files needed to install vlc on your machine. Save the script as downloadscript.sh.

But first, we need to edit that downloadscript.sh file, and replace some things.

Since that file was created with Root privileges, we also need a text editor with Root privileges in order to edit it. Press ALT+F2, and type
gksu gedit
A text editor will show up, open downloadscript.sh, and replace all instances of "file:/localrep" with "http:/".

Your file should look like this:


Save and Copy that file on your usb flash drive.


Downloading the Packages

Copy the downloadscript.sh on the PC with internet connection under a folder named VLC.

on your terminal, go to the director where the script is saved (in the folder named VLC), and do this
./downloadscript.sh
It will begin to download all the packages needed to install vlc.

After downloading, copy all the .deb files on a folder (or better, copy the entire folder VLC) into you usb flash drive.


Installing the Downloaded Packages

On your PC, fire up the Synaptics Package Manager, by going to System>Administration>Synaptics Package Manager.

Select again vlc, click, and then select Mark for Installation. If it asks you to Mark Additional Required Changes, simply select Mark.

Still under the Synaptics Package Manager, click on Add Downloaded Packages. Go to the directory where the downloaded packages are, click Open. And it will ask you to Apply the Following Changes? simply click on Apply.

vlc will now be installed.


Do the same process if you will need to install any other software.

enjoy!

Sunday, February 8, 2009

Opening a Terminal

Terminals are where you type in commands in linux.

to open a terminal, press ALT+F2, then either type
gnome-terminal
or
xterm
for the classic terminal

Installing KiCad on Ubuntu

If you are an electronics enthusiast, this is a must application for you. It is used to create schematic captures, PCB designs, and create 3D views of the PCB designs.





you can install kicad from the repository by typing
sudo apt-get install kicad
in the terminal. Where the terminal is? see this link.

but, the installed version is not the latest one. so here is a guide on how to install an updated KiCad.


Installing the required softwares and dependencies


we need to install the following: debhelper, dpatch, libx11-dev, libglu1-mesa-dev, libgl1-mesa-dev, mesa-common-dev, libwxbase2.8-dev, libwxgtk2.8-dev, libboost-dev, subversion, cmake (>= 2.6.0)

to install on ubuntu, on the terminal, simply type
sudo apt-get install debhelper dpatch libx11-dev libglu1-mesa-dev libgl1-mesa-dev mesa-common-dev libwxbase2.8-dev libwxgtk2.8-dev libboost-dev fakeroot subversion libboost-serialization-dev
and finally, we need cmake, but we need atleast version 2.6, the one from the repository is not the updated one (atleast for ubuntu 8.04). You can download version 2.6 from here..

but if what the repository gives you is atleast version 2.6, then simply
sudo apt-get install cmake

Getting the Source Codes


we will be getting the source codes through svn. create a directory where you'll be downloading the source codes, and go to that directory. type the following:
svn checkout https://kicad.svn.sourceforge.net/svnroot/kicad/trunk/kicad kicad

svn checkout https://kicad.svn.sourceforge.net/svnroot/kicad/trunk/kicad-doc kicad-doc

svn checkout https://kicad.svn.sourceforge.net/svnroot/kicad/trunk/kicad-library kicad-library
also we need the following
svn checkout http://svn.flexserv.de/kicad/trunk/debian

Compiling


to compile simply do the following on your terminal (make sure you're still in the same directory where you did the svn)
fakeroot debian/rules binary
hopefully, there will be no errors.


Running KiCad

You'll find the compiled version of KiCad on
debian/kicad/usr/bin/
to complete things up, you'll need to copy the following folders
debian/kicad-common/usr/share/kicad/library
debian/kicad-common/usr/share/kicad/modules
debian/kicad-common/usr/share/kicad/template
in here
debian/kicad/usr/share

again, to run KiCad go to
debian/kicad/usr/bin/

and double click KiCad

enjoy!!

Saturday, February 7, 2009

Installing MakeHuman on Ubuntu

MakeHuman is a software application that generates 3D humanoids; similar to Poser or DazStudio. If you need a human model, and want to make it as fast as possible (or simply you don't know yet how to do one), maybe you need this software.



the instructions in this post are based on the instructions from this page.

First, install the software needed to compile. You'll be needing (atleast) the softwares to be installed by the following commands. in your terminal (press ALT+F2, then type xterm). see this link.
sudo apt-get install freeglut3-dev
sudo apt-get install xorg-dev
sudo apt-get install libpng12-dev
Second, download the following files from this link and save anywhere on your drive (say /home/your_account_name/makehuman)
  • animorph-xx.tar.gz
  • makehuman-xx.tar.gz
  • mhgui-xx.tar.gz
Third, extract the downloaded files, by right-clicking on them and select Extract Here.

Fourth, we now compile.. but first open again a terminal (ALT+F2, type xterm) and then cd to the directory where you extracted the downloaded files.
cd makehuman

first,compile and install the animorph..
cd animorph-xx
./configure
make
sudo make install

In first time we must run ldconfig so that MakeHuman can find animorph and mhgui libraries::

and then the mhgui..
cd ..
cd mhgui-xx
./configure
make
sudo make install

and lastly the makehuman...
cd ..
cd makehuman-xx
./configure
make
sudo make install
and after everything went well, we can now execute makehuman, but first we must run ldconfig so that MakeHuman can find animorph and mhgui libraries
sudo ldconfig

and then,finally run makehuman
makehuman
makehuman
makehuman will now open a window.

Lastly, to create a shortcut button on your desktop, we will create a launcher. anywhere on your desktop, right click and select Create Launcher... on the command type makehuman.

and there you go, you have now a button on your desktop for the makehuman.

enjoy!