[Advanced] How to: Use Debian repositories simultaneously with Deepin 15.x
Tofloor
poster avatar
jotapesse
deepin
2016-03-04 14:31
Author
Edited by jotapesse at 2016-3-6 20:37

Deepin 15.x is based of Debian Sid (unstable), that means it uses Debian as a base system and is developed on top of it. It also means we may use/install Debian original packages with a reasonable assurance of compatibility with the Deepin system/desktop packages. The best way to do it is to setup APT to use the original Debian repositories simultaneously with Depin repository, while maintaining Deepin's packages with default higher priority. Debian APT makes this easy with APT settings or package pinning.

Why? Imagine you want to install an updated version of a package/application that has its version frozen in Deepin repository. In example, at the time of this writing, there is a newer version of libreoffice available in Debian Sid:
  1. $ apt-cache policy libreoffice
  2. libreoffice:
  3.   Installed: 1:5.1.0~rc2-1deepin1
  4.   Candidate: 1:5.1.0~rc2-1deepin1
  5.   Version table:
  6.     1:5.1.1~rc1-1 500
  7.       500 http://ftp.debian.org/debian sid/main amd64 Packages
  8. *** 1:5.1.0~rc2-1deepin1 990
  9.       990 http://packages.deepin.com/deepin unstable/main amd64 Packages
  10.       100 /var/lib/dpkg/status
Copy the Code

Disclaimer: Danger: Use this procedure at your own risk. Recommended only for advanced users. Valid only for Deepin 15.x release. Although installing Debian original packages guarantees a very high compatibility with Deepin (Debian based) packages, there is a potencial risk for breakage. You may compromise your system by installing other packages than those from Deepin repository. This procedure has worked for me but it may fail for you. Be sure to follow the following steps completely and verify that it's working before trying to install packages or upgrade your system. If you do not accept the risk do not try it. You have been warned.

Disclaimer #2: Warning: Currently there are issues with upgrades if the Deepin source list was not updated succcessfully (failed attempts/bad connections/bad CDN mechanism). Also from Control Center issued updates. It will result in undesired package upgrades from Debian which may compromise your system stability. If you wish to procede and use this how to you are advised to totally refrain from using Control Center Updates (stop using it completely) and always update from the command line and check the successful source list update and policy update before any install/upgrade. View more information at https://bbs.deepin.org/post/30778.

1. Add Debian Official repositories source list:
Create the file /etc/apt/sources.list.d/debian.list
  1. $ sudo nano /etc/apt/sources.list.d/debian.list
Copy the Code
with the following content:
  1. # Debian Sid/Unstable Official repositories

  2. deb http://ftp.debian.org/debian sid main contrib non-free
  3. deb-src http://ftp.debian.org/debian sid main contrib non-free
Copy the Code

2. Setup either APT Default-Release or APT package pinning:

Either option will work, the first option should work until the end of life of 'Deepin 15.x' (release version 2015), the second will work indefinitely (while Deepin maintains the same package/repository origin name 'Linux Deepin'). Choose either 2.1 or 2.2 option procedure, not both:

2.1. (Option) APT Default-Release:
Create the file /etc/apt/apt.conf.d/90deepin
  1. $ sudo nano /etc/apt/apt.conf.d/90deepin
Copy the Code
with the following content:
  1. // APT configuration
  2. // Deepin Default Release
  3. APT::Default-Release "2015";
Copy the Code

2.2. (Option) APT Package Pinning:
Create the file /etc/apt/preferences
  1. $ sudo nano /etc/apt/preferences
Copy the Code
with the following content:
  1. # APT preferences
  2. # Deepin Package Pinning
  3. Package: *
  4. Pin: release o=Linux Deepin
  5. Pin-Priority: 990
Copy the Code

