# Why ubuntu sources are different to the originals?

When I do:

wget ftp://ftp.openbsd.com/pub/OpenBSD/OpenSSH/portable/openssh-5.8p1.tar.gz
wget ftp://ftp.openbsd.com/pub/OpenBSD/OpenSSH/portable/openssh-5.8p1.tar.gz.asc
gpg openssh-5.8p1.tar.gz.asc
tar -zxvf openssh-5.8p1.tar.gz
apt-get source openssh-server


I get loads of differences (wc -l returns 3000 lines). Why is that?

-
Could you post some 20 lines of the output of diff? Maybe it's something obvious. –  Axel Feb 2 '12 at 18:00
Are you asking this question about OpenSSH, or is just a generic question?. I mean, should the question Why Ubuntu patchs Openssh?, or is just Why Ubuntu patchs things? and OpenSSh is only an example (one of many). –  Javier Rivera Feb 2 '12 at 18:04

Ubuntu developers that manage packages and import applications to Ubuntu repositories reserve the right to modify these applications. They are allowed to do so, as almost every software there is free-licenced. They do not try to cover it, these changes are visible to anyone. In fact, they even change the package's version to indicate that it differs from the original release. The apt-get source command you executed downloaded you openssh-server in version 5.8p1-7ubuntu1. Notice the suffix. (You can check the version with any package manager). The scheme orig_version-XubuntuY is very common among all the packages. The X number indicates the revision number in Debian, and Y stands for revision number in Ubuntu. Maybe you know about it, but as a side note to everyone who might read this answer: Most ubuntu packages are copied from Debian repositories - so if Debian developers released version 5.8p1 seven times, releasing it to repositories each time they have included their changes, and, this is the first time Ubuntu developers have released it with their changes, the resulting version number will be 5.8p1-7ubuntu1.

Why would they want or need to include own changes, if the upstream version is good enough?

• The upstream packages are provided for general audience. However, Ubuntu, as any other distro, has many specific changes, for example a tiny bit different organised file system. In this case any application that uses these parts of system's architecture, that are changed in Ubuntu exclusively, needs adapting to Ubuntu.
• A good example is that most apps are prepared so that they can work with Apport - the crash detecting and bug reporting tool, that is used in Ubuntu exclusively.
• In many cases (though not in case of openssh-server) these changes are needed to ensure proper desktop integration. Not many apps are aware of Unity, since it's not common on other distros. This means that if the application should integrate with the indicators, Dash, or whatever else, the Ubuntu developers have to implement this feature and release the app with their changes to the repository.
• All post-release bugfixes are released as a local (Ubuntu-wide) change to the source. The apps are never updated to a newer upstream release within a single release of Ubuntu. That means that if your Oneiric was released with openssh-server 5.8p1 it will not be updated to 5.9p1 - you need to wait for Precise, or get it yourself. However, Ubuntu provides updates that fix critical bugs and security issues. These fixes has to be applied to the version that's in approprieate Ubuntu series - in your case it's Oneiric - and released as changes done to the 5.8p1 version.
• Sometimes applications developer's quality requirements are lower then Ubuntu's. From time to time it happens that Ubuntu developers fix a bug in an application before uploading it to repositories.
• It happens also that the revision number is increased without any changes being introduced. This is the case when an application needs to be rebuild because of significant changes to (or new version of) a library it depends on. Then the revision number is increased just to bump the package version.

Also notice that these changes are always explained briefly in the package's changelog (available both at these sites and by using most package managers on your computer - but there is the link to your's openssh-server - read it at least to notice how the version number changes as patches are included).