most grains and flours still can have eggs of bugs in them. ONly way to properly store them long term for years is to put them in mylar bags with an Oxygen absorber. Then store the bags in a container to prevent rodents from getting to them.
you can get mylar bags and the Desiccant quite cheap