3. Test APT package policy:
You should always test if your APT settings are taking effect in the APT policy, at any time. Always update APT first, then check policy, then install or upgrade packages (if you wish). You should get a priority value of 990 for Deepin repository packages and priority 500 for Debian repository. This means that, by default, only Deepin packages will be installed or upgraded.
  1. $ apt-cache policy
  2. Package files:
  3. 100 /var/lib/dpkg/status
  4.      release a=now
  5. 500 http://ftp.debian.org/debian sid/non-free i386 Packages
  6.      release o=Debian,a=unstable,n=sid,l=Debian,c=non-free,b=i386
  7.      origin ftp.debian.org
  8. 500 http://ftp.debian.org/debian sid/non-free amd64 Packages
  9.      release o=Debian,a=unstable,n=sid,l=Debian,c=non-free,b=amd64
  10.      origin ftp.debian.org
  11. 500 http://ftp.debian.org/debian sid/contrib i386 Packages
  12.      release o=Debian,a=unstable,n=sid,l=Debian,c=contrib,b=i386
  13.      origin ftp.debian.org
  14. 500 http://ftp.debian.org/debian sid/contrib amd64 Packages
  15.      release o=Debian,a=unstable,n=sid,l=Debian,c=contrib,b=amd64
  16.      origin ftp.debian.org
  17. 500 http://ftp.debian.org/debian sid/main i386 Packages
  18.      release o=Debian,a=unstable,n=sid,l=Debian,c=main,b=i386
  19.      origin ftp.debian.org
  20. 500 http://ftp.debian.org/debian sid/main amd64 Packages
  21.      release o=Debian,a=unstable,n=sid,l=Debian,c=main,b=amd64
  22.      origin ftp.debian.org
  23. 990 http://packages.deepin.com/deepin unstable/non-free i386 Packages
  24.      release v=2015,o=Linux Deepin,n=unstable,l=Deepin,c=non-free,b=i386
  25.      origin packages.deepin.com
  26. 990 http://packages.deepin.com/deepin unstable/non-free amd64 Packages
  27.      release v=2015,o=Linux Deepin,n=unstable,l=Deepin,c=non-free,b=amd64
  28.      origin packages.deepin.com
  29. 990 http://packages.deepin.com/deepin unstable/contrib i386 Packages
  30.      release v=2015,o=Linux Deepin,n=unstable,l=Deepin,c=contrib,b=i386
  31.      origin packages.deepin.com
  32. 990 http://packages.deepin.com/deepin unstable/contrib amd64 Packages
  33.      release v=2015,o=Linux Deepin,n=unstable,l=Deepin,c=contrib,b=amd64
  34.      origin packages.deepin.com
  35. 990 http://packages.deepin.com/deepin unstable/main i386 Packages
  36.      release v=2015,o=Linux Deepin,n=unstable,l=Deepin,c=main,b=i386
  37.      origin packages.deepin.com
  38. 990 http://packages.deepin.com/deepin unstable/main amd64 Packages
  39.      release v=2015,o=Linux Deepin,n=unstable,l=Deepin,c=main,b=amd64
  40.      origin packages.deepin.com
Copy the Code
You may check the policy for a specific package, check the example for libreoffice on the top of the post. The same priority values should be visible and there may be different versions available. Deepin packages sould always be the default candidates to install or upgrade, even if their version is lower (unless a Debian package was installed as explained in 5.).

4. Install Deepin packages:
To install any packages from the Deepin repository you don't have to anything different. Either from Deepin Store, Synaptic or using the command line, in example:
  1. $ sudo apt-get install libreoffice
Copy the Code

5. Install (or upgrade to) Debian packages:
You may now upgrade a currently installed or install a new package. All needed newer version dependencies, if required, will also be installed from Debian repository. Use:
  1. $ sudo apt-get -t sid install libreoffice
Copy the Code

That's it. Always update and verify your APT policy first, then install or upgrade from the command line. The use of Control Center System Updates is not recommended!  Have fun! :-)



Reply Favorite View the author
All Replies
3 / 3
To page
jotapesse
deepin
2016-03-07 12:48
#41
https://bbs.deepin.org/post/30778
That is why solving the problem in the Asia thread was so difficult for them as they had never enc ...

It seems we are all learning here, right? Good! :-)
Reply View the author
dance707
deepin
2016-03-07 12:58
#42
https://bbs.deepin.org/post/30778
It seems we are all learning here, right? Good! :-)

Yes that is true and we thank you @jotapesse as well for your help and knowledge on Debian ways of doing things.

Reply View the author
divb_0
deepin
2016-09-30 12:43
#43
Hi, thanks a lot for this info, helps so much, right now I did the process 2.2 mostly to get the latest version of Thunderbird, but when I run apt-cache policy thunderbird, only shows version of normal deepin package, others packages like virtualbox or vlc shows both, the debian sid and deepin. Maybe thunderbird isn't anymoer in debian sid? How can I get the latest version full installed with this method? Sorry for many questions.
Reply View the author
jotapesse
deepin
2016-09-30 14:11
#44
https://bbs.deepin.org/post/30778
Hi, thanks a lot for this info, helps so much, right now I did the process 2.2 mostly to get the lat ...

Hi. You're welcome.

Please take notice that by using this procedure you may damage your Deepin install if you don't know what you're doing. Having that said, Debian does not ship Thunderbird but a renamed/unbranded version: Icedove. It's the same app but with a different name, so you may install it. Like it did before with Firefox (Iceweasel), but not anymore.

https://packages.debian.org/sid/icedove

Have fun! :-)
Reply View the author
3 / 3
To page
New Thread

Popular Events

More
国际排名
WHLUG