Apt-get View Installed Package Version
After running apt-get upgrade, I get a list of the packages that will be upgraded. I would like to know the version number for one of these packages. (Not the current.
APT-GET and APT-CACHE Commands What is apt-get? The apt-get utility is a powerful and free package management command line program, that is used to work with Ubuntu’s APT ( Advanced Packaging Tool) library to perform installation of new software packages, removing existing software packages, upgrading of existing software packages and even used to upgrading the entire operating system. What is apt-cache?
The apt-cache command line tool is used for searching apt software package cache. In simple words, this tool is used to search software packages, collects information of packages and also used to search for what available packages are ready for installation on Debian or Ubuntu based systems. APT-CACHE – 5 Useful Basic Commands 1. How Do I List All Available Packages? To list all the available packages, type the following command.
$ apt-cache pkgnames esseract-ocr-epo pipenightdreams mumudvb tbb-examples libsvm-java libmrpt-hmtslam0.9 libboost-timer1.50-dev kcm-touchpad g-4.5-multilib. How Do I Find Out Package Name and Description of Software?
To find out the package name and with it description before installing, use the ‘ search‘ flag. Using “ search” with apt-cache will display a list of matched packages with short description. Let’s say you would like to find out description of package ‘ vsftpd‘, then command would be.
$ apt-cache search vsftpd vsftpd - lightweight, efficient FTP server written for security ccze - A robust, modular log coloriser ftpd - File Transfer Protocol (FTP) server yasat - simple stupid audit tool To find and list down all the packages starting with ‘ vsftpd‘, you could use the following command. $ apt-cache pkgnames vsftpd vsttpd 3. How Do I Check Package Information? For example, if you would like to check information of package along with it short description say (version number, check sums, size, installed size, category etc). Use ‘ show‘ sub command as shown below. APT-GET – 20 Useful Basic Commands for Package Management 6.
How to Update System Packages The ‘ update‘ command is used to resynchronize the package index files from the their sources specified in /etc/apt/sources.list file. The update command fetched the packages from their locations and update the packages to newer version.
$ sudo apt-get update sudo password for tecmint: Ign quantal-security InRelease Get:1 quantal-security Release.gpg 933 B Get:2 quantal-security Release 49.6 kB Ign quantal InRelease Ign quantal-updates InRelease Get:3 precise InRelease 13.7 kB Ign quantal-backports InRelease Hit quantal Release.gpg Get:4 quantal-security/main Sources 34.8 kB Get:5 quantal-updates Release.gpg 933 B. How to Upgrade Software Packages The ‘ upgrade‘ command is used to upgrade all the currently installed software packages on the system. Under any circumstances currently installed packages are not removed or packages which are not already installed neither retrieved and installed to satisfy upgrade dependencies. $ sudo apt-get upgrade Reading package lists. Done Building dependency tree Reading state information.
Done The following packages have been kept back: linux-headers-generic linux-image-generic wine1.5 wine1.5-i386 The following packages will be upgraded: activity-log-manager-common activity-log-manager-control-center adium-theme-ubuntu alacarte alsa-base app-install-data-partner appmenu-gtk appmenu-gtk3 apport apport-gtk apt apt-transport-https apt-utils aptdaemon aptdaemon-data at-spi2-core bamfdaemon base-files bind9-host. However, if you want to upgrade, unconcerned of whether software packages will be added or removed to fulfill dependencies, use the ‘ dist-upgrade‘ sub command. $ sudo apt-get dist-upgrade 8. How Do I Install or Upgrade Specific Packages? The ‘ install‘ sub command is tracked by one or more packages wish for installation or upgrading. $ sudo apt-get install netcat Reading package lists.
Done Building dependency tree Reading state information. Done The following extra packages will be installed: netcat-traditional The following NEW packages will be installed: netcat netcat-traditional 0 upgraded, 2 newly installed, 0 to remove and 328 not upgraded. Need to get 67.1 kB of archives. After this operation, 186 kB of additional disk space will be used.
Do you want to continue Y/n? Y Get:1 quantal/universe netcat-traditional i386 1.10-40 63.8 kB Get:2 quantal/universe netcat all 1.10-40 3,340 B Fetched 67.1 kB in 1s (37.5 kB/s) Selecting previously unselected package netcat-traditional. (Reading database.
216118 files and directories currently installed.) Unpacking netcat-traditional (from./netcat-traditional1.10-40i386.deb). Selecting previously unselected package netcat. Unpacking netcat (from./netcat1.10-40all.deb). Processing triggers for man-db. Setting up netcat-traditional (1.10-40). Setting up netcat (1.10-40). How I can Install Multiple Packages?
You can add more than one package name along with the command in order to install multiple packages at the same time. For example, the following command will install packages ‘‘ and ‘‘. $ sudo apt-get install nethogs goaccess Reading package lists. Done Building dependency tree Reading state information.
Done goaccess is already the newest version. Nethogs is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded. How to Install Several Packages using Wildcard With the help of regular expression you can add several packages with one string. For example, we use.
wildcard to install several packages that contains the ‘.name.‘ string, name would be ‘package-name’. $ sudo apt-get install '.name.' 11. How to install Packages without Upgrading Using sub ‘ –no-upgrade‘ command will prevent already installed packages from upgrading. $ sudo apt-get install packageName -no-upgrade Reading package lists.
Done Building dependency tree Reading state information. Done Skipping vsftpd, it is already installed and upgrade is not set. 0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded. How to Upgrade Only Specific Packages The ‘ –only-upgrade‘ command do not install new packages but it only upgrade the already installed packages and disables new installation of packages.
$ sudo apt-get install packageName -only-upgrade Reading package lists. Done Building dependency tree Reading state information. Done vsftpd is already the newest version.
Apt Get Package Version
0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded. How Do I Install Specific Package Version? Let’s say you wish to install only specific version of packages, simply use the ‘ =‘ with the package-name and append desired version.
$ sudo apt-get install vsftpd=2.3.5-3ubuntu1 Reading package lists. Done Building dependency tree Reading state information. Done vsftpd is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded. How Do I Remove Packages Without Configuration To un-install software packages without removing their configuration files (for later re-use the same configuration). Use the ‘remove‘ command as shown. $ sudo apt-get remove vsftpd sudo password for tecmint: Reading package lists.
Done Building dependency tree Reading state information. Done The following packages will be REMOVED: vsftpd 0 upgraded, 0 newly installed, 1 to remove and 328 not upgraded. After this operation, 364 kB disk space will be freed. Do you want to continue Y/n?
Y (Reading database. 216156 files and directories currently installed.) Removing vsftpd. Vsftpd stop/waiting Processing triggers for ureadahead. Processing triggers for man-db.
How Do I Completely Remove Packages To remove software packages including their configuration files, use the ‘ purge‘ sub command as shown below. $ sudo apt-get purge vsftpd Reading package lists. Done Building dependency tree Reading state information.
Done The following packages will be REMOVED: vsftpd. 0 upgraded, 0 newly installed, 1 to remove and 328 not upgraded. After this operation, 0 B of additional disk space will be used.
Do you want to continue Y/n? Y (Reading database. 216107 files and directories currently installed.) Removing vsftpd. Purging configuration files for vsftpd.
Processing triggers for ureadahead. Alternatively, you can combine both the commands together as shown below. $ sudo apt-get remove -purge vsftpd Reading package lists. Done Building dependency tree Reading state information. Done The following packages will be REMOVED: vsftpd. 0 upgraded, 0 newly installed, 1 to remove and 328 not upgraded.
After this operation, 364 kB disk space will be freed. Do you want to continue Y/n? Y (Reading database.
216156 files and directories currently installed.) Removing vsftpd. Vsftpd stop/waiting Purging configuration files for vsftpd. Processing triggers for ureadahead. Processing triggers for man-db. How I Can Clean Up Disk Space The ‘ clean‘ command is used to free up the disk space by cleaning retrieved (downloaded).deb files (packages) from the local repository. $ sudo apt-get clean 17.
How Do I Download Only Source Code of Package To download only source code of particular package, use the option ‘ –download-only source‘ with ‘package-name’ as shown. $ sudo apt-get -download-only source vsftpd Reading package lists. Done Building dependency tree Reading state information. Done Need to get 220 kB of source archives.
Get:1 quantal/main vsftpd 2.3.5-3ubuntu1 (dsc) 1,883 B Get:2 quantal/main vsftpd 2.3.5-3ubuntu1 (tar) 188 kB Get:3 quantal/main vsftpd 2.3.5-3ubuntu1 (diff) 30.5 kB Fetched 220 kB in 4s (49.1 kB/s) Download complete and in download only mode 18. How Can I Download and Unpack a Package To download and unpack source code of a package to a specific directory, type the following command. $ sudo apt-get source vsftpd Reading package lists. Done Building dependency tree Reading state information.
Done Need to get 220 kB of source archives. @Bronwyn, Running sudo apt-get clean command will remove all the local packages that you’ve download during the package installation, the downloaded files resides under /var/cache/apt/archives directory, it seems empty in your case.
But this is not the only place, where huge amount of disk space wasted, there are other places such as: /var/log directory contains all the system logs, you may want to remove these logs or you can use log-rotation program to lower the amount of logs saved and archived. Read more here: Your own Trash directory may be full of files that can be purged on regular time. If you still want to clean more space, you can use bleachbit program, read more here.
The package management system on Ubuntu makes it extremely simple to install and remove packages, but sometimes it’s important to figure out what version of a particular package that you actually have installed. The apt-get utilities are simply a front-end to the debian dpkg utility, which actually does the real work. You can use this utility to figure out what version is installed. Dpkg -s Here’s an example, where I was trying to figure out what version of Ruby I had installed on my system: geek@ubuntuServ:$ dpkg -s ruby1.8 Package: ruby1.8 Status: install ok installed Priority: optional Section: interpreters Installed-Size: 272 Maintainer: Ubuntu Core Developers Architecture: i386 Version: 1.8.4-5ubuntu1.2 Depends: libc6 (= 2.4-1), libruby1.8 (= 1.8.4) Suggests: ruby1.8-examples, rdoc1.8, ri1.8 Description: Interpreter of object-oriented scripting language Ruby 1.8 Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in perl).
It is simple, straight-forward, and extensible. This package provides version 1.8 series of Ruby. On Debian, Ruby 1.8 is provided as separate packages.
Apt Get Version
You can get full Ruby 1.8 distribution by installing following packages. Ruby1.8 ruby1.8-dev ri1.8 rdoc1.8 irb1.8 ruby1.8-elisp ruby1.8-examples libdbm-ruby1.8 libgdbm-ruby1.8 libtcltk-ruby1.8 libopenssl-ruby1.8 libreadline-ruby1.8 Original-Maintainer: akira yamada You can see that I’ve got version 1.8.4 installed.