Hot answers tagged

1452

Use n module from npm in order to upgrade node sudo npm cache clean -f sudo npm install -g n sudo n stable To upgrade to latest version (and not current stable) version, you can use sudo n latest Fix PATH: sudo apt-get install --reinstall nodejs-legacy # fix /usr/bin/node To undo: sudo n rm 6.0.0 # replace number with version of Node that was ...


725

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 ...


605

Ubuntu 14.04 (Trusty) and 16.04 (Xenial) If you are using Ubuntu 14.04 or 16.04, you can use Felix Krull's deadsnakes PPA at https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa: sudo add-apt-repository ppa:deadsnakes/ppa sudo apt-get update sudo apt-get install python3.6 J Fernyhough's PPA (at https://launchpad.net/~jonathonf/+archive/ubuntu/python-3.6) ...


554

With a question as weird as this, it's of course impossible to say for sure -- but I'll eat my hat if my first hunch isn't correct. :) The only way I can think of, how such unrelated things could be linked is this: After installing (well, extracting) Dwarf Fortress, instead of going to the directory every time and running it with ./df, you wanted to be able ...


530

They are very similar command line tools available in Trusty (14.04) and later. apt-get and apt-cache's most commonly used commands are available in apt. apt-get may be considered as lower-level and "back-end", and support other APT-based tools. apt is designed for end-users (human) and its output may be changed between versions. Note from apt(8): ...


526

Complete installation instructions have since been uploaded here by Nodesource. It is copied below for your reference. Instructions are the same for updating to the latest version. If you don't like curl ... | sudo bash - then you can follow the manual instructions, which tells you how to add the Node.js repository to /etc/apt/sources.list.d/ yourself. NOTE: ...


407

For Ubuntu 14.04 or later you need to install the software-properties-common package: sudo apt install software-properties-common I found the solution in this blog: Ubuntu Server 14.4 (Trusty Tahr) – add-apt-repository: command not found


364

I tracked down offending repo (any for Google chrome in this dir) cd /etc/apt/sources.list.d grep chrome * | grep -v amd64 or more generally grep -r google /etc/apt | grep -v amd64 Now do same as below for each repo file which matches above cat /etc/apt/sources.list.d/google-chrome-unstable.list ### THIS FILE IS AUTOMATICALLY CONFIGURED ### # You may ...


333

I figured out how to get apt-get to work again. Edit gai.conf: sudo vim /etc/gai.conf change line ~54 to uncomment the following: precedence ::ffff:0:0/96 100 write and quit: :wq CAUTION Look out line 50 which looks almost identical: precedence ::ffff:0:0/96 10 This is the wrong line. Go ~4 lines down and you'll find the correct line to uncomment ...


299

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 ...


298

The problem is that the teamviewer_linux_x64.deb, the package that was aimed to 64-bit systems, uses a obsolete package that tried to achieve multiarch previously in Debian based systems called ia64-libs. Although, that package scheme changed and now Teamviewer distribute the native build for both i386 and amd64 architecture, as they don't need anymore ...


267

You can use either of these two one-liners. Both yield the exact same output on my machine and are more precise than all solutions proposed up until now (July 6, 2014) in this question. Using apt-mark: comm -23 <(apt-mark showmanual | sort -u) <(gzip -dc /var/log/installer/initial-status.gz | sed -n 's/^Package: //p' | sort -u) Using aptitude: comm ...


267

Try this Unix SE answer: sudo apt-get --with-new-pkgs upgrade This allows new packages to be installed. It will let you know what packages would be installed and prompt you before actually doing the install. apt command (friendly alternative to apt-get) share this option. Using apt install <pkg> instead will mark pkg as "manually installed"!! To ...


261

Recent, up-to-date solution I wrote a Python script to automate this task. You can find the most recent version here. Installation: Install the prerequisites: sudo apt install python3-apt Download the PYZ bundle (aptsources-cleanup.pyz) from the latest release. Mark the PYZ bundle as executable: chmod a+x aptsources-cleanup.pyz Usage: From the download ...


261

It would help if you posted your repositories, but, with that said, you sort of have 2 ways to fix this. First would be to use apt rather than apt-get. apt is preferred over apt-get for interactive use in recent Ubuntu versions; and apt should, in theory, fix this for you. sudo apt update sudo apt upgrade Your second option is to use --allow-releaseinfo-...


261

This may happen if 'Synaptic Package Manager' or 'Software Updater' is open. Some apt command is running in Terminal. Some apt process is running in background. For above wait for the process to complete. If this does not happen run in terminal: sudo killall apt apt-get If none of the above works, remove the lock files. Run in terminal: sudo rm /var/lib/...


256

Remove all the stock php packages List installed php packages with dpkg -l | grep php| awk '{print $2}' |tr "\n" " " then remove unneeded packages with sudo aptitude purge your_packages_here or if you want to directly remove them all use : sudo apt-get purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "` Add the PPA sudo add-apt-repository ppa:...


246

By far the simplest way to handle this now is with Y-PPA-Manager (which now integrates the launchpad-getkeys script with a graphical interface). To install it, first add the webupd8 repository for this program: sudo add-apt-repository ppa:webupd8team/y-ppa-manager Update your software list and install Y-PPA-Manager: sudo apt-get update sudo apt-get install ...


238

I was able to install npm by doing following: sudo apt-get install nodejs-dev node-gyp libssl1.0-dev and sudo apt-get install npm


231

Snap attempts to solve one of the fundamental problems with Linux as a desktop operating system: software availability and software distribution. Snap is not intended to completely replace debs, however. Snaps and Debs work alongside each other. I am a Linux enthusiast and a project manager of a Linux application. While I love Linux systems as a whole, I can'...


229

Felix Krull runs a PPA offering basically any version of Python (seriously, there is 2.3.7 build for vivid...) for many Ubuntu releases at https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa. Do the usual: sudo add-apt-repository ppa:deadsnakes/ppa sudo apt-get update sudo apt-get install python3.5 It will not overwrite your existing python3.4 which is ...


228

A solution to this locking problem is detailed in the wiki: sudo fuser -v /var/cache/debconf/config.dat Will show you what process is holding the lock: USER PID ACCESS COMMAND /var/cache/debconf/config.dat: root 18210 F.... dpkg-preconfigu Then you simply need to note down the PID and kill it like so: ...


221

For the following Ubuntu versions, you can install with the given commands, as per the official PostgreSQL Apt Repository. Ubuntu 17.04 - 17.10 Version 9.6 comes with the distribution. sudo apt-get install postgresql-9.6 Ubuntu 14.04, 16.04 sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main" wget --quiet -...


211

On 16.10 the short key id is no longer shown when you use the list command, but it is actually the last 8 characters of the long hex. So for example the key id for the following key /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg ------------------------------------------------------ pub rsa4096 2012-05-11 [SC] 8439 38DF 228D 22F7 B374 2BC0 ...


206

For packages that are in your repositories you can use: dpkg --print-avail PACKAGE_NAME or apt-cache show PACKAGE_NAME or aptitude show PACKAGE_NAME or apt show PACKAGE_NAME


204

Use the PPA from the maintainers of git on Ubuntu: sudo apt-add-repository ppa:git-core/ppa sudo apt-get update sudo apt-get install git If you don't know what PPAs are, first read What are PPAs and how do I use them? If you receive an error about add-apt-repository command not found you need to install software-properties-common, and then redo the above ...


202

No, dpkg only installs a package, so doing dpkg -i packageName.deb will only install this Deb package, and will notify you of any dependencies that need to be installed, but it will not install them, and it will not configure the packageName.deb because well...the dependencies are not there. apt-get is a Package Management System that handles the ...


201

Note: this answer is meant to be more of an 'explanation' than providing the best/easiest way to remove old kernels. For the best/easiest way to remove old kernels, please review the other answers. Okay, so from the output of /etc/fstab you posted, it seems that your /boot is mounted on a separate partition, and from the output of df -h, that partition is ...


198

The first procedure you followed is correct sudo apt-get -y install python3-pip But before installing try to update using command sudo apt-get update If first did not work then you can also do this using curl curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" python3 get-pip.py --user Then to verify installation try pip3 --help For checking ...


193

This worked for me, courtesy of Zach Adams (https://zach-adams.com/2015/01/apt-get-cant-connect-to-security-ubuntu-fix/): Turns out this is an issue where connecting over IPv6 on some servers causes them to get stuck at this point. The fix is really simple. Open /etc/gai.conf Under the line # For sites which prefer IPv4 connections change the last ...


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