Controlling what packages are installed under ubuntu server
Hi all,
I have do it this question one year ago
(https://lists.ubuntu.com/archives/ubuntu-server/2007-July/000535.html), but I
need to know if it is resolved under ubuntu hardy lts server release. Can I pass
some type of exclude/include list packages to apt to stay sure that this package
has 5 years support??
many thanks.
--
CL Martinez
carlopmart {at} gmail {d0t} com
--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam
11-27-2008, 09:25 AM
Nick Barcet
Controlling what packages are installed under ubuntu server
carlopmart wrote:
> Hi all,
>
> I have do it this question one year ago
> (https://lists.ubuntu.com/archives/ubuntu-server/2007-July/000535.html), but I
> need to know if it is resolved under ubuntu hardy lts server release. Can I pass
> some type of exclude/include list packages to apt to stay sure that this package
> has 5 years support??
>
> many thanks.
>
Here is a script that I have been working on to solve this. It is not
yet completely tested, but I guess you could help me find if there is
something wrong with it.
release Specifies the release to parse from.
Defaults to the system release
-f, --filter value possible values are:
n - not officially maintained
u - ubuntu desktop
k - kubuntu desktop
s - ubuntu server
Known issues:
* For releases prior to Hardy, I have yet to modify the seed structure
so that I can distinguish between what's not shipped on cd but supported
and what's not supported at all, so some packages may show as
unsupported while they should.
* Due to the way kernels are updated, the updated kernel packages are
shown as unsupported while they of course are.
Let me know if it helps and if you find issues with it.
Cheers,
Nick
#!/bin/bash
MYCOLUMNS="50,60,70"
usage () {
cat <<EOT
This commands checks for each installed package on your system what is
the maintenance group it fits in regarding the Canonical maintenance policy.
release Specifies the release to parse from.
Defaults to the system release
-f, --filter value possible values are:
n - not officially maintained
u - ubuntu desktop
k - kubuntu desktop
s - ubuntu server
maintenance-check is Copyright (C) 2007 Canonical Ltd. and
written by Nick Barcet <nick.barcet@canonical.com>
EOT
}
while true
do
case "$1" in
-h|--help)
usage
exit 0
;;
-f|--filter)
case "$2" in
n|u|k|s|N|U|K|S)
filter="$2"
;;
*)
echo "Error: filter value must be one of n,u,k,s"
exit 1
;;
esac
shift 2
;;
--)
shift
break
;;
esac
done
getseeds () {
for j; do
wget -q -O - "${XSOURCE}.${XRELEASE}/$j$XSUFFIX" | sed '1,2d;N;$!P;$!D;$d' | sed 's/|.*$//;s/[ ]*$//' | sort -u
done
}
add_inheritance () {
case " $inherit " in
*" $1 "*)
;;
*)
inherit="${inherit:+$inherit }$1"
;;
esac
}
expand_inheritance () {
for seed in $(grep "^$1:" "$STRUCTURE" | cut -d: -f2); do
expand_inheritance "$seed"
done
add_inheritance "$1"
}
getlists() {
STRUCTURE=$4.struct
list=""
wget -q -O - "$2.$1/structure" > $STRUCTURE
for seed in $3 ; do
list="$list $(cat $STRUCTURE | sed -n '/^'$seed': /s/'$seed': //p')"
done
newlist=$list
for item in $list ; do
inheritance $item
for new in $inherit; do
case " $newlist " in
*" $new "*)
;;
*)
newlist="$newlist $new"
esac
done
done
exec 10<$FILE
while read line<&10
do
theout="${line%
} "
case "$filter" in
n|N)
if !((grep -q $line $1.desktop.pkgs)
|| (grep -q $line $1.server.pkgs)
|| (grep -q $line $1.kubuntu.pkgs) ); then
echo -e "${theout}"
fi
;;
u|U)
if grep -q $line $1.desktop.pkgs ; then
echo -e "${theout}${umaint}" | expand -t $MYCOLUMNS
fi
;;
k|K)
if grep -q $line $1.kubuntu.pkgs ; then
echo -e "${theout} ${kmaint}" | expand -t $MYCOLUMNS
fi
;;
s|S)
if grep -q $line $1.server.pkgs ; then
echo -e "${theout} ${smaint}" | expand -t $MYCOLUMNS
fi
;;
*)
if grep -q $line $1.desktop.pkgs ; then theout="${theout}${umaint} "; else theout="${theout} "; fi
if grep -q $line $1.server.pkgs ; then theout="${theout}${smaint} "; else theout="${theout} "; fi
if grep -q $line $1.kubuntu.pkgs ; then theout="${theout}${kmaint}"; fi
echo -e "${theout}" | expand -t $MYCOLUMNS
;;
esac
done
}
dorelease() {
firt=1
for release; do
if (! first=0 ); then
echo "
---"
first=1
fi
case "$release" in
dapper) #no structure file
umaint="3y";kmaint="3y";smaint="5y";
echo "6.06(dapper drake)-Maint.til:Ubuntu->2009-11,Server->2011-11,Kubuntu->2009-11"
echo -e "---
Package Ubuntu Server Kubuntu" | expand -t $MYCOLUMNS
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/ubuntu"
getlistsold "$release" "$source" "server-ship" "server"
"boot server standard installer minimal"
getlistsold "$release" "$source" "ship" "desktop"
"boot desktop live installer standard ship-live minimal"
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/kubuntu"
getlistsold "$release" "$source" "ship" "kubuntu"
"boot desktop live installer standard ship-live minimal"
parseinstalled $release > $release.installed
summarize $release
;;
edgy) #no structure file
umaint="18mo";kmaint="18mo";smaint="18mo";
echo "6.10(Edgy Eft)-Maint.til: All->2008-04"
echo -e "---
Package Ubuntu Server Kubuntu" | expand -t $MYCOLUMNS
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/ubuntu"
getlistsold "$release" "$source" "server-ship" "server"
"boot server standard installer minimal"
getlistsold "$release" "$source" "ship" "desktop"
"boot desktop live installer standard ship-live minimal"
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/kubuntu"
getlistsold "$release" "$source" "ship" "kubuntu"
"boot desktop live installer standard ship-live minimal"
parseinstalled $release > $release.installed
summarize $release
;;
feisty) #general case, we have a structure file
umaint="18mo";kmaint="18mo";smaint="18mo";
echo "7.04(feisty fawn)-Maint.til: All->2008-10"
echo -e "---
Package Ubuntu Server Kubuntu" | expand -t $MYCOLUMNS
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/ubuntu"
getlists "$release" "$source" "server-ship" "server"
getlists "$release" "$source" "ship" "desktop"
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/kubuntu"
getlists "$release" "$source" "ship" "kubuntu"
parseinstalled $release > $release.installed
summarize $release
;;
gutsy) #structure file is invalid
umaint="18mo";kmaint="18mo";smaint="18mo";
echo "7.10(gusty gibbon)-Maint.til: All->2009-04"
echo -e "---
Package Ubuntu Server Kubuntu" | expand -t $MYCOLUMNS
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/ubuntu"
getlistsold "$release" "$source" "server-ship" "server"
"boot required minimal standard dns-server lamp-server openssh-server print-server samba-server postgresql-server mail-server"
getlistsold "$release" "$source" "ship" "desktop"
"boot required minimal standard desktop"
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/kubuntu"
getlistsold "$release" "$source" "ship" "kubuntu"
"boot required minimal standard desktop"
parseinstalled $release > $release.installed
summarize $release
;;
hardy) #general case, we have a structure file
umaint="3y";kmaint="18mo";smaint="5y";
echo "8.04(hardy heron)-Maint.til:Ubuntu->2011-04,Server->2013-04,Kubuntu->2009-10"
echo -e "---
Package Ubuntu Server Kubuntu" | expand -t $MYCOLUMNS
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/ubuntu"
getlists "$release" "$source" "server-ship supported-common" "server"
getlists "$release" "$source" "ship supported" "desktop"
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/kubuntu"
getlists "$release" "$source" "ship supported" "kubuntu"
parseinstalled $release > $release.installed
summarize $release
;;
*) #general case, we should have a structure file
umaint="X";kmaint="X";smaint="X";
echo "unknown release"
echo -e "---
Package Ubuntu Server Kubuntu" | expand -t $MYCOLUMNS
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/ubuntu"
getlists "$release" "$source" "server-ship supported-common" "server"
getlists "$release" "$source" "ship supported" "desktop"
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/kubuntu"
getlists "$release" "$source" "ship supported" "kubuntu"
parseinstalled $release > $release.installed
summarize $release
;;
esac
done
}
cat <<EOT
This commands checks for each installed package on your system what are
the maintenance groups it fits in regarding the Canonical maintenance policy.
WARNING: This script only checks packages names, so if you have pulled a
package version outside the official repositories for a given release,
it will not be maintained by Canonical.
if [ $# -lt 1 ]; then
dorelease `grep DISTRIB_CODENAME= /etc/lsb-release | sed s/DISTRIB_CODENAME=//`
else
dorelease "$@"
fi
popd &> /dev/null
rm -rf "$WORKINGDIR"
exit 0
--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam
11-27-2008, 10:00 AM
Nick Barcet
Controlling what packages are installed under ubuntu server
carlopmart wrote:
> Hi all,
>
> I have do it this question one year ago
> (https://lists.ubuntu.com/archives/ubuntu-server/2007-July/000535.html), but I
> need to know if it is resolved under ubuntu hardy lts server release. Can I pass
> some type of exclude/include list packages to apt to stay sure that this package
> has 5 years support??
>
> many thanks.
>
Here is a script that I have been working on to solve this. It is not
yet completely tested, but I guess you could help me find if there is
something wrong with it.
release Specifies the release to parse from.
Defaults to the system release
-f, --filter value possible values are:
n - not officially maintained
u - ubuntu desktop
k - kubuntu desktop
s - ubuntu server
Known issues:
* For releases prior to Hardy, I have yet to modify the seed structure
so that I can distinguish between what's not shipped on cd but supported
and what's not supported at all, so some packages may show as
unsupported while they should.
* Due to the way kernels are updated, the updated kernel packages are
shown as unsupported while they of course are.
Let me know if it helps and if you find issues with it.
Cheers,
Nick
#!/bin/bash
MYCOLUMNS="50,60,70"
usage () {
cat <<EOT
This commands checks for each installed package on your system what is
the maintenance group it fits in regarding the Canonical maintenance policy.
release Specifies the release to parse from.
Defaults to the system release
-f, --filter value possible values are:
n - not officially maintained
u - ubuntu desktop
k - kubuntu desktop
s - ubuntu server
maintenance-check is Copyright (C) 2007 Canonical Ltd. and
written by Nick Barcet <nick.barcet@canonical.com>
EOT
}
while true
do
case "$1" in
-h|--help)
usage
exit 0
;;
-f|--filter)
case "$2" in
n|u|k|s|N|U|K|S)
filter="$2"
;;
*)
echo "Error: filter value must be one of n,u,k,s"
exit 1
;;
esac
shift 2
;;
--)
shift
break
;;
esac
done
getseeds () {
for j; do
wget -q -O - "${XSOURCE}.${XRELEASE}/$j$XSUFFIX" | sed '1,2d;N;$!P;$!D;$d' | sed 's/|.*$//;s/[ ]*$//' | sort -u
done
}
add_inheritance () {
case " $inherit " in
*" $1 "*)
;;
*)
inherit="${inherit:+$inherit }$1"
;;
esac
}
expand_inheritance () {
for seed in $(grep "^$1:" "$STRUCTURE" | cut -d: -f2); do
expand_inheritance "$seed"
done
add_inheritance "$1"
}
getlists() {
STRUCTURE=$4.struct
list=""
wget -q -O - "$2.$1/structure" > $STRUCTURE
for seed in $3 ; do
list="$list $(cat $STRUCTURE | sed -n '/^'$seed': /s/'$seed': //p')"
done
newlist=$list
for item in $list ; do
inheritance $item
for new in $inherit; do
case " $newlist " in
*" $new "*)
;;
*)
newlist="$newlist $new"
esac
done
done
exec 10<$FILE
while read line<&10
do
theout="${line%
} "
case "$filter" in
n|N)
if !((grep -q $line $1.desktop.pkgs)
|| (grep -q $line $1.server.pkgs)
|| (grep -q $line $1.kubuntu.pkgs) ); then
echo -e "${theout}"
fi
;;
u|U)
if grep -q $line $1.desktop.pkgs ; then
echo -e "${theout}${umaint}" | expand -t $MYCOLUMNS
fi
;;
k|K)
if grep -q $line $1.kubuntu.pkgs ; then
echo -e "${theout} ${kmaint}" | expand -t $MYCOLUMNS
fi
;;
s|S)
if grep -q $line $1.server.pkgs ; then
echo -e "${theout} ${smaint}" | expand -t $MYCOLUMNS
fi
;;
*)
if grep -q $line $1.desktop.pkgs ; then theout="${theout}${umaint} "; else theout="${theout} "; fi
if grep -q $line $1.server.pkgs ; then theout="${theout}${smaint} "; else theout="${theout} "; fi
if grep -q $line $1.kubuntu.pkgs ; then theout="${theout}${kmaint}"; fi
echo -e "${theout}" | expand -t $MYCOLUMNS
;;
esac
done
}
dorelease() {
firt=1
for release; do
if (! first=0 ); then
echo "
---"
first=1
fi
case "$release" in
dapper) #no structure file
umaint="3y";kmaint="3y";smaint="5y";
echo "6.06(dapper drake)-Maint.til:Ubuntu->2009-11,Server->2011-11,Kubuntu->2009-11"
echo -e "---
Package Ubuntu Server Kubuntu" | expand -t $MYCOLUMNS
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/ubuntu"
getlistsold "$release" "$source" "server-ship" "server"
"boot server standard installer minimal"
getlistsold "$release" "$source" "ship" "desktop"
"boot desktop live installer standard ship-live minimal"
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/kubuntu"
getlistsold "$release" "$source" "ship" "kubuntu"
"boot desktop live installer standard ship-live minimal"
parseinstalled $release > $release.installed
summarize $release
;;
edgy) #no structure file
umaint="18mo";kmaint="18mo";smaint="18mo";
echo "6.10(Edgy Eft)-Maint.til: All->2008-04"
echo -e "---
Package Ubuntu Server Kubuntu" | expand -t $MYCOLUMNS
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/ubuntu"
getlistsold "$release" "$source" "server-ship" "server"
"boot server standard installer minimal"
getlistsold "$release" "$source" "ship" "desktop"
"boot desktop live installer standard ship-live minimal"
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/kubuntu"
getlistsold "$release" "$source" "ship" "kubuntu"
"boot desktop live installer standard ship-live minimal"
parseinstalled $release > $release.installed
summarize $release
;;
feisty) #general case, we have a structure file
umaint="18mo";kmaint="18mo";smaint="18mo";
echo "7.04(feisty fawn)-Maint.til: All->2008-10"
echo -e "---
Package Ubuntu Server Kubuntu" | expand -t $MYCOLUMNS
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/ubuntu"
getlists "$release" "$source" "server-ship" "server"
getlists "$release" "$source" "ship" "desktop"
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/kubuntu"
getlists "$release" "$source" "ship" "kubuntu"
parseinstalled $release > $release.installed
summarize $release
;;
gutsy) #structure file is invalid
umaint="18mo";kmaint="18mo";smaint="18mo";
echo "7.10(gusty gibbon)-Maint.til: All->2009-04"
echo -e "---
Package Ubuntu Server Kubuntu" | expand -t $MYCOLUMNS
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/ubuntu"
getlistsold "$release" "$source" "server-ship" "server"
"boot required minimal standard dns-server lamp-server openssh-server print-server samba-server postgresql-server mail-server"
getlistsold "$release" "$source" "ship" "desktop"
"boot required minimal standard desktop"
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/kubuntu"
getlistsold "$release" "$source" "ship" "kubuntu"
"boot required minimal standard desktop"
parseinstalled $release > $release.installed
summarize $release
;;
hardy) #general case, we have a structure file
umaint="3y";kmaint="18mo";smaint="5y";
echo "8.04(hardy heron)-Maint.til:Ubuntu->2011-04,Server->2013-04,Kubuntu->2009-10"
echo -e "---
Package Ubuntu Server Kubuntu" | expand -t $MYCOLUMNS
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/ubuntu"
getlists "$release" "$source" "server-ship supported-common" "server"
getlists "$release" "$source" "ship supported" "desktop"
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/kubuntu"
getlists "$release" "$source" "ship supported" "kubuntu"
parseinstalled $release > $release.installed
summarize $release
;;
*) #general case, we should have a structure file
umaint="X";kmaint="X";smaint="X";
echo "unknown release"
echo -e "---
Package Ubuntu Server Kubuntu" | expand -t $MYCOLUMNS
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/ubuntu"
getlists "$release" "$source" "server-ship supported-common" "server"
getlists "$release" "$source" "ship supported" "desktop"
source="http://people.ubuntu.com/~ubuntu-archive/germinate-output/kubuntu"
getlists "$release" "$source" "ship supported" "kubuntu"
parseinstalled $release > $release.installed
summarize $release
;;
esac
done
}
cat <<EOT
This commands checks for each installed package on your system what are
the maintenance groups it fits in regarding the Canonical maintenance policy.
WARNING: This script only checks packages names, so if you have pulled a
package version outside the official repositories for a given release,
it will not be maintained by Canonical.
if [ $# -lt 1 ]; then
dorelease `grep DISTRIB_CODENAME= /etc/lsb-release | sed s/DISTRIB_CODENAME=//`
else
dorelease "$@"
fi
popd &> /dev/null
rm -rf "$WORKINGDIR"
exit 0
--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam
11-27-2008, 10:13 AM
Nick Barcet
Controlling what packages are installed under ubuntu server
carlopmart wrote:
> Hi all,
>
> I have do it this question one year ago
> (https://lists.ubuntu.com/archives/ubuntu-server/2007-July/000535.html), but I
> need to know if it is resolved under ubuntu hardy lts server release. Can I pass
> some type of exclude/include list packages to apt to stay sure that this package
> has 5 years support??
>
> many thanks.
>
Here is a script that I have been working on to solve this. It is not
yet completely tested, but I guess you could help me find if there is
something wrong with it.
release Specifies the release to parse from.
Defaults to the system release
-f, --filter value possible values are:
n - not officially maintained
u - ubuntu desktop
k - kubuntu desktop
s - ubuntu server
Known issues:
* For releases prior to Hardy, I have yet to modify the seed structure
so that I can distinguish between what's not shipped on cd but supported
and what's not supported at all, so some packages may show as
unsupported while they should.
* Due to the way kernels are updated, the updated kernel packages are
shown as unsupported while they of course are.
Let me know if it helps and if you find issues with it.
Cheers,
Nick
--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam
11-27-2008, 12:30 PM
Nick Barcet
Controlling what packages are installed under ubuntu server
carlopmart wrote:
> Hi all,
>
> I have do it this question one year ago
> (https://lists.ubuntu.com/archives/ubuntu-server/2007-July/000535.html), but I
> need to know if it is resolved under ubuntu hardy lts server release. Can I pass
> some type of exclude/include list packages to apt to stay sure that this package
> has 5 years support??
>
> many thanks.
>
Here is a script that I have been working on to solve this [1]. It is
not yet completely tested, but I guess you could help me find if there
is something wrong with it.
release Specifies the release to parse from.
Defaults to the system release
-f, --filter value possible values are:
n - not officially maintained
u - ubuntu desktop
k - kubuntu desktop
s - ubuntu server
Known issues:
* For releases prior to Hardy, I have yet to modify the seed structure
so that I can distinguish between what's not shipped on cd but supported
and what's not supported at all, so some packages may show as
unsupported while they should.
* Due to the way kernels are updated, the updated kernel packages are
shown as unsupported while they of course are.
Let me know if it helps and if you find issues with it.
--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam
11-27-2008, 02:52 PM
"Dustin Kirkland"
Controlling what packages are installed under ubuntu server
On Thu, Nov 27, 2008 at 7:30 AM, Nick Barcet <nick.barcet@canonical.com> wrote:
> Here is a script that I have been working on to solve this [1]. It is
> not yet completely tested, but I guess you could help me find if there
> is something wrong with it.
>
> usage: maintenance-check [-f] [release [release...]]
...
Nick,
I think it would be useful for you to check this script into a bzr
project, for easier maintenance and publication.
Cheers,
:-Dustin
--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam
11-27-2008, 04:39 PM
Nick Barcet
Controlling what packages are installed under ubuntu server
Dustin Kirkland wrote:
> On Thu, Nov 27, 2008 at 7:30 AM, Nick Barcet <nick.barcet@canonical.com> wrote:
>> Here is a script that I have been working on to solve this [1]. It is
>> not yet completely tested, but I guess you could help me find if there
>> is something wrong with it.
>>
>> usage: maintenance-check [-f] [release [release...]]
> ...
>
> Nick,
>
> I think it would be useful for you to check this script into a bzr
> project, for easier maintenance and publication.
Indeed. I don't know why I wanted to package it before doing so, but
you are right
So here is it's new home:
https://launchpad.net/ubuntu-maintenance-check
Cheers,
Nick
--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam