How can I carry a heavy bag without a rack?
Depending on your backpack you may be able to lash it to the outside.  I've carried bike wheels this way. I've also carried 10-15kg backpacks while riding, so know it takes some care.  You might have to ride quite gently but that's OK over 3 km.  I'd probably have the sack sideways across the backpack, rather than vertical, as it's less likely to slip between the straps.

Buying a bigger backpack might be a good idea if this is going to become a habit.

The backpack I used has straps on the outside running from bottom to top, so a big load can be held between them and the backpack itself.  An additional side-to-side strap/rope is a good idea.  If you think it feels like it's started moving, get off and have a look.

Alternatively, don't take the bike, walk with the sack on your shoulder.