InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Ubuntu tutorials

  • How to add a user on Linux with sudo access
  • How to check if a user has password on Linux
  • How to install ViewVC for svn repository on Ubuntu Linux
  • How to setup ssl (https) for your site on Ubuntu Linux
  • Install rabbitmq on Ubuntu Linux
  • LXC (Linux Containers) - quick start tutorial on Ubuntu
  • Linux - command to check swap size
  • Linux - how to add a user using useradd
  • Linux - how to create a large file like 1GB
  • Linux - how to create swap partition
  • Linux - how to remove user from a group
  • Linux - number of cpus (lscpu)
  • Linux du - find disk usage of directories or files
  • NFS client and server handy commands
  • Setup svn repository on AWS Ubuntu with apache auth
  • Ubuntu - check if a service is upstart based
  • Ubuntu - dpkg and apt-get beginner tutorial
  • Ubuntu - find file to package
  • Ubuntu - find where will a package be installed from
  • Ubuntu - how to auto start services on boot using update-rc.d (sysv init)
  • Ubuntu - how to find boot autostart status of a service
  • Ubuntu - reload iptables rules during boot
  • Use x2go to access remote Ubuntu Linux
 
  • Home
  • > Tutorials
  • > Ubuntu Linux

Ubuntu – dpkg and apt-get beginner tutorial

By admin | Last updated on Mar 21, 2016

Installing and managing packages is the first thing you do when you use any Linux system. It takes a while to get hang of it on Ubuntu Linux. Here are the the package management commands which I use frequently to manage packages on Ubuntu:

Find latest version of a package

Install (dryrun) memcached using apt-get. Use -s (silent) or --dry-run. This way we can find the latest version available without installing it.

sudo apt-get install --dry-run memcached

Or you can also use apt-cache policy

$ sudo apt-cache policy phantomjs

Install a package on Ubuntu

Install memcached using apt-get

sudo apt-get install memcached

Resynchronize the package index files from their sources

sudo apt-get update

Upgrade the newest versions of all installed packages

sudo apt-get upgrade

Upgrade a specific package

Upgrade php-apc using apt-get

sudo apt-get --only-upgrade install php-apc

Remove a package

Remove memcached using apt-get

sudo apt-get remove memcached

List all packages on your system

sudo dpkg -l

List all files for a package (e.g. apache2)

sudo dpkg -L apache2

File package(s) owning a file (or files)

To list package for /etc/apache2/apache2.conf
dpkg -S /etc/apache2/apache2.conf
Outcome:

apache2.2-common: /etc/apache2/apache2.conf

Suggested posts:

  1. php preg_match – greedy and lazy regex examples
  2. bash – how to use regex in if condition
  3. Ubuntu – how to find boot autostart status of a service
  4. Mac brew – how to find latest available package without installing
  5. Why and how to log Content-Type in apache access log
  6. Mysql 5.7 root password after installation
  7. jQuery toggleClass() examples
  8. document querySelector examples
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Tutorials, Ubuntu Linux
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress