Archive for May, 2006
Update or Install Applications on Debian/Ubuntu Without an Internet Connection
27Update: There is a simpler way for the Ubuntu 6.10(Edgy Eft) users:
Simple Way to Update Ubuntu Edgy With Slow/No Internet Connection
If you use a Debian based system(Ubuntu etc) with a slow/no Internet connection, you will be limited to installing only those applications that come with the installation CD/DVD set. The issue is more serious with Ubuntu like operating systems where there is only one installation CD/DVD. But there is a way in which the required files can be downloaded on a machine with fast Internet connection and then copied over to your local machine(using a media like CD etc) and make them available to the Advanced Package Manager(apt). Below is the complete procedure to do the same.
Note to Ubuntu users: You need to add “sudo” before all the commands specified below.
- On your local machine, run the following command to generate a list of files needed for the application(s) you wish to install:
sh# apt-get –qq ––print-uris install {packagelist} | awk -F\‘ ‘{ print $2}‘ > get.lst
- The URIs from where to download all the files needed to install the packages listed in {packagelist} will be added to the get.lst file. Copy this file over to the machine with fast Internet connection and run the following commnad there:
sh# wget -c -i get.lst
This will download all the .deb files listed in get.lst file in the current directory. Copy all these .deb files to your local machine in a directory, say /root/sharedebs.
- Move to /root directory and run the following command:
sh# dpkg-scanpackages sharedebs /dev/null | gzip > sharedebs/Packages.gz
- Now add the following line to your /etc/apt/sources.list file:
deb file:/root sharedebs/
Run the command ‘apt-get update’ once to update the apt cache.
Now you can install the applications in the normal way by running the
‘apt-get install’ command or using Synaptic Package Manager like tools.
You can also use the above procedure to share the .deb files that you have downloaded on your machine to install any applications with another machine(say your friend’s machine) if you want to install the same applications on it without having to download the same .deb files again. Just copy all your .deb files from /var/cache/apt/archives/partial/ to your friend’s machine(in /root/sharedebs directory) and follow the steps from Step 3 on your friend’s machine.
Here is an example of how you can install the package lynx on your local machine using the above procedure:
- On local machine:
sh# apt-get -qq ––print-uris install lynx | awk -F\‘ ‘{ print $2 }‘ > get.lst
sh# cp get.lst /media/cdrom
sh# umount /media/cdrom - Copy the file get.lst to the machine with fast Internet connection(using a CD etc):
sh# mkdir /home/user/debs
sh# cp /media/cdrom/get.lst /home/user/debs
sh# cd /home/user/debs
sh# wget -c -i get.lst
sh# cp *.deb /media/cdrom
sh# umount /media/cdrom - Copy all the .deb files to the local machine(again, using CD etc) in
/root/debshare directory:sh# mkdir /root/debshare
sh# cp /media/cdrom/*.deb /root/debshare
sh# cd /root
sh# dpkg-scanpackages sharedebs /dev/null | gzip > sharedebs/Packages.gz - Add a line in the /etc/sources.list file and install the application using apt-get:
sh# emacs -nw /etc/apt/sources.list
deb file:/root sharedebs/
sh# apt-get update
sh# apt-get install lynx
Update: If you are getting errors with the above awk command, you can try with a perl script. More details in this comment.
Update or Install Applications on a Gentoo Machine Without an Internet Connection
2If you use Gentoo on a computer that doesn’t has a fast Internet connection, you can still update it or install new applications on it, by downloading files on a different system that has a fast Internet connection and then copying them to your machine using media like CD, DVD or a USB Pen Drive. The complete procedure is given below.
- Download the following shell script and copy it to the home directory of the local machine:
shotsync.sh
If the browser displays the contents of the file, use File->Save As… menu item to save the file. Or right-click on the link and select “Save Target/Link as…” from the context menu.
We’ll need this script in Step 4. - Also download the following file on the machine with fast Internet connection:
dist-grabber.pyMake the file executable and place it in a directory that is in the system PATH.
sh# chmod +x distfile-grabber.py
sh# mv distfile-grabber.py /usr/binWe’ll need this script file in Step 6.
- On the machine that has a fast Internet connection, download the latest snapshot of the portage tree from:
Gentoo Portage SnapshotsLet’s call this file ‘snapshot.tar.bzip’.
- Copy this file in the home directory of the local machine. From the home directory on the local machine, run the following command:
sh# shotsync.sh snapshot.tar.bzip
(we had downloaded the shotsync.sh file in Step 1)
- On the local machine, create a list of files to be downloaded on the other machine using the following command:
sh# emerge -uDp –fetchonly world 2> /tmp/distfiles.txt
(that’s two hyphens(-) for ‘fetchonly’ option)
(replace ‘world’ with a package name if you don’t want to do a complete upgrade: sh# emerge -uDp –fetchonly lynx 2> /tmp/distfiles.txt )
- Copy the file generated in the above step(distfile.txt) to the machine with good Internet connection. Run the following command to download all the packages specified in the distfile.txt file:
sh# distfile-grabber distfiles.txt
(we had downloaded distfile-grabber.py script in Step 2)
- Copy all the above downloaded files into the /usr/portage/distfiles directory of the local machine. Then perform the final installation using the following command:
sh# emerge -uD world
(If you had used a package name in Step 5, use the same here too: sh# emerge -uD lynx)
Repeat Steps 3-7 at regular intervals to keep your Gentoo system updated. If you only want to install applications without doing a complete update of the portage tree(eg. its already updated), you can just follow Steps 5-7 by replacing ‘world’ with the name of the package.
Whenever you need to copy a file from local machine to the machine with fast Internet connection or vice versa, you can use any suitable media like CD, DVD, USB Pen Drive, Portable Hard disk etc.
More info: Gentoo Wiki
All the scripts mentioned in this post are taken from this source.
NOTE 1:
If the machine with fast Internet connection uses the Windows operating system, you can still use the dist-grabber.py script to download the packages, provided you have Python installed on that system(and is in the environment path). If you instead have Perl installed on the system, you can make use of the following perl script for the same job:
dist-grabber.pl
NOTE 2:
If you would rather use wget to download the package files, then get the required URLs, convert the URL list to wget format & then get the package files:
sh# cat list.txt | sed ‘s/\shttp:/\nhttp:/gi’ | sed ‘s/\sftp:/\nftp:/gi’ > wgetlist.txt
sh# wget -i wgetlist.txt -nc
(that’s two hyphens(-) for ‘pretend’ and ‘fetchonly’ options)
Why I Moved My Blog From WordPress.com
0Finally I had decided to move my WordPress.com blog to my own domain a couple of weeks ago. My reasons for taking up this decision were as follows:
- No direct access to the theme/template files in WordPress.com. After some time, it started to look very restrictive not to be able to add even a single line to customize the look and feel of the blog(though the customization of the sidebar through widgets was a welcome addition). Only a few themes were available and either they didn’t have the colours that I like or they did not utilize the screen space efficiently. I love the theme(clasikue) you currently see on this blog very much and I can apply whatever customizations I like to it!
- Upload limitations. Total storage available is around 20MB, only files under 1.5MB size can be uploaded and files of many types(eg:mp3) cannot be uploaded at all!!
- Poor statistics. I did not like the default visitor tracking software of WordPress.com – it always showed more number of hits than what was suggested by the referral list. Either the hit count was wrong or the referral list did not show all the referrals.
- Ability to add one’s own plugins. Not that I missed the functionality of a lot of plugins at WordPress.com, as I prefer to travel as light as possible anyway, still I would have loved to install some of my favourite ones. Like a syntax highlighter, comment quoter, related posts link generator, recent posts in the sidebar, random quote generator etc.
- No way to backup the entire database of my posts. I could only export the feeds in RSS format(for posts and the comments). How to restore them if I ever want to go back to a previous state?
And many other similar restrictions prompted me to finally take the blog to my own domain, which will allow me to have more control over it. It also means that I have to take care of everything now – installations, maintenance, backup, restore etc. I will miss the community feel of the WordPress.com too!!
What I had thought as a simple enough procedure turned out to be slightly more work for me in the end. The installation of WordPress itself, and the task of importing the posts into the new blog went like a breeze. Had to manually move the comments by copying and pasting and then editing the time stamps by hand. Even for ~10 comments it looked like a huge task!! Adding the tag line to the header in clasikue theme wasn’t straightforward either. Because clasikue converts every first letter of a word/sentence to lower case, titles of all the recent posts read more like a single paragraph; after a lot of experiments, I had to add the ~ character to separate one title from the other.
The final task was to create a styling for the programming language code and the shell commands: the first of these tasks was made simpler by the excellent plugin called iG:Syntax Hiliter and I had to add a new style manually to make shell commands standout. Installation of StatCounter and Google Analytics code was made simpler by the plugins created for the same purpose. I am yet to decide whether or not I need the WP-Cache plugin and also something to manage the uploaded images and other such files.
Recent Comments