Hot answers tagged

883

To get a list of packages installed locally do this in your terminal: dpkg --get-selections | grep -v deinstall (The -v tag "inverts" grep to return non-matching lines) To get a list of a specific package installed: dpkg --get-selections | grep postgres To save that list to a text file called packages on your desktop do this in your terminal: dpkg -...


396

APT is a package management system for Debian and other Linux distributions based on it, such as Ubuntu. For the most part, APT is easy to use for installing, removing, and updating packages. In rare instances, often when you are mixing in third-party dependencies, there is a chance that apt-get may end up giving you an error telling you that a package ...


383

Try this: sudo apt-get update # Fetches the list of available updates sudo apt-get upgrade # Strictly upgrades the current packages sudo apt-get dist-upgrade # Installs updates (new ones)


370

According to an article on debian-administration.org, If the dependencies have changed on one of the packages you have installed so that a new package must be installed to perform the upgrade then that will be listed as "kept-back". That article says sudo apt-get dist-upgrade will force the installation of those newer packages. Note: dist-upgrade can ...


319

apt-get remove packagename will remove the binaries, but not the configuration or data files of the package packagename. It will also leave dependencies installed with it on installation time untouched. apt-get purge packagename or apt-get remove --purge packagename will remove about everything regarding the package packagename, but not the dependencies ...


247

This should be used as last resort. If you use this carelessly you can end up with a broken system. Please try the other answers before doing this. You can delete the lock file with the following command: sudo rm /var/lib/apt/lists/lock You may also need to delete the lock file in the cache directory sudo rm /var/cache/apt/archives/lock After that, ...


245

Locking with Synaptic Package Manager Go to Synaptic Package Manager (System > Administration > Synaptic Package Manager). Click the search button and type the package name. When you find the package, select it and go to the Package menu and select Lock Version. That package will now not show in the update manager and will not be updated. Holding ...


242

Whenever you receive from the command apt-get upgrade the message The following packages have been kept back: then to upgrade one or all of the kept-back packages, without doing a distribution upgrade (this is what dist-upgrade does, if I remember correctly) is to issue the command: apt-get install <list of packages kept back> this will resolve ...


242

To get just the packages which were expressly installed (not just installed as dependencies), you can run aptitude search '~i!~M' This will also include a brief description, which you may want. If not, use the option -F '%p', as mentioned by karthick87. Yet another option seems to be to copy the file /var/lib/apt/extended_states, which is a text file ...


195

Programs A quick way of backing up a list of programs is to run this: dpkg --get-selections > ~/Package.list sudo cp -R /etc/apt/sources.list* ~/ sudo apt-key exportall > ~/Repo.keys It will back them up in a format that dpkg can read* for after your reinstall, like this: sudo apt-key add ~/Repo.keys sudo cp -R ~/sources.list* /etc/apt/ sudo apt-...


176

You can use dpkg command to find out which package owns a file: From man dpkg: -S, --search filename-search-pattern... Search for a filename from installed packages. Example: $ dpkg -S /bin/ls coreutils: /bin/ls You can either search with a full path or with just the filename. If you wish to search for files not yet installed on ...


174

You can simply check if the file /var/run/reboot-required exists or not. For example, any of these would tell you "no such file" or "file not found" if you do not need to reboot, otherwise they will show information about the file: file /var/run/reboot-required stat /var/run/reboot-required ls /var/run/reboot-required In a bash script, you can use: #!/...


166

I see pretty much all the answers recommend deleting the lock. I don't recommend doing that as a first measure; maybe if there is no alternative. The lock is placed when an apt process is running, and is removed when the process completes. If there is a lock with no apparent process running, this may mean the process got stuck for some reason. If you try ...


162

The package unattended-upgrades provides functionality to install security updates automatically. You could use this, but instead of configuring the automatic part you could call it manually. For this case, the following should do it quietly: sudo unattended-upgrades or more verbose version, for controlling how it goes sudo unattended-upgrades -d ...


151

If you have the version number, or the target release, apt-get supports choosing a particular version or target release. More details can be found on manual page of apt-get. It can also be accessed from terminal by typing man apt-get sudo apt-get install <package-name>=<package-version-number> OR sudo apt-get -t=<target release> install ...


