发新帖

[Advanced] How to: Use Debian repositories simultaneously with Deepin 15.x

jotapesse / 2016-3-4 06:31
浏览: 1961 / 回复: 41
查看: 1961|回复: 41

[Advanced] How to: Use Debian repositories simultaneously with Deepin 15.x

[复制链接]
收藏
跳转到指定楼层
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
复制代码

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

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
复制代码
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
复制代码

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
复制代码
with the following content:
  1. // APT configuration
  2. // Deepin Default Release
  3. APT::Default-Release "2015";
复制代码

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

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
复制代码
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
复制代码

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
复制代码

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! :-)



0

主题

2

帖子

58

积分

-r--------

Rank: 1

积分
58
jotapesse 发表于 2016-3-4 07:35:50 | 显示全部楼层
Edited by jotapesse at 2016-3-3 23:55

I added this how to as a contribution to Deepin wiki, under the sections:
System Management > Software Management > Software Instalation > How to: Use Debian repositories simultaneously with Deepin 15.x

2

主题

3

帖子

156

积分

-r--------

Rank: 1

积分
156
tristar 发表于 2016-3-4 07:53:41 | 显示全部楼层
Thank you ! :)

0

主题

2

帖子

58

积分

-r--------

Rank: 1

积分
58
jotapesse 发表于 2016-3-4 07:56:24 | 显示全部楼层

You're welcome! :-)

0

主题

13

帖子

851

积分

drw-r-----

Rank: 7Rank: 7Rank: 7

积分
851
dance707 发表于 2016-3-4 12:00:35 | 显示全部楼层
I think there is problems with this method. I tested your 2.1 option to check out different web browsers. Latter in the evening I did a sudo apt-get upgrade and a package upgraded to a SID version from a Deepin version that I did not want done.
DeepinScreenshot20160303205637.png

0

主题

2

帖子

58

积分

-r--------

Rank: 1

积分
58
jotapesse 发表于 2016-3-4 18:02:00 | 显示全部楼层
Edited by jotapesse at 2016-3-4 10:03
dance707 replied at 2016-3-4 04:00
I think there is problems with this method. I tested your 2.1 option to check out different web brow ...

I'm sorry, but I can't replicate your issue. I just checked and I got:
  1. $ apt-cache policy xserver-xorg-video-intel
  2. xserver-xorg-video-intel:
  3.   Installed: 2:2.99.917-2
  4.   Candidate: 2:2.99.917-2
  5.   Version table:
  6.     2:2.99.917+git20160218-1 500
  7.     500 http://ftp.pt.debian.org/debian sid/main amd64 Packages
  8. *** 2:2.99.917-2 990
  9.     990 http://packages.deepin.com/deepin unstable/main amd64 Packages
  10.     100 /var/lib/dpkg/status
复制代码
You must have done something different. The Debian package has lower priority (500) than the Deepin's package (990). The Debian package will never be candidate to install/upgrade. Unless you have installed or upgraded this package (or any other package that requires this package as a dependency) by using: sudo apt-get -t sid install... In that case, apt-get will upgrade all dependencies packages to the versions required by the original upgraded package.

0

主题

13

帖子

851

积分

drw-r-----

Rank: 7Rank: 7Rank: 7

积分
851
dance707 发表于 2016-3-4 18:16:23 | 显示全部楼层
jotapesse replied at 2016-3-4 03:02
I'm sorry, but I can't replicate your issue. I just checked and I got:You must have done something  ...

It tested on my workstation and it works just  fine. Its that one of my computers it did not. The computer that did not work okay seems to be experiencing the same bug that has been reported in the forum often where the Deepin Store locks up for no apparent reason. While it is a nice tutorial and every thing looks okay. I am concerned the possible unforeseen consequences of using this method on systems that the user may not be aware of possible problems. And how we respond in the forum to help users.

0

主题

13

帖子

851

积分

drw-r-----

Rank: 7Rank: 7Rank: 7

积分
851
dance707 发表于 2016-3-4 18:33:02 | 显示全部楼层
dance707 replied at 2016-3-4 03:16
It tested on my workstation and it works just  fine. Its that one of my computers it did not. The  ...

And by the way I did not do something different I even tested the APT policy . I got the message from Cxbii in the Chinese forum that system can be updated normally and simply updated the system.

0

主题

2

帖子

58

积分

-r--------

Rank: 1

积分
58
jotapesse 发表于 2016-3-4 19:09:40 | 显示全部楼层
dance707 replied at 2016-3-4 10:33
And by the way I did not do something different I even tested the APT policy . I got the message f ...

