Skip to content

Instantly share code, notes, and snippets.

@smoser
Last active June 10, 2021 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smoser/a34c34c7e693b4bfc99ebb0a287891d4 to your computer and use it in GitHub Desktop.
Save smoser/a34c34c7e693b4bfc99ebb0a287891d4 to your computer and use it in GitHub Desktop.
Using -proposed on Ubuntu selectively

Enabling and Selectively using Ubuntu -proposed.

Often times people will want to test a package from -proposed, but do not want the whole ball of wax.

This covers how you can selectively use -proposed.

It is based on the backports doc. But also mentioned in EnableProposed in the Ubuntu Wiki. I used 'priority' of 400 below. You can read more about priority in apt_preferences(5).

After doing this you can leave -proposed enabled and your 'dist-upgrade' will not pull from it.

# these probably already exist.
$ sudo mkdir -p /etc/apt/preferences.d/ /etc/apt/sources.list.d/

# try to read your primary mirror from /etc/apt/sources.list
$ mirror=$(awk '$2 ~ /ubuntu.com/ { print $2 ; exit 0; }' /etc/apt/sources.list
$ echo $mirror
http://archive.ubuntu.com/ubuntu

# read the current release
$ rel=$(lsb_release -sc)

# enable -proposed.
$ printf "deb %s %s-proposed main universe restricted" "$mirror" "$rel" |
    sudo tee /etc/apt/sources.list.d/proposed.list
deb http://archive.ubuntu.com/ubuntu focal-proposed main universe restricted

# mark -proposed as lower priority so it wont be used by default.
$ printf "%s\n%s\n%s\n" \
    "Package: *" "Pin: release a=$rel-proposed" "Pin-Priority: 400" |
    sudo tee /etc/apt/preferences.d/proposed

# update sources
apt-get update -q

# install package from -proposed
$ apt-get install lxc/$(lsb_release -sc)-proposed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment