Skip to content

Instantly share code, notes, and snippets.

@squidpickles
Last active September 4, 2019 14:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save squidpickles/55755aeb869ff315260618578934ddc5 to your computer and use it in GitHub Desktop.
Save squidpickles/55755aeb869ff315260618578934ddc5 to your computer and use it in GitHub Desktop.
uscan and uupdate howto

uscan and uupdate howto

Post by cjstm » Tue Mar 31, 2009 1:06 am

So you have ampache-3.4.4-0ubuntu1 installed and you want to give 3.5x a try, but wait 3.5 is not in the archives yet? Or better yet, you have PHP-5.2.6-0ubuntu1 installed and a newer version of PHP has come out and you want it now and not 6 months from now when the next release of Ubuntu comes out. Well the nice people at Debian/Ubuntu have developed a couple of tools to help you out. uscan and uupdate, which are part of the devscripts package, will help you update ANY Ubuntu/Debian package that has a watch file.

The first thing we need to do is install some needed packages.

sudo apt-get install devscripts build-essential

Next we need to get the source package and for this we need to know the IP address of the .dsc file, I will use Ampache as an example. We use dget -xu to do this. The -xu will unpack the package for you.

dget -xu http://archive.ubuntu.com/ubuntu/pool/universe/a/ampache/ampache_3.4.4-0ubuntu1.dsc

Now you should now have

  • ampache-3.4.4
  • ampache_3.4.4-0ubuntu1.dsc
  • ampache_3.4.4-0ubuntu1.diff.gz
  • ampache_3.4.4-0ubuntu1.orig.tar.gz

Now change directories to the top of the source tree

cd ampache-3.4.4

Now we run uscan to get the new ampache-3.5-beta1 source

sudo uscan

You should get some output that looks like this

desktop:~$ sudo uscan
ampache: Newer version (3.5-beta1) available on remote site:
	http://ampache.org/downloads/ampache-3.5-beta1.tar.gz
	(local version is 3.4.4)
ampache: Successfully downloaded updated package beta1.tar.gz
	and symlinked ampache_3.5-beta1.orig.tar.gz to it
desktop:~$

As you can see uscan went and grabbed the new source tree and downloaded it. You should now have

  • ampache-3.4.4
  • ampache_3.4.4-0ubuntu1.dsc
  • ampache_3.4.4-0ubuntu1.diff.gz
  • ampache_3.4.4.orig.tar.gz
  • ampache-3.5-beta1.tar.gz
  • ampache_3.5-beta1.orig.tar.gz

Next we need to update to the new source and uupdate will help us with that.

sudo uupdate -v 3.5-beta1 ../ampache_3.5-beta1.orig.tar.gz

Note - we had to use the -v option for uupdate because by default uupdate will only read numbers and decimal points in the version number.

You should get some output such as this

desktop:~/ampache-3.4.4$ sudo uupdate -v 3.5-beta1 ../ampache_3.5-beta1.orig.tar.gz
New Release will be 3.5-beta1-0ubuntu1.
-- Untarring the new sourcecode archive ../ampache_3.5-beta1.orig.tar.gz
Success!  The diffs from version 3.4.4-0ubuntu1 worked fine.
Remember: Your current directory is the OLD sourcearchive!
Do a "cd ../ampache-3.5-beta1" to see the new package

And now we have a brand new 3.5x source package ready to build, except we need to do one more thing to get the package ready for install. We need to update the debian/changelog, the reason for this is so we get the correct version number for the new package, to do this we run dch -e. This will generate the changelog entry automatically for you, It should look something like this

ampache (3.5-beta1-0ubuntu1) intrepid; urgency=low

	* New upstream release

-- Charlie Smotherman <cjsmo@ubuntu.com>  Tue, 31 Mar 2009 02:38:14 -0500

Now all we need to do is build the package

sudo debuild -us -uc

This should have created ampache_3.5-beta1-0ubuntu1_all.deb

Now we install the package

sudo dpkg -i ampache_3.5-beta1-0ubuntu1_all.deb

Since we already had Ampache installed all of the dependencies should have already be installed. If you have any problems installing the newly created .deb be sure that all of the dependencies are installed as this will cause dpkg to error out.

And there you go, of course there are easier ways to update ampache but the main reason for this how to is that this will work on ANY package that has a debian/watch file, for example apache2, php5, mysql, eyeD3, phpmyadmin, amarok, python-coherence, or any other package that needs an update that you just can't live without.

Yes I will be adding this to the wiki, for everyone's enjoyment.

Hope this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment