Ubuntu – How to enable Disabled third party sources from command line after upgrade

16.04aptcommand lineupgrade

I've upgraded from 14.04 to 16.04. As per the upgrade instruction, third party sources were disabled. After the upgrade, I cannot find a possible way to enable those third party sources using command line instead of System Settings > Software & Updates > Other Software.

I need to do it on command line because changing it via Settings requires password of a Super Privileged user (idk if that's the exact term). I can do all of the sudo and sudo su stuffs in command line with my current login, even though I've upgraded to 16.04 using sudo do-release-upgrade (Weird right..!? idk why sysadmin set up that restriction in first place).

Also another possible solution I think of is to reinstall those packages again which will re-enable those sources I guess.

Best Answer

I manage my sources manually from cli using a regular text editor like vim or nano.

The main sources.list is located here:

/etc/apt/sources.list

and most third party sources are at:

/etc/apt/sources.list.d/

you can simply use a text editor to edit and enable them (uncomment):

sudo nano /etc/apt/sources.list.d/sample-sources.list

there should be lines like:

# deb http://ppa-url.com/ubuntu trusty main

you should uncomment them (remove #):

deb http://ppa-url.com/ubuntu trusty main

then the save the edited file and run sudo apt update.

Related Question