142

Use the command: apt-cache policy <packageName> This gives you information of all available package versions. Example: alaa@aa-lu:~$ apt-cache policy vlc vlc: Installed: 2.0.8-0ubuntu0.13.04.1 Candidate: 2.0.8-0ubuntu0.13.04.1 Version table: *** 2.0.8-0ubuntu0.13.04.1 0 500 http://ae.archive.ubuntu.com/ubuntu/ raring-updates/...


137

apt-key utility apt-key is used to manage the list of keys used by apt to verify packages. Packages which have been verified using these keys will be considered trusted. To update the local keyring with the keyring of Ubuntu archive keys and removes from the keyring the archive keys which are no longer valid. $ sudo apt-key update $ sudo apt-get update ...


128

Create a backup of what packages are currently installed: dpkg --get-selections > list.txt Then (on another system) restore installations from that list: dpkg --clear-selections sudo dpkg --set-selections < list.txt To get rid of stale packages sudo apt-get autoremove To get installed like at backup time (i.e. to install packages set by dpkg --...


111

To list all packages intentionally installed (not as dependencies) by apt commands, run the following : ( zcat $( ls -tr /var/log/apt/history.log*.gz ) ; cat /var/log/apt/history.log ) | egrep '^(Start-Date:|Commandline:)' | grep -v aptdaemon | egrep '^Commandline:' This provides a reverse time based view, with older commands listed first: Commandline: ...


111

This is a generic answer to the question about the effects of purging packages generally. For advice specific to your situation, you'll have to edit your question to include additional information--in particular, the complete and exact text of the error message you are getting. Removing packages with sudo apt-get purge ... or sudo apt-get --purge remove ... ...


108

As far as I can see, in 10.04, the main differences between aptitude and apt-get are: aptitude adds explicit per-package flags, indicating whether a package was automatically installed to satisfy a dependency: you can manipulate those flags (aptitude markauto or aptitude unmarkauto) to change the way aptitude treats the package. apt-get keeps track of ...


104

As far as I understand your requirements, the madison option for apt-cache does what you want: madison /[ pkg(s) ] apt-cache's madison command attempts to mimic the output format and a subset of the functionality of the Debian archive management tool, madison. It displays available versions of a package in a tabular format. Unlike the original madison, ...


103

Check out Keryx, it's an offline repository manager. How does it work? It lets you download updates and new programs (with dependencies) to your flash drive. Its interface is similar to synaptic but it works from a pendrive (it doesn't need installation). Unfortunately, the GUI needs wxwidgets, which don't come preinstalled on Ubuntu (they're cross-...


103

This is actually a feature of Ubuntu. There is no problem with updating the software with its latest version, and Ubuntu developers might do it easily. And, actually, it is done in several other Linux distributions, including Arch. As you have noticed, Ubuntu software is updated only with security updates and critical bug fixes. All features are "frozen", ...


100

Probably the most popular package managers are apt-get, aptitude, synaptic, and Software Center. There are others (Linux Mint has its own, and there are some designed for KDE), but these are the ones you'll run into most often. apt-get is a simple command-line tool. It's handy if you know the exact package name of what you want to install and don't want to ...


95

Open the Terminal and enter the commands below one by one: sudo apt-get clean cd /var/lib/apt sudo mv lists lists.old sudo mkdir -p lists/partial sudo apt-get clean sudo apt-get update


90

Usually you can just use: make uninstall or sudo make uninstall if the app was installed as root. But this will work only if the developer of the package has taken care of making a good uninstall rule. In the future to avoid that kind of problems try to use checkinstall instead of make install whenever possible (AFAIK always unless you want to keep ...


88

Use aptitude instead of apt-get. It is more intelligent. It not only will handle downgrading conflicting packages for you, but will make a series of recommendations asking you which of many possible suggested working scenarios you would like. sudo aptitude install myNewPackage If you don't have aptitude on your machine yet, get it with sudo apt-get ...



Only top voted, non community-wiki answers of a minimum length are eligible