Answer by lanoxx for How to automatically update /etc/apt/sources.list with...
Here is a simplification of @Tobi's result that does it on a single call to sed:sed -i -- 's/#\s\?deb-src/deb-src/g' /etc/apt/sources.listThis adds \s\? which is an optional white space (note the ?...
View ArticleAnswer by whitis for How to automatically update /etc/apt/sources.list with...
simpler solution that does what the others have posted more succinctly:sudo perl -p -i -n -e "s/# *deb-src/deb-src/" /etc/apt/sources.listKey distinctions: Perl has the -i inplace option which modifies...
View ArticleAnswer by Tobi for How to automatically update /etc/apt/sources.list with...
I had this same issue on a server install of Ubuntu 16.04, so no GUI. All that I needed was a couple of sed commands.sudo sed -i -- 's/#deb-src/deb-src/g' /etc/apt/sources.list && sudo sed -i...
View ArticleAnswer by Gunnar Hjalmarsson for How to automatically update...
Open Software & Updates and enable "Source code".
View ArticleAnswer by Håkon Hægland for How to automatically update /etc/apt/sources.list...
Here is a (currently untested) Bash script that could be used to uncomment deb-src lines in sources.list :tempdir=$(mktemp -d)cd "$tempdir"source_file=/etc/apt/sources.listnew_file=sources.list.newperl...
View ArticleHow to automatically update /etc/apt/sources.list with source URIs on Ubuntu...
The following command worked fine on Ubuntu 15.10:sudo apt-get build-dep emacs24However, on Ubuntu 16.04 I get the following error when running it:Reading package lists... DoneE: You must put some...
View ArticleAnswer by Otto Kekäläinen for How to automatically update...
You can safely run this snipped as root on any Debian/Ubuntu system:if [ -f /etc/apt/sources.list ]then grep '^deb ' /etc/apt/sources.list | \ sed 's/^deb /deb-src /g'>...
View Article