I was getting below error while I was installing some packages via pip.

$ pip install torch
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting torch
Killed

As a workaround I use pip option --no-cache-dir to bypass this error.

$ pip install pkgname --no-cache-dir

Alternatively , you can move or delete your pip cache,then try again

cd ~/.cache
mv pip pip.bk