Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Ubuntu and I have a deb file installed. I've made deb packages before, so I know there is a debian changelog (debchange). Is there anyway to see the debian changelog for any package that I have installed? Assume I don't have access to the deb source file for this package, and I don't have the deb file available. I am able to install extra packages if needed.

share|improve this question
3  
to see changes for apt-get installed packages: apt-get changelog <package> – J.F. Sebastian Apr 11 '13 at 13:01
    
@J.F.Sebastian apt-get doesn't have such a command. – gipi Nov 10 '13 at 9:50
1  
@gipi: apt-get changelog apt | grep -C5 'apt-get changelog' shows that this command is introduced in apt (0.8.9ubuntu1) natty (2010). You can get the source (it is open-source after all): run apt-get source apt and find cmdline/apt-get.cc file and look at DoChangelog() function (btw, look at DoMoo() function). – J.F. Sebastian Nov 10 '13 at 12:06
    
strange, I have the (debian) apt 0.9.12.1 and this command is not available. – gipi Nov 10 '13 at 17:16

apt-listchanges is a nice package to have around, but without having a deb file around your best bet most probably is to read the Debian changelog from /usr/share/doc/somepackage/changelog.Debian.gz.

Create a shell function with:

function debchanglog () { zless "/usr/share/doc/$1/changelog.Debian.gz" }

share|improve this answer
    
As the OP alluded to, debchange is actually an existing tool in devscripts used for creating changelog entries. So I'd strongly recommend choosing another name. Also, $0 will probably not do what you're expecting. In my case, it will always execute zless /usr/share/doc/bash/changelog.Debian.gz. In your case, replace bash with the name of the shell or script you are executing it from. – Six Oct 3 '15 at 5:40

To extend on Janne Pikkarainen's answer, here is an alias that can be used to read the changelog.Debian.gz for any given package:

alias changelog="xargs -I% -- zless /usr/share/doc/%/changelog.Debian.gz <<<"

It can be used like so:

changelog PACKAGE

Please note however that this is a terribly hackish solution and is not recommended under most circumstances. A function or standalone script is a much better solution.

Here is a function that reads all available changelogs for PACKAGE:

changelog(){
    if (( $# != 1 )); then
        echo "Usage: ${FUNCNAME[0]} PACKAGE"
        return 1
    fi

    find -L "/usr/share/doc/$1" -type f -name 'changelog*.gz' -exec zless {} \; 2>/dev/null
}

Here is a function that prints a list of all available changelogs for PACKAGE and queries the user to select which one to read:

changelog(){
    if (( $# != 1 )); then
        echo "Usage: ${FUNCNAME[0]} PACKAGE"
        return 1
    fi

    local changelog changelogs

    readarray -t changelogs < <(find -L "/usr/share/doc/$1" -type f -name 'changelog*.gz' 2>/dev/null)

    if (( ${#changelogs[@]} == 0 )); then
        return 0
    elif (( ${#changelogs[@]} == 1 )); then
        zless "${changelogs[0]}"
        return $?
    fi

    select changelog in "${changelogs[@]}" EXIT; do
        case $changelog in
            '')
                echo "ERROR: Invalid selection" >&2
                continue
                ;;
            EXIT)
                return 0
                ;;
            *)
                zless "$changelog"
                return $?
                ;;
        esac            
    done
}
share|improve this answer

Alternatively if the deb is also in the repository and you want to know older versions changelog, you can use apt-get changelog package to read all the changelog. For example for openssl:

apt-get changelog libssl1.0.0
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.