Archive for the ‘ubuntu’ Category
Sunday, October 3rd, 2010
UUID is a nice way to generate (almost) unique id’s.
However on PostgreSQL 8.3 the data type exists, but if you wish to be able to generate UUID’s you need to get a module (in this case uuid-ossp).
On Debian this module is in the contrib package, so if you have not installed this before do it now
user@server:~$ sudo apt-get install postgresql-contrib
Then you need to “load” the module into PostgreSQL; or more accurately you tell PostgreSQL about the new functions this module has, how to reach them etc.
Depending on you security settings (in pg_hba.conf) you may need to log in as the postgres user on your system.
postgres@sever:~$ psql -d MYDB -U postgres -f /usr/share/postgresql/8.3/contrib/uuid-ossp.sql
Tags: debian, Postgres, PostgreSQL, PostgreSQL module, ubuntu, uuid
Posted in debian, PostgreSQL, ubuntu | No Comments »
Friday, October 1st, 2010
First off, quick explanation.
Suspend saves a image to ram. It is faster to save and reload; but the computer uses a minimal amount of energy to keep this in ram. If the power is lost (battery is drained etc) then the image is lost.
Hibernate save a image to disk. It is slightly slower to save and reload; but there is no problem if the power is lost.
However I am not the only one that have noticed that hibernate/suspend on Ubuntu does not work on a default installation.
One solution that more than me have found to be working is to switch to uswsusp.
user@laptop$ sudo apt-get install uswsusp
user@laptop$ sudo s2disk
s2disk does a hibernation (s2ram does a suspend); and it is good to test it out before swapping the hibernate/suspend function.
When you know hibernate/suspend works, you can swap to using uswsusp by using:
user@laptop$ sudo dpkg-divert --rename --divert /usr/sbin/pmi-disabled /usr/sbin/pmi
If you later on would like to swap back you can use
user@laptop$ sudo dpkg-divert --rename --remove /usr/sbin/pmi
Tags: hibernate, suspend, ubuntu
Posted in ubuntu | No Comments »
Tuesday, June 8th, 2010
apt-get is verifying the packages before installing them.
If the keys are not up to date, then apt-get upgrade will issue a warning.
WARNING: The following packages cannot be authenticated!
ure uno-libs3
Install these packages without verification [y/N]?
The way to solve this is rather simple, just run apt-get update and it should download the keys automatically.
apt-key handles keys, using apt-key list will show you the keys that are on the computer.
Tags: apt-get, debian, ubuntu
Posted in debian, ubuntu | 1 Comment »
Thursday, May 27th, 2010
Sometimes it is nice to limit the download speed of apt-get.
The way I do this is to create a file “/etc/apt/apt.conf.d/76download” and enter the following to it
Acquire{Queue-mode "access";http{Dl-Limit "50";};};
This will limit apt-get to at most 50 kb/s for apt-get.
Some other how to’s suggest the use of dl-limit but be adviced, dl-limit is per each connection apt-get does (normally it does 2 at a time); the one used above caps apt-get in total.
Tags: apt-get
Posted in debian, ubuntu | No Comments »
Wednesday, March 17th, 2010
- Check out “/etc/update-manager/release-upgrades” to make check out what sort of releases you wish to use (lts/normal/or never upgrade)
# default behavior for the release upgrader
#
[DEFAULT]
# default prompting behavior, valid options:
# never - never prompt for a new distribution version
# normal - prompt if a new version of the distribution is available
# lts - prompt only if a LTS version of the distribution is available
Prompt=normal
- Make sure the (current) dist is up to date. Problems are not guaranteed if you don’t – but they are likely
- apt-get update
- apt-get upgrade
- Make sure the upgrade tool is installed (and up to date) “apt-get install update-manager-core”
- do-release-upgrade
- Follow the instructions
Tags: distribution, do-release-upgrade, ubuntu, upgrade, version
Posted in ubuntu | No Comments »
Thursday, February 18th, 2010
netstat can be used to figure out what program is using a port.
$ netstat -nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1096/sshd
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1733/apache2
tcp6 0 0 :::22 :::* LISTEN 1096/sshd
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 2 [ ACC ] STREAM LISTENING 6338 1071/gdm-simple-sla @/tmp/gdm-greeter-LvjLQPzT
unix 2 [ ACC ] STREAM LISTENING 5165 1072/X /tmp/.X11-unix/X0
If you have a lot open then grep can be used to only find what you are looking for
netstat -nlp|grep :22
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1096/sshd
tcp6 0 0 :::22 :::* LISTEN 1096/sshd
For windows, simply start with
Tags: ipv4, ipv6
Posted in debian, linux, ubuntu, unix, windows | No Comments »
Tuesday, February 16th, 2010
If running apt-get (or aptitude) and you get the following error:
$ apt-get update
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the list directory
Then (most likely) explenation is that one of the sources have gotten a timeout and that a (cron) sheduled update task have gotten locked.
A simple solution for this is to find the cron process is locked, and kill it.
$ ps -a |grep apt
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
3737 ? SN 0:00 /bin/sh /etc/cron.daily/apt
3833 ? SN 0:00 apt-get -qq -y update -o APT::Update::Auth-Failure::=cp /usr/share/apt/apt-auth-failure.note /var/lib/update-notifier/user.d/
3835 ? SN 0:00 /usr/lib/apt/methods/http
3838 ? SN 0:00 /usr/lib/apt/methods/http
3842 ? SN 0:00 /usr/lib/apt/methods/http
3869 ? SN 0:00 /usr/lib/apt/methods/http
4223 pts/0 R+ 0:00 grep apt
$ kill -9 3833
If this happens often, then perhaps you should try to debug the sources and remove (or exchange) the source that is causing the problems.
Tags: apt-get, ubuntu
Posted in debian, ubuntu | 1 Comment »
Thursday, February 11th, 2010
Use visudo to edit /etc/sudoers
user host = NOPASSWD: /bin/kill, /bin/ls, /usr/bin/lprm
user, host and or the list of commands to be run can be swapped with the keyword ALL.
However that is probably not a good idea in most cases.
more info on this is in the manpages sudoers(5)
Tags: sudo, visudo
Posted in debian, linux, ubuntu | 1 Comment »
Wednesday, February 10th, 2010
Most of the time this error occurs that is a bad disk or a bad drive (or a bad cable).
Ubuntu 8.10 seams (from own experience and google) to be commonly affected by this.
You can try the following (I try them in this order)
- If you only get buffer errors and no CRC errors, just try and wait (a few minutes) It might still be possible to install
- Try another installation CD [from the same installation image] – if this works, then the other disk is bad
- Try to swap out the cable to the drive (if you have a ribbon cable use one with 80 connectors, not one with 40)
- Try to swap out the drive
- Try another installation CD [from another installation image, old version, other dist, windows] – if this works then there is an issue with the installation image – there might be an issue worth reporting
If all this fails or you wish to install the version you have, then using a usb stick to install the image might be a good idea.
Tags: I/O error, install, installing
Posted in ubuntu | No Comments »
Tuesday, February 9th, 2010
apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
bind9-host dnsutils libbind9-50 libdns50 libisc50 libisccc50 libisccfg50 liblwres50 linux-generic linux-generic-pae linux-image-generic
linux-image-generic-pae
0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.
The message has been kept back most often means that the upgrade was kept back due to dependencies that are not met.
Some possible solutions
- A simple way is to invoke dselect to help out with the update. dselect performs the actions necessary to realize that state (for instance, the removal of old and the installation of new packages).
- While apt-get and aptitude are basically the same, aptitude is sometimes better at handling dependencies than apt-get
- Another solution is to install the package using apt-get install to install the upgraded package and let apt-get install the missing dependencies
Tags: apt-get, aptitude, debian, ubuntu
Posted in debian, ubuntu | No Comments »