ubuntu

manually updating java in ubuntu

Below is outlined the process of updating to the latest JDK in ubuntu and updating the alternatives link manually to point the the latest java:

Step 1: Download:

wget http://download.oracle.com/otn-pub/java/jdk/7u15-b03/jdk-7u15-linux-x64.tar.gz
cd /usr/lib/jvm/
tar -xzf ~/downloads/jdk-7u15-linux-x64.tar.gz

Step 2: If java-7-sun already exists, the below is all that is needed if not skip to step 3 if this is the first time it is setup:

unlink java-7-sun
ln -s jdk1.7.0_15 java-7-sun

Step 3: If java-7-sun link does not already exists:

ln -s jdk1.7.0_15 java-7-sun
update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/java-7-sun/bin/java" 1
update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/java-7-sun/bin/javac" 1
update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/usr/lib/jvm/java-7-sun/jre/lib/amd64/libnpjp2.so"; 1
update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/java-7-sun/bin/javaws" 1

Step 4: Choose the java just installed as default:

update-alternatives --config java
update-alternatives --config javac
update-alternatives --config javaws
update-alternatives --config mozilla-javaplugin.so

Wireless Ad-Hoc connection sharing in Ubuntu 10.10

  • dnsmasq-base has to be installed:

    sudo apt-get install dnsmasq-base

  • Remove dnsmasq because it conflicts with NetworkManager:

    sudo apt-get remove dnsmasq

  • Restart NetworkManager:

    sudo /etc/init.d/network-manager restart

  • Add a new wireless network with NetworkManager (left-click on NetworkManager icon, then select "Create New Wireless Network").
  • Set encryption to WEP 40/128-bit Key with a 13 characters key. (Note: You may have to experiment here according to what type of encryption with ad-hoc the device supports. WPA is not supported).
  • NetworkManager now should connect to itself (which means it creates the ad-hoc wireless network and routes any Internet traffic to your wired network interface). Now, connect with the client(s), and you should have a working Internet connection.
  • You have to make sure that this connection is shared to other computers and devices (clients). Make sure that the Connect automatically check-box is selected and on the IPv4 Settings tab make sure that the Method option is set to "Shared to other computers".

HP Deskjet F2430 printing in Ubuntu-9.10

Although the printer HP Deskjet F2430 was automatically detected upon usb connection to my ubuntu-9.10 desktop, the 3.9.8 version of hplip that came via apt repository did not quite get printing to work.

I headed off to hplipopensource.com, downloaded and installed the latest driver (version 3.9.12 as of this writing) and got the all-in-one printer to work just following the install wizard.

I have yet to test the scanner... but that's going to be another update.

sysstat in ubuntu

If you apt-get install sysstat, and sar returns:

Cannot open /var/log/sysstat/sa27: No such file or directory

Sar needs to be enabled before it can be used. The error message in this case is completely useless, and the solution I have found is as below:

Enable sysstat data collection by doing

# dpkg-reconfigure sysstat

or manually by changing value of ENABLED from "false" to "true" in "/etc/default/sysstat".

Then start sysstat via:

# /etc/init.d/sysstat start

Check "/var/log/sysstat/" for the missing file.

Run sar after about 10 minutes to see the collected data.

# sar -A

Debian / Ubuntu command notes for packages and service maintenance ...

APT-GET

  • Clean up non-existent data
    # apt-get autoclean
  • Update list
    # apt-get update
  • Install/update a package
    # apt-get install <pkg>
  • review dist-upgrade prior:
    # apt-get -Vsu -o Debug::pkgProblemResolver=yes dist-upgrade
  • Apply updates
    # apt-get -Vu upgrade
  • Upgrade all dependencies
    # apt-get -Vu dist-upgrade
  • Search cache
    # apt-cache search <pkg>
  • Remove and purge packages
    # apt-get --purge remove <pkg>

DPKG

  • Install/Update package
    # dpkg -i <pgk>
  • Check listing of installed packages
    # dpkg -l *<pkg>*
  • file belongs to
    # dpkg --search /path/to/file
  • List of file in package
    #dpkg -L <pkg>
  • Info about package
    # dpkg -s <pkg>

SERVICES

  • Manage services at init levels.
    # sysv-rc-conf
    # update-rc.d
Comment