I'm sorry, I really can't explain it otherwise. If you haven't upgraded that package or a different package that requires that package as a dependency (inadvertently), I can only think of a remote possibility: that at some point there was a failure in the update of the Deepin source list and apt-get reverted to the remaining (and only) Debian source list and had that package as the only upgrade candidate. That's why we should always check and confirm apt-cache policy before any install/upgrade, but you did that.

I have been using this method for many months, even before with Debian and using simultaneously Stable, Testing, Unstable and Experimental repositories. As long as the policy stands, the candidates to install/upgrade will be the default release, unless explicitly told otherwise.

I'll be upgrading my troubled system today and I'll report back if the same issue occurs.

0

主题

2

帖子

58

积分

-r--------

Rank: 1

积分
58
jotapesse 发表于 2016-3-4 19:17:20 | 显示全部楼层
dance707 replied at 2016-3-4 10:16
It tested on my workstation and it works just  fine. Its that one of my computers it did not. The  ...

Your concerns are valid. That's why I wrote the "Disclaimer: /!\ Danger: Use this procedure at your own risk." This is an advanced method and has an associated risk for potential failure, although it's well tested and used for a long time. If one does not accept that risk then it should not try it.

0

主题

13

帖子

851

积分

drw-r-----

Rank: 7Rank: 7Rank: 7

积分
851
dance707 发表于 2016-3-4 19:25:05 | 显示全部楼层
jotapesse replied at 2016-3-4 04:17
Your concerns are valid. That's why I wrote the "Disclaimer: /!\ Danger: Use this procedure at you ...

I understand . And it is a very nice tutorial. I am just reporting what happened to me on the system where apt often seems to be locked up for no apparent reason.

0

主题

2

帖子

58

积分

-r--------

Rank: 1

积分
58
jotapesse 发表于 2016-3-4 19:33:51 | 显示全部楼层
dance707 replied at 2016-3-4 11:25
I understand . And it is a very nice tutorial. I am just reporting what happened to me on the syst ...

And I appreciate your feedback. Failed/locked APT and consequently a failed source list update can give that undesired result. I have experienced that failed APT update but always verified it on the policy. Retrying the APT update until it succeeds (no errors at all) and confirming it on the policy always gave me the expected result.

0

主题

13

帖子

851

积分

drw-r-----

Rank: 7Rank: 7Rank: 7

积分
851
dance707 发表于 2016-3-4 19:41:41 | 显示全部楼层
jotapesse replied at 2016-3-4 04:33
And I appreciate your feedback. Failed/locked APT and consequently a failed source list update can ...

Yes and if they are updating from the control panel they would not know and maybe forgot the instructions they read in Wiki.

0

主题

2

帖子

58

积分

-r--------

Rank: 1

积分
58
jotapesse 发表于 2016-3-4 19:56:37 | 显示全部楼层
dance707 replied at 2016-3-4 11:41
Yes and if they are updating from the control panel they would not know and maybe forgot the instr ...

True. A careless/unsavvy/unaware user may contribute to failure of it's system. And..? This is the beauty of GNU/Linux. I have done it many times :-) You are given the option and freedom of choice. Since you opted and accepted the risk to change the system you also took on you the responsibility. We can only provide the best information as possible (and that's a lot). The choice is on the user.

0

主题

2

帖子

58

积分

-r--------

Rank: 1

积分
58
jotapesse 发表于 2016-3-5 01:14:35 | 显示全部楼层
jotapesse replied at 2016-3-4 11:09
I'm sorry, I really can't explain it otherwise. If you haven't upgraded that package or a differen ...

@dance707 Happy to report that after upgrading my troubled system with latest upgrades, everything worked fine. So your reported issue should be probably related to a failed/bad APT sources lists update / policy update.
  1. $ apt-cache policy xserver-xorg-video-intel
  2. xserver-xorg-video-intel:
  3.   Installed: 2:2.99.917-2
  4.   Candidate: 2:2.99.917-2
  5.   Version table:
  6.      2:2.99.917+git20160218-1 500
  7.         500 http://ftp.pt.debian.org/debian sid/main amd64 Packages
  8. *** 2:2.99.917-2 990
  9.         990 http://packages.deepin.com/deepin unstable/main amd64 Packages
  10.         100 /var/lib/dpkg/status
复制代码

0

主题

13

帖子

851

积分

drw-r-----

Rank: 7Rank: 7Rank: 7

积分
851
dance707 发表于 2016-3-5 02:11:41 | 显示全部楼层
jotapesse replied at 2016-3-4 10:14
@dance707 Happy to report that after upgrading my troubled system with latest upgrades, everything ...

Good to hear yours working better on the boot fixes. We are still waiting for them to push the other patches.

