Skip to content

Instantly share code, notes, and snippets.

@rmoyano
Last active August 3, 2025 06:00
Show Gist options
  • Save rmoyano/2eba71c7dde50f1d6b30f09323d5b204 to your computer and use it in GitHub Desktop.
Save rmoyano/2eba71c7dde50f1d6b30f09323d5b204 to your computer and use it in GitHub Desktop.
APT

Installation

Listado de programas en L15 bpython vscodium keepassxc cmus qmmp matecalculator tilix - terminator chromium firefox solaar kolourpaint qbittorrent vlc wicd fish gparted geany document viewer xscreensaver

Assume yes to all prompts:

$ apt-get install ca-certificates curl -y

apt-get -y install One side effect of using -y is that it will skip downgrades, whereas if the user entered y, it would perform the downgrades. So if you want -y to execute the same thing as a user entering y,you also need to add --allow-downgrades

Man page:

-y, --yes, --assume-yes
       Automatic yes to prompts; assume "yes" as answer to all prompts and
       run non-interactively. If an undesirable situation, such as
       changing a held package, trying to install an unauthenticated
       package or removing an essential package occurs then apt-get will
       abort. Configuration Item: APT::Get::Assume-Yes

Check package version

apt-get -s install <package>: You can run a simulation in apt or apt-get using the -s or --simulate option to see what would happen if you upgrade/install a package:

user@dell:/home/laptop$ apt-get -s install <package>

To see all possible upgrades, run an upgrade in verbose mode and (to be safe) with simulation; press n to cancel:

user@dell:/home/laptop$ apt-get -V -s upgrade

apt-cache policy <package>: The option policy can show the installed and the remote version (install candidate) of a package.

user@dell:/home/laptop$ apt-cache policy bpython
bpython:
  Installed: 0.22.1-2
  Candidate: 0.22.1-2
  Version table:
 *** 0.22.1-2 500
        500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu jammy/universe i386 Packages
        100 /var/lib/dpkg/status
user@dell:/home/laptop$ apt-cache policy ansible
ansible:
  Installed: (none)
  Candidate: 2.10.7+merged+base+2.10.8+dfsg-1
  Version table:
     2.10.7+merged+base+2.10.8+dfsg-1 500
        500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu jammy/universe i386 Packages

dpkg -s <package> | grep Version: For this case, you need to have installed the package on your system.

user@dell:/home/laptop$ dpkg -s bpython | grep Version
Version: 0.22.1-2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment