Wednesday, December 29, 2010
Friday, March 06, 2009
Ubuntu and offline software installation
I often find myself working with systems that are not connected to the internet. Many of these systems are running Ubuntu and I find myself wishing I had installed a particular package after the disconnect has occurred. Since network access is not an option, I was looking for an easy approach to identifying all dependencies for a particular package, downloading them and burning them to a CD for offline installation. It turns out that this is not as easy as one might like.
The first problem is package dependencies can be recursive. If A requires B and B requires C, then a recursive dependency search is required. Software installation apps such as apt-get and aptitude are adept at resolving these dependencies, but it is not helpful to me since the target system is offline. I took a look at http://packages.ubuntu.com and indeed, the package descriptions do offer dependency identification based upon distribution version as well as architecture.
I went about developing a script that, given a package name, an architecture, and a distribution version (i.e. hardy), gets a list of all first-order dependencies. From there, it pulls in the dependencies recursively until a complete list has been developed. Given this list of dependencies, I can extract a download URL for the package of interest as well as all dependencies.
Unfortunately, there is a significant problem with this approach. First, most packages have dependencies such as libc and glibc that are common to even a minimal Ubuntu install. In some cases, these common default packages can inflate the dependency list substantially. Since my offline system already has these packages, I would like to avoid tracking them if possible.
To avoid this problem, I modified the script to only list package dependencies from the "Universe" repository. Since it is easy to acquire a DVD containing most packages from the "Main" repository, this should allow the script to only identify packages that would not likely be in a base install without burning the entire Universe repo to media.
In any case, the script is located here: http://github.com/rmjokers/helpful-scripts/blob/1085f5419bea93df0ca06cdbfffb6fa202c3ed0d/uupd.py
It is a work in progress, but serves its purpose for me at the moment :)
Update: After a few use cases, I have decided to remove the Universe-only dependency resolution. It does not identify packages from Main that are not in the default install media, which are required for offline installs.
New version here: http://github.com/rmjokers/helpful-scripts/blob/7e389a83e469e06f57d72b0f085a70b4c8955bef/updr.py
The first problem is package dependencies can be recursive. If A requires B and B requires C, then a recursive dependency search is required. Software installation apps such as apt-get and aptitude are adept at resolving these dependencies, but it is not helpful to me since the target system is offline. I took a look at http://packages.ubuntu.com and indeed, the package descriptions do offer dependency identification based upon distribution version as well as architecture.
I went about developing a script that, given a package name, an architecture, and a distribution version (i.e. hardy), gets a list of all first-order dependencies. From there, it pulls in the dependencies recursively until a complete list has been developed. Given this list of dependencies, I can extract a download URL for the package of interest as well as all dependencies.
Unfortunately, there is a significant problem with this approach. First, most packages have dependencies such as libc and glibc that are common to even a minimal Ubuntu install. In some cases, these common default packages can inflate the dependency list substantially. Since my offline system already has these packages, I would like to avoid tracking them if possible.
To avoid this problem, I modified the script to only list package dependencies from the "Universe" repository. Since it is easy to acquire a DVD containing most packages from the "Main" repository, this should allow the script to only identify packages that would not likely be in a base install without burning the entire Universe repo to media.
In any case, the script is located here: http://github.com/rmjokers/helpful-scripts/blob/1085f5419bea93df0ca06cdbfffb6fa202c3ed0d/uupd.py
It is a work in progress, but serves its purpose for me at the moment :)
Update: After a few use cases, I have decided to remove the Universe-only dependency resolution. It does not identify packages from Main that are not in the default install media, which are required for offline installs.
New version here: http://github.com/rmjokers/helpful-scripts/blob/7e389a83e469e06f57d72b0f085a70b4c8955bef/updr.py
Monday, October 20, 2008
SSH on Inspiron 910
Just received my Dell mini running Ubuntu Linux 8.04 about a week ago. Everything has been working great except for SSH over wireless. I found a description of the problem, as well as a fix here:
https://bugs.launchpad.net/ubuntu/+source/linux-restricted-modules/+bug/259816
Essentially, this command fixes the problem:
sudo iwpriv eth1 set_vlanmode 0
Apparently, a patch has been checked into the kernel upstream :)
https://bugs.launchpad.net/ubuntu/+source/linux-restricted-modules/+bug/259816
Essentially, this command fixes the problem:
sudo iwpriv eth1 set_vlanmode 0
Apparently, a patch has been checked into the kernel upstream :)
Thursday, October 02, 2008
More on the HVR-950
Starting with Ubuntu Intrepid Ibex, support for the Hauppauge HVR-950 is included directly in the Linux kernel. This means that the lengthy procedure spelled out in my previous post are no longer needed to enjoy HD OTA television on your desktop. Unfortunately, the firmware is not included, so you must follow these instructions to download it, extract it, and move it to the correct directory:
http://www.linuxtv.org/wiki/index.php/Xceive_XC3028/XC2028#How_to_Obtain_the_Firmware
Much thanks to this post for steering me in the right direction:
http://www.mail-archive.com/em28xx@mcentral.de/msg01522.html
With this fix, I can now use the tuner on my backend MythTV setup!
http://www.linuxtv.org/wiki/index.php/Xceive_XC3028/XC2028#How_to_Obtain_the_Firmware
Much thanks to this post for steering me in the right direction:
http://www.mail-archive.com/em28xx@mcentral.de/msg01522.html
With this fix, I can now use the tuner on my backend MythTV setup!
Sunday, September 14, 2008
McCain's Tax "Decrease" compared to Obama's
Monday, August 18, 2008
Don't forget the fudge!
To set up a local NTP server, these two lines are very important:
server 127.127.1.1
fudge 127.127.1.1 stratum 8 refid NIST
Friday, August 15, 2008
US Airways Sucks
After spending 1 hour on the plane waiting to take off because there were thunderstorms in the area 4 hours prior, I thought my red-eye flight home couldn't be worse. However, with 15 minutes remaining before boarding the flight home, I heard an announcement that the "first officer" was still waiting to board his flight from PHOENIX to LAS VEGAS, so we would be waiting for at least an hour. Apparently the flight from the adjacent gate had most of its crew aboard that flight as well, so they were also delayed an hour. Thanks US Airways for wasting 400 man hours of time!
Friday, June 13, 2008
saving bandwidth
Installed a new tool today called apt-cacher. This tool acts as a proxy for apt and related tools, caching all Debian packages downloaded. Thus, when multiple clients download the same package, it is only downloaded from the internet once, speeding up the process and keeping the internet fast.
Friday, May 30, 2008
DVD Issues
Well, I just purchased a Philips DVP5990 DVD player last weekend. It has some nice features, including the ability to play DIVX movies from an external USB drive.
I spent the past 2 hours trying to connect the player to my TV through HDMI. I tried 3 different cables, all of which gave me a horrible picture that looked like something out of an old four color CGA monitor from the 1980s. I tried upgrading the firmware, jiggling the wires and changing settings all to no avail. Finally, one step away from returning the player for a replacement, I tried unplugging the unit for a few minutes. After turning it back on, all of the color problems have disappeared. The player appears to be functioning normally. Apparently, not even a reboot after upgrading the firmware was sufficient to fix this bug...
I spent the past 2 hours trying to connect the player to my TV through HDMI. I tried 3 different cables, all of which gave me a horrible picture that looked like something out of an old four color CGA monitor from the 1980s. I tried upgrading the firmware, jiggling the wires and changing settings all to no avail. Finally, one step away from returning the player for a replacement, I tried unplugging the unit for a few minutes. After turning it back on, all of the color problems have disappeared. The player appears to be functioning normally. Apparently, not even a reboot after upgrading the firmware was sufficient to fix this bug...
Friday, May 09, 2008
Compressed Time
I've been having trouble with VMWare guests losing clock ticks to the extent that the guest OS clock runs approximately half-speed compared to the host. This is with an Ubuntu Server host OS and a Debian Etch guest OS. I found that adding these settings to /etc/vmware/config:
Fixed the timing issues as well as the boundless supply of timing errors showing up on the host in /var/log/messages:
Thanks to the following for inspiration:
http://jackshck.livejournal.com/117486.html
tools.timeSync = "TRUE"
host.useFastClock = "FALSE"
monitor_control.virtual_rdtsc = "FALSE"
Fixed the timing issues as well as the boundless supply of timing errors showing up on the host in /var/log/messages:
rtc: lost some interrupts at 512Hz.
Thanks to the following for inspiration:
http://jackshck.livejournal.com/117486.html
Thursday, March 27, 2008
misunderstandings
This is a wonderfully written statement:
http://my.barackobama.com/page/community/post/hopewagner/gGBRVV
What is it about human nature that inspires us to pass judgment expediently and without regard for consequences? I wonder if anyone anywhere can claim that no 20 second sound byte over the span of their entire life could be construed as offensive, particularly when taken out of context?
http://my.barackobama.com/page/community/post/hopewagner/gGBRVV
What is it about human nature that inspires us to pass judgment expediently and without regard for consequences? I wonder if anyone anywhere can claim that no 20 second sound byte over the span of their entire life could be construed as offensive, particularly when taken out of context?
Wednesday, March 19, 2008
addendum
I'd just like to go on record saying that I vote democrat, but if Hilary somehow steals the nomination from Obama, I will be voting for Ralf Nader or none-of-the-above :(
negativity
The conservative movement in this nation never ceases to amaze me. One of the most remarkable speeches of the 21st century was delivered yesterday and it fell upon many deaf ears. What is it about fear that a near majority of people in this country find it so enticing? It is the same fear that allowed popular opinion to sway toward the lies of our fearless president, whose trillion dollar mistake is commemorated today. "The troop surge is working." You have nothing to fear. Except black ministers...
Thursday, February 07, 2008
Invalid Checksums
Apparently, there is a checksum offload engine in my laptop's network card. Unfortunately, this engine doesnt work, at least with the latest Ubuntu release (Gutsy).
The problem manifests itself as a continuous stream of bad UDP checksum errors when monitoring network traffic with Wireshark. In particular, every DNS request my system sent had an invalid checksum error. I did not bother to check for the same problem with other traffic types. In any case, I found a bug report describing this exact issue:
https://bugs.launchpad.net/ubuntu/+source/libpcap/+bug/31273
Apparently it is very easy to turn off the checksum offload feature using this command:
After this modification, my packets are no longer broken!
The problem manifests itself as a continuous stream of bad UDP checksum errors when monitoring network traffic with Wireshark. In particular, every DNS request my system sent had an invalid checksum error. I did not bother to check for the same problem with other traffic types. In any case, I found a bug report describing this exact issue:
https://bugs.launchpad.net/ubuntu/+source/libpcap/+bug/31273
Apparently it is very easy to turn off the checksum offload feature using this command:
sudo ethtool -K eth0 rx off tx off
After this modification, my packets are no longer broken!
Thursday, January 10, 2008
Linux and the HVR 950
Just purchased a Hauppauge WinTV-HVR-950, which is essentially a small USB device that acts as an analog / digital television tuner. Not only can one tune into new digital over-the-air broadcasts, but also HD programming as well. Using a home-made DB2 antenna, I am able to pull in 31 digital channels including 6 HD channels. This was a very pleasant surprise :)
My ultimate goal is to connect this tuner to my PC and the PC to my old HD television so that I can get over-the-air digital channels and rid myself of cable. I attempted to get the tuner working with Ubuntu 7.10 (Gutsy) using this guide ( http://lunapark6.com/usb-hdtv-tuner-stick-for-windows-linux-hauppauge-wintv-hvr-950.html)
This guide ( http://parker1.co.uk/mythtv_ubuntu.php) was also helpful in my attempt to set up MythTV. Unfortunately, I did not succeed in getting the software to work. I may try again at a future date. I was able to get the tuner to work with a few simple command line utilities though. I installed the following packages in Ubuntu:
These utilities allowed me to scan all digital channels identified by the receiver. The scan takes a few minutes, so be patient. Also look at the other example scan files in the dvb-utils directory. Another may be more directly applicable, depending upon your location and interests.
This gives output like the following to a file called channels:
Dont be surprised if you get allot of output on the command line...it complained about every unavailable channel for me. The information above includes the name of the channel, frequency, and encoding. To tell the tuner to tune into a channel, use a command like the following:
Note that we are using 'azap' (for ATSC digital programming). See http://www.linuxtv.org/wiki/index.php/Zap for more information.
Finally, the following command will stream the output of the tuner directly to mplayer for display on the screen:
I have successfully tuned into standard and HD digital broadcasts using this simple technique.
My ultimate goal is to connect this tuner to my PC and the PC to my old HD television so that I can get over-the-air digital channels and rid myself of cable. I attempted to get the tuner working with Ubuntu 7.10 (Gutsy) using this guide ( http://lunapark6.com/usb-hdtv-tuner-stick-for-windows-linux-hauppauge-wintv-hvr-950.html)
This guide ( http://parker1.co.uk/mythtv_ubuntu.php) was also helpful in my attempt to set up MythTV. Unfortunately, I did not succeed in getting the software to work. I may try again at a future date. I was able to get the tuner to work with a few simple command line utilities though. I installed the following packages in Ubuntu:
dvb-utils, dvbsnoop, dvbstream, dvbtune
These utilities allowed me to scan all digital channels identified by the receiver. The scan takes a few minutes, so be patient. Also look at the other example scan files in the dvb-utils directory. Another may be more directly applicable, depending upon your location and interests.
sudo /usr/bin/scan /usr/share/doc/dvb-utils/examples/scan/atsc/us-ATSC-center-frequencies-8VSB > channels
This gives output like the following to a file called channels:
WBFF-HD:665028615:8VSB:49:52:3
Good TV:665028615:8VSB:65:68:4
Dont be surprised if you get allot of output on the command line...it complained about every unavailable channel for me. The information above includes the name of the channel, frequency, and encoding. To tell the tuner to tune into a channel, use a command like the following:
azap -r -c channels "Good TV"
Note that we are using 'azap' (for ATSC digital programming). See http://www.linuxtv.org/wiki/index.php/Zap for more information.
Finally, the following command will stream the output of the tuner directly to mplayer for display on the screen:
mplayer /dev/dvb/adapter0/dvr0 -cache 8192 -framedrop -vo x11
I have successfully tuned into standard and HD digital broadcasts using this simple technique.
Friday, December 14, 2007
Installed Packages
I've been searching for an easy way to itemize all installed packages on a Debian / Ubuntu system, but just found it today. To list all installed packages,
Now, you can use this list to re-install an existing system or duplicate its configuration on a new system:
Finally, run deselect to make the selection changes take effect!
Thank you to Ubuntu Forums for the answer: http://ubuntuforums.org/showthread.php?t=261366
dpkg --get-selections > installed-software
Now, you can use this list to re-install an existing system or duplicate its configuration on a new system:
dpkg --set-selections < installed-software
Finally, run deselect to make the selection changes take effect!
dselect
Thank you to Ubuntu Forums for the answer: http://ubuntuforums.org/showthread.php?t=261366
Monday, December 03, 2007
Finishing my previous thought
After expanding the virtual disk and the partition, simply run resize2fs on the device of interest and the filesystem (EXT2 or EXT3) will be expanded to occupy the full extent of the partition :)
Virtual Disks
Expanding a virtual disk in VMWare is very simple:
Just remember that you still have to expand the partition and the filesystem living on that partition as well. Thanks to http://4sysops.com/archives/expanding-a-virtual-vmware-disk/ for the information!
vmware-vdiskmanager -x 10GB myDisk.vmdk
Just remember that you still have to expand the partition and the filesystem living on that partition as well. Thanks to http://4sysops.com/archives/expanding-a-virtual-vmware-disk/ for the information!
Monday, October 29, 2007
a simple reminder
Two things today...first, a simple way to determine how much work you are causing your laptop harddrive:
sudo smartctl -a /dev/sda | grep Load_Cycle_Count
Apparently anything above 600000 means your drive is about to kick the bucket :(
I've always wanted an easy way to pop up a reminder message at some point in the future from the command line on a Linux system. I wonder why it took me so long to find the answer?
echo "DISPLAY=$DISPLAY zenity --info --text='go home'" | at "5pm"
sudo smartctl -a /dev/sda | grep Load_Cycle_Count
Apparently anything above 600000 means your drive is about to kick the bucket :(
I've always wanted an easy way to pop up a reminder message at some point in the future from the command line on a Linux system. I wonder why it took me so long to find the answer?
echo "DISPLAY=$DISPLAY zenity --info --text='go home'" | at "5pm"
Thursday, October 25, 2007
another vim trick
Just found this amazing tip which allows VIM to automatically open a GPG encrypted text file, edit it, and save it back to disk in encrypted form without writing the unencrypted data to a buffer. Thank you Wouter Hanegraaff!
Subscribe to:
Posts (Atom)