0

主题

13

帖子

851

积分

drw-r-----

Rank: 7Rank: 7Rank: 7

积分
851
dance707 发表于 2016-3-6 15:09:24 | 显示全部楼层
jotapesse replied at 2016-3-4 10:14
@dance707 Happy to report that after upgrading my troubled system with latest upgrades, everything ...

Just to let you know on a third system I did updates on it also installed a Sid package I had not requested.  I had not installed anything at all and followed the instructions. The apt on third system did not seem to have any trouble before. I do not think the priorities function is working correctly.
DeepinScreenshot20160305225206.png

0

主题

13

帖子

851

积分

drw-r-----

Rank: 7Rank: 7Rank: 7

积分
851
dance707 发表于 2016-3-6 15:44:34 | 显示全部楼层
dance707 replied at 2016-3-6 00:09
Just to let you know on a third system I did updates on it also installed a Sid package I had not  ...

It shows 5.0.14 as being installed because at the time of upgrading the system that was the newest version.  5.0.16 was just added to Sid today. Users should also be aware even if this method works for them there are certain things that will not function correctly even on a clean reinstall of the root partition.

0

主题

2

帖子

58

积分

-r--------

Rank: 1

积分
58
jotapesse 发表于 2016-3-6 19:11:20 | 显示全部楼层
dance707 replied at 2016-3-6 07:44
It shows 5.0.14 as being installed because at the time of upgrading the system that was the newest ...

Hi @dance707 thanks for your feedback. Good find.

In my case I currently have:
  1. $ apt-cache policy virtualbox
  2. virtualbox:
  3.   Installed: 5.0.14-dfsg-2+b1
  4.   Candidate: 5.0.16-dfsg-2
  5.   Version table:
  6.     5.0.16-dfsg-2 500
  7.       500 http://ftp.pt.debian.org/debian sid/contrib amd64 Packages
  8. *** 5.0.14-dfsg-2+b1 100
  9.       100 /var/lib/dpkg/status
  10.     5.0.12-dfsg-2 990
  11.       990 http://packages.deepin.com/deepin unstable/contrib amd64 Packages
复制代码
I searched and found that virtualbox was upgraded from 5.0.12 to 5.0.14 by Deepin Control Center upgrade in 2016-02-27. Since Deepin repo doesn't offer that version it came from Debian repo. Why? This seems to be not a priority issue but an issue with the Deepin source lists update. I can only think that the trouble here is Deepin Control Center/Updates.

Because:
1. There are a lot of locked/failed source list update atempts, I have to frequently kill apt-get to update it on the command line;
2. The frequent source list update fails seem to be related to slow repositories/mirror connections or Official CDN response mechanism;
3. Control Center seems to blindly dist-upgrade with no regard for previous failed source list update attempts;
4. With a failed Deepin source list update, APT will use the remaining and only Debian source list but it will lack any higher priority packages (Deepin) to compare and thus will use Debian's resulting in undesired packages being upgraded from Debian.

Conclusion: My proposed how to procedure is highly dependent on proper APT source list updates. Deepin's source list updates are somewhat troublesome currently (slow response/bad mirror connections/bad CDN mechanism). Currently, this must be human verified at the command line. So, in order to not have any undesired package upgraded from Debian you are required to totally refrain from using Deepin's Control Center updates and opt to do it at the command line. From the command line with proper source list update and policy check you sould be safe. I'll update the how to with this findings.

Request: Perhaps Deepin team can see if it can improve Control Center's update/CDN mechanism to support this alternative Debian repositories procedure in the future? Probably a check if Deepin's source list was updated properly and a refusal to upgrade in case of failed update would suffice. Better yet, integrate this alternative in Control Center as an advanced option, as well as automatic updates (Debian unattended-upgrades). I'll suggest this by Deepin user Feedback.

0

主题

13

帖子

851

积分

drw-r-----

Rank: 7Rank: 7Rank: 7

积分
851
dance707 发表于 2016-3-6 19:27:06 | 显示全部楼层
jotapesse replied at 2016-3-6 04:11
Hi @dance707 thanks for your feedback. Good find.

In my case I currently have:

Also keep in mind Deepin already uses some what of a modified apt policy with the switching mirrors in /etc/apt/apt.conf.d/99mirrors.conf
Also I noticed line 4 of your code src is enabled but on Deepin it is not. ?
I noticed that it wants to update to 5.0.16 I am okay with that because my server is also that version. But why is it trying to update to 5.0.16 if it was a Deepin package before ?
And users should be aware if they upgrade with this method and then reinstall with a new iso to root next week there vm's will not work.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回列表 返回版块 返回顶部