Comandos do Apt-Get
Selecionei aqui uma lista de Comandos do Apt-Get para quem deseja lembrar dos comandos simples, além dos famosos comandos adicionar pacote apt-get install e remover pacote apt-get remove.
Comandos do Apt-Get
#apt-get install software
-h This help text.
-d Download only – do NOT install or unpack archives
-f Attempt to continue if the integrity check fails
-s No-act. Perform ordering simulation
-y Assume Yes to all queries and do not prompt
-u Show a list of upgraded packages as well
apt-get –reinstall install packagename
Updating the list of packages in your sources.list
#apt-get update
Update software using apt
#apt-get -u upgrade
To change the list of apt mirrors
#apt-setup
Search for package
#apt-cache search package
Uninstall software using apt
#apt-get remove software
Shortcuts / Cheatcodes
update the package lists
# apt-get update
update the available package lists
# dselect update
upgrade all installed packages
# apt-get upgrade
installs package
# apt-get install pkg
uninstall package
# apt-get remove pkg
show all installed and removed packages
#dpkg -l
show install status of package
#dpkg -l pkg
show all packages that match pattern
#dpkg -S pattern
list packages that contain string
#dpkg
list files in package
#dpkg -L pkg
show status of package
#dpkg -s pkg
show details of package
#dpkg -p pkg
list relevant packages
#apt-cache search string
install package from a deb file
# dpkg -i file.deb
purge package
# dpkg -P pkg
re-run the configure for a package
# dpkg-reconfigure pkg
get the source
# apt-get source pkg
config build-deps for source and install as needed
# apt-get build-dep
install package from specific release
# apt-get -t release install pkg
prevent name from running at bootup
# update-rc.d -f name remove
upgrade the distribution
# apt-get –u dist-upgrade
How to know what packages may be upgraded
apt-show-versions is a program that shows what packages in the system may be updated and several useful information.
The -u option displays a list of upgradeable packages:
# apt-show-versions -u
APT mantém uma cópia de cada arquivo .deb baixado no diretório /var/cache/apt/archives/. Caso haja atualizações frequentes, este diretório pode rapidamente ocupar um grande espaço em disco com várias versões de cada pacote; você deve regularmente passear por eles. Dois comandos podem ser usados: apt-get clean esvazia completamente o diretório; apt-get autoclean remove apenas os pacotes que não podem mais ser baixados
Referências Bibliográficas: Debian Online Manual Apt-Get command Line Sephorix Linux